1

I working on a BotMan based Messenger chatbot. I set up everything, tried to test out, everything went fine, but I got stuck.

I wanted to send an image as a response from my bot to my Facebook profile. It sent the image, but after it I got stuck: It tries to send the message again and I see in nGrok, that I have an 500 error request from my webhook.

I tried the following:

  • comment out the code to debug
  • restart the webserver
  • restart nGrok and set up a new webhook with the new address
  • restart computer than do the earlier

Nothing is helped from the following. With other Facebook profile I can "speak" with it (I got the good responses for my test cases), but the first profile is stuck. How to "unstuck" it?

EDIT:

This is the object, what tries to send, but gains error 500:

{
    "object": "page",
    "entry": [
        {
            "id": "1718785685111526",
            "time": 1518649220812,
            "messaging": [
                {
                    "sender": {
                        "id": "1718785685111526"
                    },
                    "recipient": {
                        "id": "1702775193145548"
                    },
                    "timestamp": 1518641306603,
                    "message": {
                        "is_echo": true,
                        "app_id": 813542108832080,
                        "mid": "mid.$cAAZBynpFHa9nx1ij61hlhNatNiJj",
                        "seq": 353844,
                        "attachments": [
                            {
                                "type": "image",
                                "payload": {
                                    "url": "https://scontent-ort2-2.xx.fbcdn.net/v/t34.0-12/28001431_2003444363312322_578145807_n.jpg?_nc_ad=z-m&_nc_cid=0&oh=7088ad6e09a1c9851a967c8193ea3bf4&oe=5A871570"
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ]
}
Feralheart
  • 1,881
  • 5
  • 28
  • 59
  • What does the request you're sending the attachment with look like? – amuramoto Feb 14 '18 at 21:36
  • @amuramoto I edited the question with the request object – Feralheart Feb 14 '18 at 23:03
  • That is what you try to send to the Platform API, or that is what the Platform sends to your webhook? – amuramoto Feb 14 '18 at 23:25
  • This is what I trying to send. And I saw this in the logs: `[2018-02-15 09:08:59] local.ERROR: Error sending payload: (#100) No matching user found {"exception":"[object] (BotMan\\Drivers\\Facebook\\Exceptions\\FacebookException(code: 0): Error sending payload: (#100) No matching user found at /var/www/myapp/vendor/botman/driver-facebook/src/FacebookDriver.php:442)` – Feralheart Feb 15 '18 at 08:10
  • This isn't the format for sending a message. This is the format of an incoming webhook event. If you want to send an attachment, follow the syntax here: https://developers.facebook.com/docs/messenger-platform/send-messages/#sending_attachments – amuramoto Feb 16 '18 at 19:17

0 Answers0