api - 检测 Google 云端硬盘更改

标签 api google-drive-api drive

我对如何操作更改 API 感到很困惑。

目前,我只是发出 get 请求:

https://www.googleapis.com/drive/v3/changes?access_token=**my_token**&pageToken=68485 **列表中的最后一些添加内容

我得到:

{
 "kind": "drive#changeList",
 "newStartPageToken": "68489",
 "changes": [
  {
   "kind": "drive#change",
   "type": "file",
   "time": "2017-04-08T00:40:36.141Z",
   "removed": false,
   "fileId": "***ID",
   "file": {
    "kind": "drive#file",
    "id": "***ID",
    "name": "***NAME",
    "mimeType": "application/vnd.google-apps.folder"
   }
  },
  {
   "kind": "drive#change",
   "type": "file",
   "time": "2017-04-08T00:41:00.171Z",
   "removed": false,
   "fileId": "***ID2",
   "file": {
    "kind": "drive#file",
    "id": "***ID2",
    "name": "***NAME2",
    "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
   }
  }
 ]

我不知道对更改数组中的第一项进行了更改。

经过尝试,我意识到每次打开文件夹时都会添加到更改中,为什么?是否因为元数据正在更改,即上次访问

预览/打开/下载文件时是否会发生同样的情况?

我删除了数组中的第二项,但它没有显示任何内容。

我该如何准确地告诉发生了什么变化。我正在尝试检索文件更新、创建、删除等事件。

最佳答案

Changes 使用的官方属性可在 Changes resource representations 中找到。 :

{
  "kind": "drive#change",
  "type": string,
  "time": datetime,
  "removed": boolean,
  "fileId": string,
  "file": files Resource,
  "teamDriveId": string,
  "teamDrive": teamdrives Resource
}

关于api - 检测 Google 云端硬盘更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43289012/

相关文章:

google-drive-api - 无法使用 Google Colab 创建/上传或打开笔记本

javascript - 从 Google 云端硬盘请求文件元数据时缺少 'downloadUrl' 参数

batch-file - icacls 替换权限驱动器 root

python - 如何在 Django Rest Framework 中处理 PUT 请求

android - 使用 Loopback Android SDK 访问后端

javascript - 在公司网络中分发 Google Apps Scripts for Sheets

Java::如何将 Google Drive 中存储的 Excel 文件导入到特定的 Google 电子表格

node.js - 将 Google 推送通知结果设置为错误 401 未经授权的 WebHook 回调 channel

android: 二进制 XML 文件第 9 行:类 fragment 膨胀错误

performance - Jmeter和Postman的响应时间差异