Simulating Inbound WhatsApp Message

When an end-user sends a WhatsApp message from their device to a Phone Number from the WhatsApp application, they have sent an Inbound message. For historical reasons, the inbound message is referred to as Mobile Originated (MO). In this case, we are going to simulate a MO message (through the WhatsApp API) once the end user has sent a message to the WABA account in a 24-hour session.

Therefore, this endpoint allows you to simulate the interaction of the end user to receive a response, without the need for the end user to send a specific keyword. That is, the end user does not need to send a keyword to start the interaction with an interactive campaign.

The following diagram helps you to understand the connection and interaction between the WhatsApp API, Interactive Campaign Process and META (Whatsapp Application).

From the diagram above, the first step is creating and defining an interactive campaign. The next step is creating the simulated MO message by making an API Request to the WhatsApp API (Simulate MO Endpoint). The API will analyze if the MO is associated with a process that is associated with an interactive campaign. If the process exists, the interactive campaign process sends a MT (mobile terminated) WhatsApp message to the WhatsApp API. The API receives this MT message and sends it to META. As a final cycle process, META will analyze the MT message.

📘

NOTE

The message will only be delivered if it contains a WhatsApp template approved by META or if the end user interacts with the phone number associated with the WABA account within a period less than 24 hours.

The word “Interact” means that the user enters characters through the WhatsApp application to the number associated with the WABA account.

For example, you have created a Trivia campaign and defined the “PLAY” keyword to interact with this campaign through the WhatsApp delivery channel. Then, you create a simulated MO message that contains the PLAY keyword. This MO message will call to the campaign to start the Trivia, so the campaign will send the first trivia question as an MT message to the end user through the WhatsApp delivery channel, but the message won't be delivered because the end user has not interact with the phone number associated with the WABA account within a period less than 24 hours.

When you create a simulated MO message, the request body contains the following data:

HTTP Request : POST /whatsapp/messages/mo

{
  "from": "+100000002",
  "to": "+100000001",
  "body": "message text"
}

The parameters presented in the request body example when creating the simulated MO message are the following:

Parameter Required Description
from Yes

Determines the sender phone number for your simulate MO message.

Numbers are specified in E.164 format → (‘+’ and a country code).

to Yes

Phone number provided during the WABA account setup will be used as the sender of the MT message.

It will receive the simulated MO message.

Numbers are specified in E.164 format → (‘+’ and a country code).

body Yes

Simulated MO message text.

When you created the simulated MO message, the response body contains the following data:

{
    "meta": {
        "timestamp": 1686755395210,
        "transactionId": "03fabb4c-4670-47e8-83ef-4b0a5e4c2883",
        "explain": "Request accepted"
    }
}