Google drive api 如何使用包含exportLinks的部分响应发出Google驱动器文件获取请求;文本/纯文本“;?

Google drive api 如何使用包含exportLinks的部分响应发出Google驱动器文件获取请求;文本/纯文本“;?,google-drive-api,Google Drive Api,在OAuth 2.0游乐场中,我可以提出此请求,并且它是有效的: https://www.googleapis.com/drive/v2/files?fields=items(id,exportLinks) 然而,我想要捕获的只是其中一个导出链接:“text/plain”。但如果我要求该特定字段: https://www.googleapis.com/drive/v2/files?fields=items(exportLinks/text/plain) 我得到以下错误: { "error

在OAuth 2.0游乐场中,我可以提出此请求,并且它是有效的:

https://www.googleapis.com/drive/v2/files?fields=items(id,exportLinks)
然而,我想要捕获的只是其中一个导出链接:“text/plain”。但如果我要求该特定字段:

https://www.googleapis.com/drive/v2/files?fields=items(exportLinks/text/plain)
我得到以下错误:

{
  "error": {
   "errors": [
    {
     "domain": "global",
     "reason": "invalidParameter",
     "message": "Invalid field selection plain",
     "locationType": "parameter",
     "location": "fields"
    }
  ],
   "code": 400,
   "message": "Invalid field selection plain"
  }
}

如何指定分部应包含“exportLinks”/“text/plain”

您不能请求特定的exportLink类型。您需要请求它们所有的“items(exportLinks)”,然后查找返回的exportLinks对象的“text/plain”属性(“var url=exportLinks['text/plain']”)