问题
i am working on to display wall posts (Stream) data using Google Plus API. i have valid Client ID + API_KEY.
I am able to get response from Google Plus cloud console.i.e. by executing method I get Something like
Request
GET https://www.googleapis.com/plus/v1/people/myuserid/activities/public?maxResults=5&key={YOUR_API_KEY}
X-JavaScript-User-Agent: Google APIs Explorer
Response
200 OK
Show headers -
{ "kind": "plus#activityFeed", "etag": "\"Mwea3qudNDf-hWWlPWi3n-YrU1Q/ovxXa0lmTRbwzkDa9o_iJ2pdFBs\"", "nextPageToken": "CAIQgIi2z8bDugIgASgB", "title": "Google+ List of Activities for Collection PUBLIC", "updated": "2013-11-01T12:07:44.665Z", "items": [ { "kind": "plus#activity", "etag": "\"Mwea3qudNDf-hWWlPWi3n-YrU1Q/JdSanh1QlMQ72Ubbabsiz2rP4B8\"", "published": "2013-11-01T12:07:44.665Z", "updated": "2013-11-01T12:07:44.665Z", "id": "id", "url": "https://plus.google.com/userid/posts/bYSPSVjXCXL", "actor": { "id": "116100754354787768146", "displayName": "name", "url": "https://plus.google.com/userid", "image": { "url": "someurl" } }, "verb": "post", "object": { "objectType": "note", "content": "", "url": "https://plus.google.com/userid/posts/bYSPSVjXCXL", "replies": { "totalItems": 1, "selfLink": "https://content.googleapis.com/plus/v1/activities/z13xulwx3qjuxnkii04cjpsqgsjlyp2j23o/comments" }, }
........
Seems good till now..but,when i use Request URL i.e https://www.googleapis.com/plus/v1/people/myuserid/activities/public?maxResults=5&key={MY_API_KEY} i got something from browser like this
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
],
"code": 403,
"message": "Access Not Configured"
}
}
where i am going wrong ?! how to get correct response from Browser. ? as i want to parse them and use these data in my Application.
NOTE: Google + API is ON.
回答1:
Are you making sure that you have replaced {MY_API_KEY} with the API key that you have generated using the Cloud Console?
回答2:
Are you using the Browser Key? It works OK for me.

来源:https://stackoverflow.com/questions/19741221/unable-to-access-google-plus-api-in-browser