我对如何操作更改 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/