POST
/
api
/
v1
/
campaign
/
whatsapp
/
send
curl --location --request POST 'https://api.zixflow.com/api/v1/campaign/whatsapp/send' \
--header 'Authorization: Bearer {{zixflow_api_key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "13023895111",
    "phoneId": "104898309288724",
    "templateName": "marketing_sample_2",
    "language": "en",
    "variables": {
        "video":"http://techslides.com/demos/sample-videos/small.mp4"
    },
    "submissionStatus": true
}'
{
  "status": true,
  "message": "Message sent successfully"
}

Body

to
string
required

Specifies the recipient’s phone number in international format (e.g., “1xxxxxxxxxx”).

phoneId
string
required

This is the unique identifier associated with the sender’s phone number given by WhatsApp.

templateName
string
required

Refers to the name of the template to be used for the WhatsApp message. In this case, it is set to “hello_world.” You can obtain it from the template list screen.

language
string
required

Specifies the language of the message, with “en_US” representing American English. You can get it from the template list screen.

variables
object
required

Custom variables used for the template. Please provide a JSON object with the required data.

source
string
default: "API"

If the “linkWithRecord” is set to true, the source from which the WhatsApp message is sent should be mentioned; otherwise, it defaults to API.

linkWithRecord
boolean

Specify whether to associate the current message with a record and display it in the inbox. Set it to “true” for linking with a record; otherwise, it defaults to “false.”

submissionStatus
boolean

Indicates whether to wait for the submission status. Set it to “true” if you want to wait for the submission status; otherwise, it defaults to “false.”

Response

status
boolean

Indicates whether the call was successful. true if successful, false if not.

message
string

success or error response message

Variables

To know all required variable and their keys for selected template, use above Get Template Variable API. It will return response as

{
    "status": true,
    "message": "Success",
    "data": [
        {
            "label": "Header Image",
            "keyName": "image",
            "type": "IMAGE_URL"
        },
        {
            "label": "Body 1",
            "keyName": "body_1",
            "type": "TEXT"
        }
    ]
}
typesample value
IMAGE_URL<image-url>
VIDEO_URL<video-url>
DOCUMENT_URL<document-url>
TEXT<text>

For above variable response the varibales value will be

{
    variables:{
        "image": "<image-url>",
        "body_1": "<variable-text>"

        ....

        [keyName]:"<variable-value>"
    }
}