avalon
avalon

Reputation: 2291

Facebook API send message to a page

I have a FB account and 3 pages in there. Also I am developing a java Bot which should send a message to a page after this page was subscribed to my FB application. The issue is I need to send a congratulations message to currently logged user (who subscribed app to his page). Or to send a message to this user somehow. But, when user is subscribing my app to any page, I get his ID and save it to send congratulations message. But, the issue is this user ID seems to be absolutely wrong, I can't send to it any message with any access token, neither page token, nor any other. So the workflow is:

  1. I generate authorization URL
  2. I (me) his this url
  3. Facebook triggers my callback function
  4. I get access token from token I got in callback
  5. I use this token to link my app to my page, everything is ok
  6. In this callback, I get current user ID, to send message back after linking
  7. After subscription I am trying to send a message to user, but constantly get "(#100) No matching user found"

But, if I send a message from this page, User ID which I get is totally different than this I described above. And if I use that ID from page, everything works ok. How to send a message or may be it's not possible to send a message directly or only as a response to user's message?

Upvotes: 0

Views: 1065

Answers (1)

andyrandy
andyrandy

Reputation: 73984

You are probably mixing "App Scoped ID" and "Page Scoped ID".

App Scoped ID: You get that one after authorizing the user with your App. Not related to bots.

Page Scoped ID: You get that one when the user starts using your bot. No authorization needed for that one.

Upvotes: 1

Related Questions