0
votes

I have a facebook messenger bot that sends a webhook to my web app. People can login to my app via facebook login.

The first user contact is normally with my facebook bot on which they can create a profile. When they make contact I take their facebook id, name, profile pic, etc.

Users can then login with facebook to my web app to enhance their profile.

My problem is facebook uses different scoped ids for messenger and their login.

How can I recognise if a user has already been on my facebook bot if they use my web app, and vice verca.

I think it has something to do with the business mapping api: https://developers.facebook.com/docs/apps/for-business but I'm struggling to understand how it works.

I am sending a get request using:

GET /me?fields=token_for_business

But the docs do not specify the full url to use. I'm also unsure if you can use this in developer mode.

1
Thanks but I'm not sure it works for what I want. I was wondering if there's a way to recognise if a user has used my facebook bot without them logging in via the bot. Example: user interacts with bot but does not sign up. Then they visit my webapp and login with facebook login. Hope that makes sense. - Stoob
No, that is not possible any other way, because Facebook has deliberately made it so. They are not having the messenger API only return page-scoped user ids just for the fun of it. - CBroe

1 Answers

0
votes

facebook provides an id-matching api for the app and pages owned by the same business manager. More informations: https://developers.facebook.com/docs/messenger-platform/identity/id-matching