我有一个 Facebook 页面,我想从中获取一些东西。首先是提要,据我所知,它们是公开的(不需要 access_token)。但我也想获取事件......并且它们不是公开的并且需要 access_token。
我不希望用户登录 Facebook 或类似的东西。我只想从这个唯一的页面推送所有可以的数据。这就是为什么我已经放弃了在这里找到的许多示例以及 https://developers.facebook 上的示例。 com/blog/post/500/ ,因为他们希望用户登录或需要一些用户操作,我不感兴趣。
我想要的是我的 Facebook 应用程序拥有完全的授权和 access_token,可以从我拥有的这个 Facebook 页面(管理员)推送数据。这可能吗?我已经尝试了很多事情,但似乎没有任何效果。
我尝试单击此: https://www.facebook.com/dialog/oauth?client_id=150635421702954&redirect_uri=http://MY_URL/&scope=manage_pages&response_type=token&fields=access_token -将 MY_URL 更改为我网站的,并请求授权编辑我拥有的每个页面。即使不是我想要的,我点击了但没有 access_token 作为回报......
I have a Facebook Page that I want to get some things from it. First thing are feeds and from what I read they are public (no need for access_token). But I want to also get the events... and they aren't public and need the access_token.
I don't want the user to login in Facebook or anything like that. I just want to push all the data I can from this only page. That's why I already discarded many examples I found here and the one at https://developers.facebook.com/blog/post/500/ , because they want the user to login or require some user action I'm not interessed.
What I want is that my Facebook Application have full authorization and access_token to push the data from this one Facebook Page that I own (admin). Is this possible? I already tried many things but nothing seems to work.
I tried clicking at this: https://www.facebook.com/dialog/oauth?client_id=150635421702954&redirect_uri=http://MY_URL/&scope=manage_pages&response_type=token&fields=access_token - changing MY_URL to my site's and it requests authorization to edit every page I own. Even not being what I want I clicked but had no access_token in return...
发布评论
评论(4)
manage_pages
权限(您可能还需要user_events
权限,不确定)me/accounts
连接并复制您页面的access_token
access_token
添加到 GET 字段PAGE_ID/events
)manage_pages
permission (you may need theuser_events
permission too, not sure)me/accounts
connection and copy your page'saccess_token
access_token
to the GET fieldsPAGE_ID/events
)如果您想授予 Facebook 应用程序对页面的永久访问权限(即使您/应用程序所有者已注销),请参阅此处:
http://developers.facebook.com/docs/opengraph/using-app-tokens/
“应用程序访问令牌不会过期,除非您可以通过应用程序设置刷新应用程序机密。”
See here if you want to grant a Facebook App permanent access to a page (even when you / the app owner are logged out):
http://developers.facebook.com/docs/opengraph/using-app-tokens/
"An App Access Token does not expire unless you refresh the application secret through your app settings."
这方面的文档即使不是有点难找到,也很好。
Facebook Graph API - 页面令牌
初始化节点的 fbgraph 后,您可以运行:
并接收带有您想要的令牌的 JSON 响应抓取,位于:
The documentation for this is good if not a little difficult to find.
Facebook Graph API - Page Tokens
After initializing node's fbgraph, you can run:
and receive a JSON response with the token you want to grab, located at:
我尝试从 Graph API Explorer 检索页面访问令牌,但没有选择页面的选项。
原来我不是该页面的管理员。我是 Facebook 应用程序的管理员,该应用程序可以访问 Facebook 页面,使我也能够访问该页面。这造成了混乱和混乱。
I was attempting to retrieve the Page access token from Graph API Explorer, but I did not have the option to select the Page.
It turns out that I was not an admin of the page. I was an admin of the Facebook App, and the App had access to the Facebook page, enabling me to access the page as well. This caused the confusion and chaos.