Messenger Bot: how to get id, name and user's profile picture url?

riseres picture riseres · Aug 18, 2016 · Viewed 8.7k times · Source

I have Messenger Bot and want to do this action.

  1. User click Button Template(URL) .
  2. Messenger opens new tab
  3. On Web app header display header with fullname, display Picture

All these data are public data ex: user fullname, picture url to display. I know can use Graph API with USER_ID,

BUT In Messenger Bot can get only SCOPE_ID, so it cannot be used in graph api.

Any way to achieve like this
and No login required.

Answer

Hossam.Youssef picture Hossam.Youssef · Aug 20, 2016

In order to use the User Profile API, you can make a GET call to

https://graph.facebook.com/v2.6/<USER_ID>?access_token=PAGE_ACCESS_TOKEN

<USER_ID> is the page-scoped ID PSID that returned with any messaging object