我正在使用 Google Plus API 显示墙贴(流)数据。我有有效的客户 ID + API_KEY。
我能够从 Google Plus 云控制台获得响应。即通过执行方法我得到类似的东西
要求
获取https://www.googleapis.com/plus/v1/people/myuserid/activities/public?maxResults=5&key= {YOUR_API_KEY}
X-JavaScript-User-Agent:谷歌 APIs Explorer
回复
200 好
显示标题 -
{ "kind": "plus#activityFeed", "etag": "\"Mwea3qudNDf-hWWlPWi3n-YrU1Q/ovxXa0lmTRbwzkDa9o_iJ2pdFBs\"", "nextPageToken": "CAIQgIi2z8bDugIgASgB", "title": "Google+ 公开收集活动列表" , "更新": "2013-11-01T12:07:44.665Z", "项目": [ { "kind": "plus#activity", "etag": "\"Mwea3qudNDf-hWWlPWi3n-YrU1Q/JdSanh1QlMQ72Ubbabsiz2rP4B8\" ", "已发布": "2013-11-01T12:07:44.665Z", "更新": "2013-11-01T12:07:44.665Z", "id": "id", "url": " https ://plus.google.com/userid/posts/bYSPSVjXCXL ", "演员":{ “id”:“116100754354787768146”,“displayName”:“名称”,“url”:“ https://plus.google.com/userid", "image": { "url": "someurl" } }, "verb": "post", "object": { "objectType": "note", "content": "", "url": " https://plus.google.com/userid/posts/bYSPSVjXCXL ", "回复": { "totalItems": 1, "selfLink": " https://content.googleapis.com/plus/v1/activities/z13xulwx3qjuxnkii04cjpsqgsjlyp2j23o /评论“ }, }
...........
到目前为止看起来不错..但是,当我使用请求 URL 即https://www.googleapis.com/plus/v1/people/myuserid/activities/public?maxResults=5&key= {MY_API_KEY} 我从浏览器中得到了这样的东西
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
],
"code": 403,
"message": "Access Not Configured"
}
}
我哪里错了?!如何从浏览器获得正确的响应。? 因为我想解析它们并在我的应用程序中使用这些数据。
注意:Google + API 已开启。