1
votes

I want to send a message to a user from my server once they've finished successfully updating their payment details in a Facebook Messenger Webview, just before I close the webview window and return to the chat.

I'm sending a POST message, as defined, to https://graph.facebook.com/v2.6/me/messages?access_token=ABC In the format of:

{
  "recipient": {
    "id": 123456789
  },
  "message": {
    "text": "hello, world!"
  }
}

...where 123456789 is the valid Page Scoped User Id of the person I'm messaging (currently, that person is an admin of the app while we're in development).

The response I get is:

{
    "error": {
        "message": "(#100) No matching user found",
        "type": "OAuthException",
        "code": 100,
        "error_subcode": 2018001,
        "fbtrace_id": "CTdzskm/2rM"
    }
}

Nothing I do seems to change this. I simply cannot get my application to send a message to the Facebook Messenger chat via cURL.

1
Are you only unable to send a message after the webview, or is it that you can never send a message? - amuramoto
@amuramoto - I can never send one. - codeandchips
Have you run your token through the FB token debugger to see if it has the pages_messaging permission? developers.facebook.com/tools/debug/accesstoken - amuramoto
@amuramoto - Yeah, it seems fine. imgur.com/a/c3HZx - codeandchips
If you can't send the person a message, how are they opening the webview in Messenger? - amuramoto

1 Answers

0
votes

Make sure you are using the same page-scoped access token to send the new message that was used when you received the person's PSID.