获取使用Facebook的图形API的公共页面的状态没有访问令牌 [英] Get public page statuses using Facebook Graph API without Access Token

查看:251
本文介绍了获取使用Facebook的图形API的公共页面的状态没有访问令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Facebook图形API从公共页面获取最新的状态,让我们说 HTTP://www.facebook .COM /微软

I'm trying to use the Facebook Graph API to get the latest status from a public page, let's say http://www.facebook.com/microsoft

据<一个href=\"http://developers.facebook.com/tools/explorer/?method=GET&path=microsoft%2Fstatuses\">http://developers.facebook.com/tools/explorer/?method=GET&path=microsoft%2Fstatuses - 我需要一个访问令牌。由于微软网页是公,是这绝对是这样吗?有没有办法对我来说,没有一个访问令牌访问这些公开状态?

According to http://developers.facebook.com/tools/explorer/?method=GET&path=microsoft%2Fstatuses - I need an access token. As the Microsoft page is 'public', is this definitely the case? Is there no way for me to access these public status' without an access token?

如果是这样的话,是如何创造我的网站的访问令牌的正确的方法?我有一个应用程序ID,但是所有的例子在<一个href=\"http://developers.facebook.com/docs/authentication/\">http://developers.facebook.com/docs/authentication/描述处理用户登录。我只是想获得微软页面上的最新状态更新和我的网站上显示。

If this is the case, how is the correct method of creating an access token for my website? I have an App ID, however all of the examples at http://developers.facebook.com/docs/authentication/ describe handling user login. I simply want to get the latest status update on the Microsoft page and display it on my site.

推荐答案

这是由设计。一旦有可能无法获得令牌从公共页面获取它,但它是为了阻止对API不明身份的匿名访问的变化。你可以得到一个访问令牌的应用程序(如果您还没有为您的网站的Facebook应用程序集 - 你应该创建它)与图形API的调用如下:

This is by design. Once it was possible to fetch it from public pages without access token but it was changed in order to block unidentified anonymous access to the API. You can get an access token for the application (if you don't have a facebook application set for your website - you should create it) with the following call from graph API:

https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
grant_type=client_credentials  

那么你继续有这个访问令牌实际的API调用。

then you proceed to the actual API call having this access token.

希望这有助于

这篇关于获取使用Facebook的图形API的公共页面的状态没有访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆