how to get user ID (uid) by third_party_id in Facebook API 2.1

我的未来我决定 提交于 2019-12-12 02:02:55

问题


Facebook API 1.0-2.0 has FQL, so I can get ID by FQL. But FQL will be removed in version 2.1.

  $result = self::getAPI()->api("fql", "GET", array('q' => 'select uid from user where third_party_id="'.$thirdPartyId.'"', 'access_token' => Const::APPACCESS_TOKEN));

so question is how to get user id by third_party_id in API 2.1?


回答1:


You could still get facebook uid by facebook third party id by sending GET request to this Graph API endpoint:

https://graph.facebook.com/[THIRD_PARTY_ID]?access_token=[APP_ACCESS_TOKEN]

The response will have two fields: name and id, and the id is what you want.




回答2:


Short answer: This is no longer possible with Graph API v2.1. There's no endpoint in the Graph API where you can pass the third_party_Id. You should think about using the app-scoped user_id.



来源:https://stackoverflow.com/questions/26115668/how-to-get-user-id-uid-by-third-party-id-in-facebook-api-2-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!