POST
/
message
curl --request POST \
  --url https://chat.zoko.io/v2/message \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "channel": "whatsapp",
  "recipient": "919998880000",
  "type": "template",
  "message": "<string>",
  "caption": "<string>",
  "templateId": "greeting",
  "templateArgs": [
    "arg1"
  ],
  "templateLanguage": "en",
  "assign": {
    "assigneeId": "<string>",
    "override": true
  },
  "contacts": {
    "whatsappContacts": [
      {
        "name": {
          "prefix": "<string>",
          "firstName": "<string>",
          "middleName": "<string>",
          "lastName": "<string>",
          "suffix": "<string>",
          "formattedName": "<string>"
        },
        "org": {
          "company": "<string>",
          "department": "<string>",
          "title": "<string>"
        },
        "addresses": [
          {
            "url": "<string>",
            "street": "<string>",
            "city": "<string>",
            "state": "<string>",
            "zip": "<string>",
            "countryCode": "<string>",
            "country": "<string>"
          }
        ],
        "emails": [
          {
            "email": "<string>",
            "type": "<string>"
          }
        ],
        "phones": [
          {
            "phone": 919876543210,
            "type": "office"
          }
        ]
      }
    ]
  }
}'
{
  "status": "202",
  "statusText": "Accepted",
  "messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

apikey
string
headerrequired

Authentication is done via apikey provided for your account

Include the following in your request header

apikey: "your_apikey_here"

Body

application/json
channel
enum<string>
required
Available options:
whatsapp
recipient
string
required

For channel whatsapp -> E.164 format without leading +

type
enum<string>
required
Available options:
text,
image,
document,
audio,
video,
location,
sticker,
contacts,
template,
richTemplate,
buttonTemplate
message
string

Content of the message.

type text - contains text content of the message

type image,document, audio, video, sticker - contains the file URL

type location - contains latitude and longitude in the format <latitude>:<longitude>

type template, richTemplate, buttonTemplate, contacts - field is NOT used

caption
string

Describes the specified image, video or document media. Do not use with audio media.

templateId
string

Template ID

mandatory for message type template, richTemplate and buttonTemplate

templateArgs
string[]

Template placeholder values in the same order as in the template.

mandatory for message type template, richTemplate and buttonTemplate

templateLanguage
string

Template Language

Language is defaulted to en (English), if not provided

mandatory for message type template, richTemplate and buttonTemplate only if the template is not in default language en

assign
object

If the customer (recipient) needs to be assigned to an agent

contacts
object

Contacts array for message type contacts

Response

200 - application/json
status
string
statusText
string
messageId
string