Get the user id from messenger mention

(Lucas Sodré) #1

Is there any way of get a user id from direct message on messenger,
or get a user

Basically what I wanna do is:
Bot: Hey who is your best friend
Person: My best friend is @JohnDoe

There is any way of doing that without doing a parser and then sending to an external app to get the id?

(Kellsey Shaw) #2

Hi Lucas,

We’ve added this feature to our Bot - New Message trigger.

You now have:

User Name - the user’s full ‘real’ name.
User Handle - the handle or username on the platform that the message came from.

(David Garcia) #3

Hi there Kellsey,

I am trying to log the user into sheets with https://www.facebook.com/profile.php?id={{bot_new_message.channel_id}}/.
So far, I have tried quite a few different formats but I cannot manage to find the profile, FB spits out a page not found / possibly broken.

EDIT:
For the same profile
My numeric FB ID (found with www.findmyfbid.com) - this one works:
100013162697253
The numeric User ID the bot logs for me - this one does not work:
1098546800229598

Is this due to tester role of my users or is it a general issue / something I’m missing?

Thanks much

(Kellsey Shaw) #4

Hi David,

The User ID in the logs is not the User’s profile ID. You’ll want to explore FaceBooks Graph API to see if there is a way to access more information about the user using the ID that we have from the conversation.

The ID we have will give you the User’s name, gender, location and profile pic but nothing else. :disappointed: