Ivan Krumov
Ivan Krumov

Reputation: 133

Communicating over Messenger on behalf of another user's page

I want to make a Messenger bot with Messenger platform. But this bot needs to be connected to other Facebook users' pages, not my own page. I have a Facebook app with Messenger configured. I want to let other Facebook users who are page owners to give my application a permission to post on behalf of their pages through Messenger, as well as receive messages from their pages on my app's webhook.

The Messenger Platform docs only explain how to post on behalf of your own page. Is is possible to make this through Graph API + Messenger Platform or something else? And maybe with a few pointers how?

Upvotes: 4

Views: 1271

Answers (1)

user2322082
user2322082

Reputation: 658

This is how I send my messages:

uri: 'https://graph.facebook.com/v2.6/me/messages',
qs: { access_token: PAGE_ACCESS_TOKEN },
method: 'POST',
json: messageData

So I think if you would just need them to supply you with their page access token, and then you could send messages as their page through your bot.

EDIT: I guess this only answers how to send messages as them. To receive messages too you'd need to somehow subscribe your webhook to their page, which I think you need to be an admin of to do, so I'm not sure receiving their pages messages is possible through a straightforward system like what I'm suggesting. There may be other more complex workarounds though.

EDIT2: Maybe you can give them your webhook URL and have them verify and subscribe it for you

Upvotes: 2

Related Questions