如何通过Facebook API 2.1中的third_party_id获取用户ID(uid) [英] how to get user ID (uid) by third_party_id in Facebook API 2.1

查看:265
本文介绍了如何通过Facebook API 2.1中的third_party_id获取用户ID(uid)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook API 1.0-2.0具有FQL,因此我可以通过FQL获得ID. 但是FQL将在2.1版中删除.

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));

那么问题是如何通过API 2.1中的third_party_id获取用户ID?

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

推荐答案

通过向此Graph API端点发送GET请求,您仍然可以通过facebook第三方ID获取facebook uid:

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]

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

响应将包含两个字段:nameid,而id是您想要的.

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

这篇关于如何通过Facebook API 2.1中的third_party_id获取用户ID(uid)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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