0

This is different from the app ID, which is an ID associated with the app itself. How can I get the user's actual ID (or the profile ID)?

AzDeveloper
  • 333
  • 1
  • 3
  • 14
  • Why would you need the actual ID? All APIs accept the app scoped user ID. – WizKid Dec 22 '20 at 17:11
  • App-scoped IDs were introduced, because having one global user ID across all apps, is a privacy risk (different app owners could easily consolidate their data they have about a user this way.) If there still was a way for you to get the global ID based on having an app-scoped ID, that measure would be pointless to begin with. – CBroe Jan 04 '21 at 11:48

1 Answers1

0

You could use the /me:

The /me node is a special endpoint that translates to the user_id of the person (or the page_id of the Facebook Page) whose access token is currently being used to make the API calls.

curl -i -X GET \
 "https://graph.facebook.com/v9.0/me?access_token=<token>"

Will return

{
  "name": "<name>",
  "id": "<id>"
}
Matteo
  • 37,680
  • 11
  • 100
  • 115
  • this just returns the app scoped id, not the real id - it is not possible to get the real id – andyrandy Dec 22 '20 at 15:49
  • Could the [Page-Scoped ID API](https://developers.facebook.com/docs/pages/support/psid-api) may help you – Matteo Dec 22 '20 at 16:09
  • the page scoped id is - as the app scope id - a scoped id and not the real user id. i assume he wants the real user id, but that one is not neccessary anyway. you can just use the scoped ids instead. – andyrandy Dec 22 '20 at 18:39