您的位置:首页 > 移动开发

如何获取app access_token(针对这样的错误This method must be called with an app access_token.)

2011-09-23 14:27 603 查看


App Login

In addition to User Login, Facebook Platform support App Login using the OAuth 2.0 Client Credential flow. App Login allows you to take various administrative actions for your app, such as retrieving Insights data or approving Requests. Graph
API calls that require an app access token are clearly denoted in the API reference.

You can obtain the app access token from the Graph API token endpoint at
https://graph.facebook.com/oauth/access_token
by specifying your app id, app
secret
and client_credentials in the grant_type parameter. Both the app id and app secret are generated when your app is created in the Developer App.
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
grant_type=client_credentials


Sending an HTTP GET request to the above URL will return an access_token in the body of the response:



You then use this access token when calling app specific parts of the Graph API (such as App Insights):
https://graph.facebook.com/YOUR_APP_ID/insights?
access_token=TOKEN_FROM_ABOVE
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐