0

在 OAuth 2.0 Playground 中,我可以提出这个请求,并且它是有效的:

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”

4

1 回答 1

1

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

于 2013-09-19T05:34:59.757 回答