0

I'm currently developing a bot for messenger, it works just fine for my page, now the thing is, we'd like that bot to work for multiple pages, even pages that are not ours, so a couple of questions:

  1. How can I add others pages to my messenger webhooks? Do I have to become an admin of that page and do it manually on facebook devs everytime I want to add a new user?

  2. When I get a new message I can retrieve it's page ID, but from there I need to get a page access token every message right? So that I know what page to message, because right now my token is just an hardcoded string... So basically, how to receive messages from different pages and distinguish them? I've been reading their pages access token docs but can't seem to make it work GET /{page-id}?fields=access_token,

(https://graph.facebook.com/1071071872997492?fields=access_token), this keeps returning "An access token is required to request this resource", I'm sure I'm not understanding something right, help would be greatly appreciated, any question ask away, thanks.

Fábio Santos
  • 199
  • 1
  • 2
  • 16
  • 1
    1. No, the page admin simply logs into your app, grants the appropriate permissions, and then you use their user access token to get a page access token. And then you subscribe the page to your app, using that token. 2. Use the page id to look up the corresponding page access token - via an array, database, ... – CBroe May 22 '17 at 10:20
  • Are you using a bot framework or rolling your own bot? – Jon Church May 23 '17 at 01:42
  • @CBroe Hey, sorry for the late reply but I was busy getting all of this to work, and I did, your answer really made some lights in my head, so yeah, thank you man. – Fábio Santos May 23 '17 at 18:45

0 Answers0