Unable to connect to Facebook Messenger

I tried connecting rasa to FB Messenger but somehow it isn’t connecting.

The error I am getting at FB messenger: The URL couldn’t be validated. Callback verification failed with the following errors: HTTP Status Code = 404; HTTP Message = Not Found

The endpoint is also available in endpoints.yml file.

hello, @harsh1234321

first start ngrok server using :

ngrok http 5005

second

rasa run --credentials credentials.yml

note that in your credentials.yml file

facebook:

verify: “name of your fb app”

it is the same “verift token” which used for callback url

third, set the callback url and verify token on fb app

https://xxxxxxxxxxxxx.ngrok.io/webhooks/facebook/webhook/

use the “https” url of ngrok

follow the same sequence

and don’t forget to select the messaging and messaging_postback

1 Like

Hello Paras,

I followed the same steps but still getting the same error. Do I need to update the callback URL in rasa files somewhere?

are you using rasa x

if yes, then you should use the different Callback URL :

https://rasa_x_domain_name/core/webhooks/facebook/webhook

check this post: Tips for using Rasa chatbots with Facebook Messenger | by Mark Ryan | Medium

and do one more thing, just save all the files

rasa train

and repeat the steps, start ngrok server, rasa run, and add call back url.

if you still get the get the same problem after this post. then we can try some other way. because mine works after follwing these steps

No Paras, I am not using Rasa X. Tried saving and retraining, still the same.

Actually my original ngrok URL is working fine. I am getting a success status for the same. But even when I am trying “https:///xxxxxxxx.ngrok.io/webhhooks/facebook/webhook” in a browser, I am getting a 404 error.

I am adding the callback URL here. I hope that’s not an issue.

Brother use your ngrok url: https://13bcfd61e6cd.ngrok.io/webhooks/facebook/webhook/

If your url is working fine then why are you changing it. I used xxxxxxxxxx just for reference.

Have you tested your messanger after you get the success status 200 ok

Note when your app is in development mode

Only admin, developer and tester can get messages from chatbot

You can this in Roles section of your fb app

One more thing , make sure you are having this in your credentials file

Replace with your token, secret and page access token

Hey Paras, I was using this URL only. https://13bcfd61e6cd.ngrok.io/webhooks/facebook/webhook/

Actually, after retraining credentials file got commented and it didn’t catch my attention. But yeah, now able to resolve the issue. It’s working now.

Thanks for your help. :slight_smile: