0

I deployed a Strapi project and run it through pm2 and nginx. I have a webhook api in https://zeusoftware.online/api/webhook. Here is my code for verify the webhook, I didn't implement the token, challenge and mode logic yet.

Controller

module.exports = {
  verifyAction: async (ctx, next) => {
    console.log(ctx.request.body)
    try {
      ctx.body = 'ok';
    } catch (err) {
      ctx.body = err;
    }
  }
};

Route

module.exports = {
  routes: [
    {
      method: 'GET',
      path: '/webhook',
      handler: 'webhook.verifyAction', 
    }
  ],
};

When I call this in my browser, it returns ok. But when I goto FB to config the Webhook. It always return the follow error:

The callback URL or verify token couldn't be validated. Please verify the provided information or try again later.

I know I haven't implemented the logic yet. But my question is why the request even doesn't reach my application. I debug this through a console.log. (When I run in browser, the console.log works).

I can't find any document about how FB verify this webhook callback API. Any idea?

Found the follow related link. But it doesn't solve my issue.

The Callback URL or Verify Token couldn't be validated. Please verify the provided information or try again later

Bagusflyer
  • 12,675
  • 21
  • 96
  • 179
  • It's working after I installed a new ssl cert through `certbot`. It proves the issue was caused by the self-signed certificate. The FB dashboard may verify if the certificate is valid. – Bagusflyer Jun 02 '23 at 04:35

0 Answers0