WhatsApp

Sends a WhatsApp message

Sends a single WhatsApp message to a single recipient. The message content comes from a pre-approved WhatsApp template, addressed by template_key or template_alias; The message content is based on the merge_info which provides the values for the template placeholders. from must be a valid WhatsApp sender number configured for the sending agent. Both from and to must include the country code.

The message is queued on acceptance; template-variable and delivery failures surface asynchronously in the message logs (for example, a send with missing template variables is accepted but ends in the process_failed status).

post/whatsapp

Request

  • Base URL
    https://cpaas.zoho.com/v1.1
  • Auth
    API key in header Authorization

Request body

fromstring required

WhatsApp sender number of the agent, including the country code.

tostring required

Recipient phone number, including the country code.

template_keystring uuid

Key of a pre-approved WhatsApp template. Provide this or template_alias.

template_aliasstring

Alias of a pre-approved WhatsApp template. Provide this or template_key.

merge_infoobject

Key-value map that supplies the template's variables. A message with missing variable values is accepted but fails asynchronously with the process_failed status.

agent_idstring

Identifier of the sending agent. Optional - defaults to the agent bound to the API token.

client_referencestring

Client-supplied reference identifier, echoed in the message logs.

Example request

{
  "from": "+14155550142",
  "to": "+919876543210",
  "template_key": "d0109d00-b191-11f1-95b1-aaa8828ce996",
  "merge_info": {
    "code": "234234"
  },
  "client_reference": "otp-234234"
}

Response

WhatsApp message queued for delivery.

statusstring

Example response

{
  "data": {
    "code": "MSG_101",
    "message_id": "1ba7d8d0-b680-11f1-91b5-d2a30e0412c2",
    "message": "Message queued",
    "request_id": "2d6f.14350939.wa1.1ba7d8d0-b680-11f1-91b5-d2a30e0412c2.1a0c9102edd"
  },
  "status": "success"
}

Changes

No recorded changes to this operation across all 1 revision of this API.