POST
/
whatsapp
/
send-template
curl --request POST \
  --url https://api.open.cx/whatsapp/send-template \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "template_id": "<string>",
  "phoneNumberId": "<string>",
  "variables": [
    "<string>"
  ],
  "contact": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  }
}'
{
  "whatsapp_message_id": "<string>",
  "opencx_message_id": "<string>",
  "opencx_session_id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
template_id
string
required

The ID of the WhatsApp template to send

phoneNumberId
string
required

The ID of the WhatsApp number to send the template from

variables
string[]
required

A list of values to be used for the variables in the template. Values will be taken in order; HEADER then BODY then BUTTONS. This works whether the template's parameters are NAMED or POSITIONAL.

contact
object
required

A contact identifier; either an ID, email, or phone number. If no contact is found, a new contact will be created (if a phone number was provided).

Response

201
application/json
whatsapp_message_id
string
required

The message ID returned by WhatsApp

opencx_message_id
string
required

The message ID in our system

opencx_session_id
string
required

The session ID in our system