简体   繁体   中英

WhatsApp Business Platform API using Test account doesn't send the message to Mobile

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?

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

Hope this answer helps you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM