The global ID is not allowed. Please use the application specific ID instead

前端 未结 5 1536
醉话见心
醉话见心 2020-12-14 10:48

In Graph API 2.0

When I using new graph api to access my friends information, I got the message below.

Here, xxx is an user id.

{
  \"error\"         


        
5条回答
  •  我在风中等你
    2020-12-14 11:01

    It's because you are using the app access token instead of user access token

    Try the user token from this page:

    If that works you need to think about getting the user access token from your app. You can give the user a prompt and receive a code as a parameter on the redirect_uri parameter

    https://www.facebook.com/dialog/oauth?client_id={app-id}&redirect_uri={redirect-uri}
    

    After you receive that code you redeem it for a user access token with a request like this:

    GET https://graph.facebook.com/oauth/access_token?client_id={app-id}&redirect_uri={redirect-uri}&client_secret={app-secret}&code={code-parameter}
    

提交回复
热议问题