botman / botman

A framework agnostic PHP library to build chat bots
https://botman.io
MIT License
6.05k stars 810 forks source link

The requested URL returned error: 419 unknown status #1071

Closed ernanibautista closed 2 years ago

ernanibautista commented 4 years ago

always return The requested URL returned error: 419 unknown status.

Steps To Reproduce:

OS : windwos 10 pro. I used ngrok for public URL in my localhost. Install fresh laravel 5.8. Install botman, required web and facebook driver. Create facebook page. Create facebook app. Setup webhook using ngrok url and successfully connected. https://1f89d4a7.ngrok.io/botman Generate page access token. Subscription access is: messages, messaging_postbacks, messaging_optins, message_deliveries, message_reads

Add Whitelisted Domains in messenger platform settings. https://1f89d4a7.ngrok.io/botman

When i tested it in my page, is not responding even in simple "hi", "hello", "Start conversation", it doesn't response.

In my ngrok http://localhost:4040/inspect/http, status is

POST /botman { "object": "page", "entry": [ { "id": "125403715525176", "time": 1570081424934, "messaging": [ { "sender": { "id": "3025336274159720" }, "recipient": { "id": "125403715525176" }, "timestamp": 1570069928297, "message": { "mid": "V08aTisAA-4wFjhlWVbqtYz5HiO7cGmKNuioc_ha5JXRNzhvuzdaBIF1ncFTi8-s9CasqFyheymSWSKuMm8Y3w", "text": "Start conversation" } } ] } ]

419 unknown status

ernanibautista commented 4 years ago

I already used botman studio, with same error

StanBarrows commented 4 years ago

Any updates on this?

Same Problem with Telegram API Telegram API: Wrong response from the webhook: 419 unknown status #1090

daviddagb2 commented 4 years ago

hi, ¿there is any update about this? i have the same problem with facebook messenger

roelofr commented 4 years ago

It's triggered by Larvel's exception handler when an Illuminate\Session\TokenMismatchException is encountered. This is because by default, BotMan registers itself on the web middleware group, which includes session validation.

Move Botman to the API group (the routes/api.php file), and update your links accordingly (it'll be on /api/botman if you simply copied the route line to the file).

donmbelembe commented 4 years ago

It's triggered by Larvel's exception handler when an Illuminate\Session\TokenMismatchException is encountered. This is because by default, BotMan registers itself on the web middleware group, which includes session validation.

Move Botman to the API group (the routes/api.php file), and update your links accordingly (it'll be on /api/botman if you simply copied the route line to the file).

Thanks, or you can just add '/botman' on the $except array in VerifyCsrfToken.php middleware