Search code examples
facebooknginxbotsmessengerfacebook-messenger-bot

Botpress - Verifying facebook bot messenger webhook


I'm new to the botpress community and just finished developing my first bot. Now I'm trying to get it to work on my server. The problem is that while trying to verify the webhook.

Trying from facebook I received this error: "The URL couldn't be validated. Callback verification failed with the following errors: HTTP Status Code = 403; HTTP Message = Forbidden" My url: https://b.mysite.com/api/botpress-messenger/webhook

Trying directly from botpress: An error occured during communication with Facebook Details: An error has been returned by Facebook API. Status: 400 (Bad Request) (#194) Requires all or none of the params: callback_url, verify_token

Trying to use ngrok the error is the same as above.

That's my current nginx config:

server {
    server_name b.mysite.com   www.b.mysite.com;

    access_log /var/log/nginx/b.mysite.com.access.log rt_cache;
    error_log /var/log/nginx/b.mysite.com.error.log;

    root /var/www/b.mysite.com/htdocs;
    listen 80; # managed by Certbot

    listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/b.mysite.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/b.mysite.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot

    # Redirect non-https traffic to https
     if ($scheme != "https") {
         return 301 https://$host$request_uri;
     } # managed by Certbot

   location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_pass http://127.0.0.1:3000;
    proxy_redirect off;
    autoindex on;
  }

 }

Server was configured using easyengine and the SSL was issued by letsencrypt and installed using certbot.

Could you please help me solve this issue? Thank you in advance!


Solution

  • After several tries I ended up setting up a new server without easyengine and worked just fine. Probably some ee default configs conflicted with botpress.