facebook-graph-apifacebook-messengerfacebook-messenger-bot

Get public_profile from messenger api


Is there any way how to get public_profile information from messenger api? I need just first name of the user.

I have tried GET https://graph.facebook.com/<PSID>?fields=first_name&access_token=<PAGE_ACCESS_TOKEN> (https://developers.facebook.com/docs/messenger-platform/identity/user-profile/), but it only works for me and my page. For other users I got error:

(#3) Application does not have the capability to make this API call."

Do I need to request Business Asset User Profile Access? Is public_profile completely useless for messenger bot?

I am totally lost in FB doc and all other information I found is too old.


Solution

  • Yes you will need Business Asset User Profile Access.

    There is a notice on the page which you linked to: "To retrieve a user’s profile information, you need to have Advanced Access for the Business Asset User Profile Access feature."

    :)