4

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).

Webhook configuration

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

Adam
  • 177
  • 1
  • 7

2 Answers2

0

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

0

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

https://your_callback_url.tld/webhook

Samson
  • 23
  • 5