UpendraSingh / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

analytics.management.accountSummaries.list - Try Me #890

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Name of related component: Account Summaries: list

URL of the documentation page : 
https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/m
anagement/accountSummaries/list

Issue summary:
When you hit the try me, after authenticating it says your request is 

GET 
https://www.googleapis.com/analytics/v3/management/accountSummaries?max-results=
1000&key={YOUR_API_KEY}

This is an error Key= is used for Public API key and accessing public data like 
the metadata api.  Access_token must be used for requests for private data 
which require authentication like the account Summaries report. 

If you take the above request and place it in a browser you get the following 
error.

{"error":{"errors":[{"domain":"global","reason":"required","message":"Login 
Required","locationType":"header","location":"Authorization"}],"code":401,"messa
ge":"Login Required"}}

Notes:

The request should be access_token

GET 
https://www.googleapis.com/analytics/v3/management/accountSummaries?max-results=
1000&access_token={YOUR_Access_Token}

Original issue reported on code.google.com by laurl...@gmail.com on 24 Feb 2016 at 8:34

GoogleCodeExporter commented 8 years ago
technically you are correct. But what the API explorer is probably doing is 
placing the access token in the HTTP headers:

https://developers.google.com/identity/protocols/OAuth2UserAgent#callinganapi

the access_token can be a parameter or a header. Though the API key is not 
required for authenticated APIs it is never a bad idea to use it.

As this is an issue with the API explorer: 
https://developers.google.com/apis-explorer/#p/ 
and not specific to the Google Analytics developer platform I'd suggest 
reporting in the the API Explorer forum:
https://groups.google.com/forum/#!forum/google-apis-explorer-users
Or API explorer help pages: https://developers.google.com/explorer-help/

Original comment by mcoh...@google.com on 24 Feb 2016 at 5:50