3

I have created a WhatsApp Business Platform Test account. I am able to send and receive the hello-world template message but when I send a test message without template(as specified by the api) it doesn't push it to the mobile phone. Strangely I get success response in both cases.

Url: https://graph.facebook.com/v15.0/11ZZZZZZZZZZZZZ/messages

Here are the jsons and their responses

{
   "messaging_product":"whatsapp",
   "to":"91ZZZZZZZZZZ",
   "type":"template",
   "template":{
      "name":"hello_world",
      "language":{
         "code":"en_US"
      }
   }
}

{
   "messaging_product":"whatsapp",
   "contacts":[
      {
         "input":"91ZZZZZZZZZZ",
         "wa_id":"91ZZZZZZZZZZ"
      }
   ],
   "messages":[
      {
         "id":"wamid.HBgMOTE3MjkwMDIxMzYwFQIAERgSMjZCRkQ3RDc0RjM0QkNEZZZZZZ=="
      }
   ]
}

In these case I successfully receive message on the mobile

{
   "messaging_product":"whatsapp",
   "to":"91ZZZZZZZZZZ",
   "type":"text",
   "text":{
      "preview_url":false,
      "body":"Hello World Testing"
   }
}

{
   "messaging_product":"whatsapp",
   "contacts":[
      {
         "input":"91ZZZZZZZZZZ",
         "wa_id":"91ZZZZZZZZZZ"
      }
   ],
   "messages":[
      {
         "id":"wamid.HBgMOTE3MjkwMDIxMzYwFQIAERgSQUJERkM2RUE1RTEwQTExZZZZZZ=="
      }
   ]
}

However I don't receive message on the mobile. Is there anything I am missing in the second case?

7
  • 2
    The business can initiate template type message if the user replies then the business can send other types (text, media, etc.) of messages.
    – turivishal
    Commented Nov 10, 2022 at 15:39
  • Predefined template message like hello-world is working fine. I am not able to create a new template as it seems a limitation on test account. But the issue I am facing is with a normal message without a template. I am not receiving it on my mobile
    – zain
    Commented Nov 10, 2022 at 15:45
  • 1
    If you can understand my first comment, I said you can not send other types of messages but there is a condition if the user replies to you in 24 hours window then you can send other types of messages to that user.
    – turivishal
    Commented Nov 10, 2022 at 16:02
  • Ah great! It worked. But the API doesn't seem to mention it.
    – zain
    Commented Nov 10, 2022 at 16:10
  • 1
    Yes, the documentation is not for only test numbers, that rule applies to all the business phone numbers, So does it mean that we always need to send a template message before sending any message => No, You can only send message when user message you in 24 hours window.
    – turivishal
    Commented Nov 10, 2022 at 16:28

1 Answer 1

10

I was strugging with the same problem, but I figured out that you need to reply back to your first template message with a 'hello' or any kind of reply. Once you reply, only then can you send a message through that watsapp api without a template, or you can inititate conversation through watsapp api.

Hope this answer helps you.

3
  • Thanks. This solution works perfectly. Remember if user replies to that template you can send normal messages with whatsapp api Commented Mar 9, 2023 at 19:35
  • @ouflak - do you know the other way around? I have a business initiated API configured but unless my users says "hi" to the account, we are not able to send the Whatsapp Authentication messages. Commented Dec 5, 2023 at 14:56
  • @Ravi, Your question really is meant for the OP of this answer Arjun A. I think he gets pinged as well when you comment, but just to be sure you might want to just post a quick comment (don't need the '@').
    – ouflak
    Commented Dec 5, 2023 at 17:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.