I'm trying to get WhatsApp's Cloud API working. I managed to set up Meta Business Account and configure a WhatsApp app. Then I configured a webhook and subscribed to messages event (see the following screenshot).

I then managed to send a message via the API using the following request:

curl -i -X POST `   https://graph.facebook.com/v13.0/103690452403982/messages `   -H 'Authorization: Bearer MY_TOKEN' `   -H 'Content-Type: application/json' `   -d '{ \"messaging_product\": \"whatsapp\", \"to\": \"MY_NUMBER\", \"type\": \"template\", \"template\": { \"name\": \"hello_world\", \"language\": { \"code\": \"en_US\" } } }' 

I received the message and it came through the webhook as well. If I reply to that message, it comes through the webhook too.

The problem

However, when I send a message to the associated number from a different WhatsApp number (not via the API) it is received but the webhook is not called.

I suspect some incorrect configuration on my side. When I text the number from a different phone, the chat has a notice about E2E encryption - something which is not present in a chat window of the API-sent message. I assume that E2E-encrypted messages cannot be passed to the webhook because only the recipients should be able to decrypt the message.

Any ideas what I might be missing?

Thank you in advance

Tag:facebook, webhooks, whatsapp

5 comments.

  1. Khaled Badawy

    If you're using your business manager as a BSP, then you must Subscribe to your WABA first, to get notifications over your webhook.

    See whatsApp cloud API document here: https://developers.facebook.com/docs/whatsapp/cloud-api/get-started-for-bsps#subscribe-waba

    1. asendia

      I am not a BSP, after registering new phone numbers I can send messages but somehow could not receive any message webhook. Last year this was not the case. Thanks for the answer.

    2. gilzonme

      How was this issue resolved?

  2. Samson

    Here, in the Callback URL mention "webhook" after the trailing "/" i.e.

    https://your_callback_url.tld/webhook

    1. Alexandru R

      it's irrelevant. The url can be any valid url, and as the original owner mentioned, he is receiving the webhooks.

Add a new comment.