4

Hi I want to use WhatsApp business API in my web application. I have tested it in postman.

Whenever run sample curl code when available in Facebook business page under WhatsApp tab, It run successfully with temporary access token and message delivered to recipient with Facebook saved template. But when I send only text message to recipient then API response become success with message Id but message not yet deliver to recipient.

My curl code sample given bellow

curl --location --request POST 'https://graph.facebook.com/v13.0/106433498743301/messages' \ --header 'Authorization: Bearer EAAOw8oNtvXkBAKk89CqJtyusjxk7c7qGSNS0quxqeZBRtjE5MYwZCK0USeGGLV4n56qNAuaRoRWZA2oCIS8zcz6U5UZAtQCOb6YQnjuXZBfLnyZAwsOZBpASpnNOvvz29T0Jn0aXgZAdo9VKmBv0CkNYuOeb1I7X0GZCEwLHPZBFpfOCj4K3S9CMPjBfYR5Jog06LC95P7UgCr5Fy2nqbRM5Ys' \ --header 'Content-Type: application/json' \ --data-raw '{ "messaging_product": "whatsapp", "preview_url": false, "recipient_type": "individual", "to": "xxxxxxx150", "type": "text", "text": { "body": "Test message" } }'

3 Answers3

16

The official documentation indicates that in order to send such messages, the conversation must be initiated by the user. https://developers.facebook.com/docs/whatsapp/conversation-types

enter image description here

apositivo
  • 343
  • 1
  • 9
3

I had the same problem. After I have sent a message from my phone to the testnumber, it worked.

regards

Leon

LeonS
  • 31
  • 1
  • I'm trying to do this, but the test number isn't showing up as a contact on WhatsApp after I added it. Regular text message to the number aren't being delivered. How did you manage to do this? – Jordi Jun 15 '22 at 08:15
  • In my case, I had to accept the terms and conditions to be able to received messages. More info here: https://stackoverflow.com/a/74402256/2990234 – Anfuca Nov 11 '22 at 12:08
1

Other than the template(approved from meta) message, the conversation must be started by the User. So Send a message first on your WhatsApp number and then you can conversate with the Recipient number.

  • the problem with this method is that you have to initiate conversations every 24 hours. after 24 hours the configuration expires and you can no longer send messages. But if you are writing a notification service this is not useful because I don't want to send anything, I just need to receive – Nulik Jan 31 '23 at 01:37