[我想使用Graph API来获取任何用户ID,我需要发送给Facebook api吗?

问题描述 投票:1回答:1

我想使用Graph API来获取任何用户ID,我需要将什么发送到Facebook api?

https://graph.facebook.com/100009031494361?access_token= ....

{
 "error": {
      "message": "Unsupported get request. Object with ID '100009031494361' does 
       not exist, cannot be loaded due to missing permissions,
       or does not support this operation. Please read the Graph API documentation 
       at https://developers.facebook.com/docs/graph-api",

      "type": "GraphMethodException",

      "code": 100,

      "error_subcode": 33,

      "fbtrace_id": "AT-imffjNk6PZJGyIE4m6kG"

    }
}
facebook-graph-api
1个回答
0
投票

为了检索用户ID,您可以使用/me endpoint

/me

/ me节点是一个特殊的端点,它转换为以下内容的user_id访问令牌为的人(或Facebook页面的page_id)当前用于进行API调用

例如下面的例子:

curl -i -X GET \
 "https://graph.facebook.com/v4.0/me?fields=id,name&access_token=<the_token>"

希望此帮助

© www.soinside.com 2019 - 2024. All rights reserved.