MS_me
MS_me

Reputation: 11

Facebook messenger, testing chatbot, incorrect sender.id (data.pageEntry.messaging.event.sender.id)

Clarifying my post:

I'm setting up a facebook chatbot using the sample code. This should allow me to send messages to the chatbot (via Messenger iOS app, or via chat window at Facebook.com, app page). The expected behavior would be

  1. Send chat message
  2. Echo chat message
  3. Display correct logging, no errors

However, when I send a chat message, while it correctly echoes the chat message, I am finding an error in my logging. It produces the following error message:

{ message: '(#100) No matching user found',
  type: 'OAuthException',
  code: 100,
  fbtrace_id: 'D+PAc3ZfmLS' }

After investigation, it appears as though the app is identifying the incorrect userID for my account (app owner). It has the correct receiver ID (page ID of the application). I cannot figure out why this occurs. A copy of typical logging information is below. The incorrect sender ID is listed as "1053426944750274".

Received message for user 1053426944750274 and page 289085874757891 at 2016-07-06T20:32:31+00:00 with message: {"mid":"mid.1467837151667:954f158fd950334f60", "seq":212, "text":"marco"}
Successfully sent generic message with id mid.1467837152021:729cf052bc826dc592 to recipient 1053426944750274
Received message for user 289085874757891 and page 1053426944750274 at 2016-07-06T20:32:32+00:00 with message: {"is_echo":true,"app_id":284007785268790, "mid":"mid.1467837152021:729cf052bc826dc592", "seq":213, "text":"marco"}

Upvotes: 1

Views: 522

Answers (1)

Anas Al Hamdan
Anas Al Hamdan

Reputation: 768

Are you sure you are using the sender.id in the message recipient.id? be aware that Facebook id is different than what you need to use when you respond to users via messenger send API.

When representing a user, these IDs are page-scoped IDs (PSID). This means that the IDs of users are unique for a given page.

If you have an existing Facebook Login integration, user IDs are app-scoped and will not work with the Messenger platform.

source

Upvotes: 0

Related Questions