Facebook Api v2.2 - 获得相册的照片份额 [英] Facebook Api v2.2 - get album's photos shares count
问题描述
我正在使用以下Graph Api查询,以便接收我的页面中相册中所有照片上的喜欢和评论:
https://graph.facebook.com/v2.2/album_id?fields=photos.limit(250){likes.limit(1),comments.limit(1),ID,源} likes.limit(1)& access_token = my_access_token
我也想收到这些图片共享计数,但共享计数未连接到照片终点,它连接到page_story_id。
所以,为了收到所有的股票数量,我将需要单独查询每一个,这是没有意义的,当你有一个相册200张图片(更不用说有500张图片的专辑)。
在v2.1之后,FQL已被弃用,所以我无法使用FQL来取得这个
没有更简单的方法吗?
更新
感谢@CBroe的评论,这是我的批次:
[
/ pre>
{
method:GET,
name:get-photos,
relative_url:951337131548012?fields = photos.limit(250){likes.limit 1),comments.limit(1),id,source,page_story_id},likes.limit(1)
},
{
方法:GET,
relative_url:/?ids = {result = get-photos:$。photos.data。*。page_story_id}
}
]
现在它返回所有的照片发布对象,但是如何查询他们所有具体的领域?喜欢添加
?fields = share
解决方案几个小时,感谢@CBroe帮助我找到了正确的批量请求,满足我的需求,它涉及到批处理和Graph API多个请求。
<$ c
方法:GET,
name:get-photos,
relative_url:951337131548012?fields = photos。 limit(250){likes.limit(1),comments.limit(1),id,source,page_story_id},likes.limit(1)
},
{
:GET,
ative_url:/?ids = {result = get-photos:$。photos.data。*。page_story_id}& fields = shares
}
]
添加
& fields = shares
我正在过滤多请求的内部结果的字段。
希望它帮助某人:)
I'm using the following Graph Api query in order to receive the likes and comments counts on all the photos in an Album inside my page:
https://graph.facebook.com/v2.2/album_id?fields=photos.limit(250){likes.limit(1),comments.limit(1),id,source},likes.limit(1)&access_token=my_access_token
I want to to also receive each one of these pictures shares count, but the share count is not connected to the photo end point, Its connected to the page_story_id.
So, in order to receive all the shares count i'm going to need to query each of those individually, which doesn't make sense when you have an album with 200 pictures (not to mention an album with 500 pictures).
FQL is deprecated after v2.1 so I can't use the FQL to get this (which will defiantly ease everything for me).
Isn't there an easier way to do so?
Update Thanks to @CBroe comments, this is my batch:
[ { "method":"GET", "name":"get-photos", "relative_url":"951337131548012?fields=photos.limit(250){likes.limit(1),comments.limit(1),id,source,page_story_id},likes.limit(1)" }, { "method":"GET", "relative_url":"/?ids={result=get-photos:$.photos.data.*.page_story_id}" } ]
Now it does return all the photos post objects, but how can I query them all the specific field? like add
?fields=shares
解决方案ok after struggling with this for few hours, and thank to @CBroe help I found the right batch request for my needs and it involves both batch and Graph API multiple requests.
[ { "method":"GET", "name":"get-photos", "relative_url":"951337131548012?fields=photos.limit(250){likes.limit(1),comments.limit(1),id,source,page_story_id},likes.limit(1)" }, { "method":"GET", "relative_url":"/?ids={result=get-photos:$.photos.data.*.page_story_id}&fields=shares" } ]
by adding
&fields=shares
i'm filtering the fields of inner results of the multi request.Hope it helps someone :)
这篇关于Facebook Api v2.2 - 获得相册的照片份额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!