Search code examples
twiliowhatsapp

Why does Twilio say that sending a WhatsApp message must use a pre-approved template, then allow me to send an arbitrary untemplated message?


I'm in the Twilio WhatsApp sandbox following their tutorial. The tutorial says: "Messaging with WhatsApp has a few differences from SMS: to send outbound messages, such as notifications, you must use a pre-approved template from WhatsApp."

The tutorial lets me choose a template to send a test message, but it also lets me overwrite the text that gets sent with something unrelated - in this case the string "Random untemplated text" (as depicted in screenshot below). I clicked Make Request and I got "Random untemplated text" in a WhatsApp message on my phone.

Doesn't this contradict the statement that WA requires you to use a pre-approved template?

Screenshot of Twilio sandbox tutorial


Solution

  • When you send a message to some company Whatsapp phone from your phone, it's opened a 24-hour conversation session, in this session you're allowed to send any message to the customer. In the case of the Twilio Sandbox number, to start you need first to send a code to Whatsapp, "join ...", this message opens the 24-hour session, so any message that you send via API will arrive for you. :D.

    The 24-hour session is closed after 24 hours of the last customer message, when the session is closed, you can send just pre Whatsapp approved messages, and if the customer answer this message, the cycle repeat.

    You can see more information about it in this documentation.

    I hope that it can help you.