0

Having had repeatedly no joy with accessing groups settings via UrlFetch in GoogleAppsScript I looked to test the basic query I was using according to the docs in the APIs Explorer

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

Never completes a round tring

The fact that the APIs explorer also fails with similar errors at least gives me some comfort, but where to report the failing?

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

gives

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]

adding any field to the query

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

always results in error

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>

Is the API borked?

JSDBroughton
  • 3,966
  • 4
  • 32
  • 52

1 Answers1

1

Try using the Google OAuth 2.0 Playground instead. I think the Groups Settings API Explorer is broken.

I am also having trouble with implementing with in Apps Script. I am stuck in an authorization loop. Similar to this reported bug. https://code.google.com/p/google-apps-script-issues/issues/detail?id=3046

James Krimm
  • 149
  • 2
  • 10
  • Yes. Using O2 playground allows you to specify json delivery which is what GS Explorer is doing but not applying the request header. So the errors are triggered because json isnt xml. Go figure. – JSDBroughton Jun 18 '14 at 10:20