curl --request POST \
--url https://api.open.cx/whatsapp/send-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_id": "<string>",
"phone_number_id": "<string>",
"variables": [
"<string>"
],
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"session_id": "<string>"
}
'{
"whatsapp_message_id": "<string>",
"opencx_message_id": "<string>",
"opencx_session_id": "<string>"
}Directly send a WhatsApp template to a contact
curl --request POST \
--url https://api.open.cx/whatsapp/send-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_id": "<string>",
"phone_number_id": "<string>",
"variables": [
"<string>"
],
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"session_id": "<string>"
}
'{
"whatsapp_message_id": "<string>",
"opencx_message_id": "<string>",
"opencx_session_id": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the WhatsApp template to send
The ID of the WhatsApp number to send the template from
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.
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).
Show child attributes
Optional OpenCX session ID to send the template to. If not provided, a new session will be created. If provided ID is related to another WhatsApp phone number or is not a WhatsApp session or is related to a different contact, a new WhatsApp session will be created.
Was this page helpful?