如何从谷歌获取附件+ api活动搜索?
在 https://developers.google.com/+/api/latest/ events#object.attachments,activities search
响应中会有附件,但是如何调用它呢?
此处:http://code.google .com/apis/explorer/#_s=plus&_v=v1&_m=activities.search 即使我选择了所有 fields
部分,也没有附件。
最终调用url在这里
https://www.googleapis.com/plus/ v1/activities?maxResults=20&orderBy=最近 &query=关键字&fields=id%2Citems(access%2Cactor%2Caddress%2Cannotation%2CcrosspostSource%2Cgeocode%2Cid%2Ckind%2CplaceId%2CplaceName%2Cplaceh old%2Cpublished%2Cradius%2Ctitle%2Cupdated%2Curl%2Cverb)%2Ckind%2CnextLink%2CnextPageToken%2CselfLink%2Ctitle%2Cupdated&pp=1&key=APIKEY
那么,如何获取附件呢?
In https://developers.google.com/+/api/latest/activities#object.attachments, there would have attachments in activities search
response, but how to call it?
In here: http://code.google.com/apis/explorer/#_s=plus&_v=v1&_m=activities.search even I select all the fields
section, there have no attachments.
The final call url here
https://www.googleapis.com/plus/v1/activities?maxResults=20&orderBy=recent
&query=keyword&fields=id%2Citems(access%2Cactor%2Caddress%2Cannotation%2CcrosspostSource%2Cgeocode%2Cid%2Ckind%2CplaceId%2CplaceName%2Cplaceholder%2Cpublished%2Cradius%2Ctitle%2Cupdated%2Curl%2Cverb)%2Ckind%2CnextLink%2CnextPageToken%2CselfLink%2Ctitle%2Cupdated&pp=1&key=APIKEY
So, how to get attachments?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
附件将是嵌套在对象属性下的 json 数组。
这是一个示例请求:
https://www.googleapis .com/plus/v1/activities?query=google&sortBy=recent&maxResults=20&key=GOOGLE_API_KEY
查看从您的浏览器中获取它,并在响应中查找“附件”。
对于包含附件的活动,您应该看到类似这样的内容:
以下是如何使用 events.search API 并提取图像附件的示例:
https://gist.github.com/1296676
The attachments will be and a json array nested under the object property.
Here's a sample request:
https://www.googleapis.com/plus/v1/activities?query=google&sortBy=recent&maxResults=20&key=GOOGLE_API_KEY
View it from your browser, and look for "attachments" in the response.
You should see something like this for activities that contain attachments:
Here's an example of how you can use the activities.search API and extract image attachments:
https://gist.github.com/1296676