0

通过在 GoogleAppsScript 中访问组设置一再没有乐趣,UrlFetch我希望根据APIs Explorer中的文档测试我正在使用的基本查询

UrlFetchApp.fetch('https://www.googleapis.com/groups/v1/groups/exampleGroupId@example.com?key={YOUR_API_KEY}', fetchArgs);

永远不会完成一轮

API 资源管理器也因类似错误而失败的事实至少给了我一些安慰,但是在哪里报告失败呢?

GET https://www.googleapis.com/groups/v1/groups/exampleGroupId@example.com?key={YOUR_API_KEY}
Authorization:  Bearer ya29....[snip]
X-JavaScript-User-Agent:  Google APIs Explorer

200 OK
cache-control:  private, max-age=0, must-revalidate, no-transform
content-encoding:  gzip
content-length:  731
content-type:  application/atom+xml; charset=UTF-8
date:  Tue, 12 Nov 2013 11:31:09 GMT
etag:  "N…[snip]…I"
expires:  Tue, 12 Nov 2013 11:31:09 GMT
server:  GSE

[application/atom+xml; charset=UTF-8 data]

向查询中添加任何字段

GET https://www.googleapis.com/groups/v1/groups/exampleGroupId@example.com?fields=archiveOnly&key={YOUR_API_KEY}
Authorization:  Bearer ya29....[snip]
X-JavaScript-User-Agent:  Google APIs Explorer

总是导致错误

400 Bad Request
cache-control:  private, max-age=0
content-encoding:  gzip
content-length:  209
content-type:  application/vnd.google.gdata.error+xml; charset=UTF-8
date:  Tue, 12 Nov 2013 11:33:34 GMT
expires:  Tue, 12 Nov 2013 11:33:34 GMT
server:  GSE

[application/vnd.google.gdata.error+xml; charset=UTF-8 data]

<?xml version="1.0" encoding="UTF-8"?>
<errors xmlns="http://schemas.google.com/g/2005">
 <error>
  <domain>GData</domain>
  <code>invalidParameter</code>
  <location type="parameter">fields</location>
  <internalReason>Invalid field selection archiveOnly</internalReason>
 </error>
</errors>

API 有问题吗?

4

1 回答 1

1

尝试改用Google OAuth 2.0 Playground。我认为 Groups Settings API Explorer 坏了。

我也无法在 Apps 脚本中实现 with。我陷入了授权循环。与此报告的错误类似。https://code.google.com/p/google-apps-script-issues/issues/detail?id=3046

于 2014-05-23T19:10:02.620 回答