Facebook图形API提要返回一个空数组 [英] Facebook graph api feed returning an empty array
问题描述
我正在尝试进行Facebook图形api调用,以获取公共(即OPEN)组的供稿.
I'm trying to make a facebook graph api call to get a public(i.e. OPEN) group's feed.
当我访问该小组的站点时,有大量的feed,但是当我发出API调用时,却得到了一个空数组.
When I go to the group's site there's quite a large feed, but when I issue the API call, I get an empty array.
我尝试使用从组的管理员那里收到的access_token参数,但仍然没有任何帮助.
I tried using an access_token parameter received from the group's adminitrator, but I still got nothing.
我是否需要请求某些特定权限才能接收提要?
Do I have to request some specific permissions to receive the feed?
请注意,在一些页面上,我无需额外权限即可获取所有数据-例如可口可乐页面:
Note that on some pages I can get all data without extra permissions - e.g. the cocacola page:
https://graph.facebook.com/cocacola/feed?#{ACCESS_TOKEN}
我的最终目标是在第三方页面上列出该群组的所有最新Feed活动.
My end goal is to have a list of all recent feed activity for the group on a third-party page.
推荐答案
页面访问令牌与用户访问令牌不同.因此,如果您具有管理员访问令牌,则必须获取管理员拥有的页面的列表.然后,在该列表中,您可以找到页面特定的acces令牌.收集页面access_token后,您可以进行API调用.但是,您还必须获得页面访问权限.
Page access tokens are diffirent from user access tokens. So if you had an administrator access token, you have to get a list of pages that admin owns. Then in that list you can find page specific acces tokens. After gathering page access_token you can make the API call. But also you have to get Page access permissions.
1)使用access_tokens获取管理员的页面数组
1) GET admin's pages array with access_tokens
https://graph.facebook.com/[ADMIN-FB-ID]/accounts?access_token=[ADMIN-ACC-TOK]
2)然后从返回的数组中获取页面访问令牌
2) Then get the page access token from returning array
3)最后,您可以调用页面的feed api.
3) Finally you can call page's feed api.
希望有帮助,
这篇关于Facebook图形API提要返回一个空数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!