Drive REST API不再返回已删除评论的用户名?

时间:2019-05-23 12:00:56

标签: google-api google-drive-api

我们一直在使用Google Drive REST v3 API通过includeDeleted选项检索评论。

直到最后几天的某个时候,这将返回发表已删除评论的人的用户名,尽管内容本身不再可用。

现在我们也没有得到用户名。其他人有没有经历过?

API参数:

https://www.googleapis.com/drive/v3/files/{MyFileId}/comments?includeDeleted=true&pageSize=100&fields=comments

两个不包含用户信息的已删除评论的输出:

{
   "kind": "drive#comment",
   "id": "AAAAC8EryOw",
   "createdTime": "2019-05-08T14:47:46.931Z",
   "modifiedTime": "2019-05-08T14:48:01.276Z",
   "deleted": true,
   "replies": []
  },

{
   "kind": "drive#comment",
   "id": "AAAAC4otGzE",
   "createdTime": "2019-05-06T09:33:32.862Z",
   "modifiedTime": "2019-05-08T14:37:48.699Z",
   "deleted": true,
   "replies": []
},

1 个答案:

答案 0 :(得分:0)

我认为您可能与Google云端硬盘api v3的partial response有问题。尝试设置字段= *

https://www.googleapis.com/drive/v3/files/{MyFileId}/comments?includeDeleted=true&pageSize=100&fields=*

如果这不起作用,我怀疑您需要执行comment.get,这样您就可以查看每个评论的完整评论回复。

{
  "kind": "drive#comment",
  "id": string,
  "createdTime": datetime,
  "modifiedTime": datetime,
  "author": {
    "kind": "drive#user",
    "displayName": string,
    "photoLink": string,
    "me": boolean,
    "permissionId": string,
    "emailAddress": string
  },
  "htmlContent": string,
  "content": string,
  "deleted": boolean,
  "resolved": boolean,
  "quotedFileContent": {
    "mimeType": string,
    "value": string
  },
  "anchor": string,
  "replies": [
    replies Resource
  ]
}