Search code examples
botsfacebook-chatbotfacebook-messenger-bot

How to get name, timezone, gender of your bot user in Messenger 1.4 API?


The API responsible for getting the user's name, gender, age and timezone seems to be missing in Messenger 1.4 API. Any ideas how you can get those details in the new API?


Solution

  • You can use the following graph api to get bot user data:

    https://graph.facebook.com/v2.8/PAGE_SCOPED_USER_ID?fields=first_name,last_name,gender,timezone&access_token=PAGE_ACCESS_TOKEN

    You can access the following fields using page scoped IDs (I don't think you can access age using page scoped user ID):

    • first_name
    • last_name
    • gender
    • is_payment_enabled
    • locale
    • profile_pic
    • timezone

    Here is the documentation: User Profile API