Get Facebook User ID from app-scoped User ID

前端 未结 5 2033
Happy的楠姐
Happy的楠姐 2020-11-28 05:34

With the upgrade from Facebook Graph API v1.0 to v2.0, Facebook is using \"App-scoped User IDs\", so I cannot see the \"original\" user ID inside my apps anymore.

I

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 05:54

    From your conversation between Johannes N.

    Can I get the app-scoped ids (for apps I own) via the original user id. that would help too.

    To get app-scoped ids from original user id can be easily done via:

    https://graph.facebook.com/v2.0/?ids=http://www.facebook.com/USER_ID&access_token=ACCESS_TOKEN

    enter image description here

    Yo can use fields parameter to return only id:

    https://graph.facebook.com/v2.0/?ids=http://www.facebook.com/USER_ID&fields=id&access_token=ACCESS_TOKEN

    enter image description here

    The benefit of ids instead of id because you can query multiple ids:

    enter image description here *www can be remove to minimize characters count.

    To get app-scoped ids from username can be easily done too:

    https://graph.facebook.com/v2.0/?ids=http://www.facebook.com/USERNAME&access_token=ACCESS_TOKEN

    enter image description here

提交回复
热议问题