有没有人如何在Javascript中从'uid'获取third_party_id?
我正在努力寻找它,但没有成功。
问候。
答案 0 :(得分:8)
third_party_id
是User object in the Graph API上的字段,但它不是默认字段 - 只有在您明确请求时才会返回,例如
GET https://graph.facebook.com/me?fields=third_party_id&access_token=[YOUR ACCESS TOKEN]
将返回:
{
"third_party_id": "[THIRD PARTY ID]",
"id": "[USER ID]",
"type": "user"
}
在javascript中,您最有可能想要致电
FB.api("/me?fields=third_party_id", function (userData) {
alert("Your Facebook ThirdPartyId is: " + userData["third_party_id"]);
});