Loader

Comparison: Clickatell's first generation WhatsApp API vs new One API

HTTP request endpoints

 

Type

Legacy WhatsApp API

One API

Message sending

POST https://platform.clickatell.com/wa/messages

POST https://platform.clickatell.com/v1/message

Media upload

Not Supported

POST https://platform.clickatell.com/v1/media

Media download

Not Supported

GET https://platform.clickatell.com/v1/media

 

Curl calls

Below is an example curl command to send an outbound message via the legacy WhatsApp API and via the One API.

Replace ‘[Customer-Direct-Wa-API-key] / [Customer-Direct-OneAPI-key]‘ and ‘[Direct WhatsApp JSON request body] / [OneAPI JSON request body]‘ with actual values.

 

Description

Legacy WhatsApp API

One API

Example curl call for message sending

curl -i \

-X POST \

-H "Content-Type: application/json" \

-H "Accept: application/json" \

-H "Authorization: [Customer-Direct-Wa-API-key]" \

-d '[Direct WhatsApp JSON request body]' \

-s https://platform.clickatell.com/wa/messages

curl -i \

-X POST \

-H "Content-Type: application/json" \

-H "Accept: application/json" \

-H "Authorization: [Customer-Direct-OneAPI-key]" \

-d '[OneAPI JSON request body]' \

-s https://platform.clickatell.com/v1/message

 

Outbound message request comparison (business-to-handset)

 

The table below compares the request required to send various message types via the legacy WhatsApp API and via the new One API respectively.

Features/requirements that are either new or that differ between the legacy WhatsApp API and the new One API are listed under ‘Notes‘.

 

Plain text

 Notes

  • No major changes in the JSON structure for sending plain text messages via the One API.
  • A new ‘channel‘ parameter is used for specifying the channel over which the message must be sent if you have multiple channels linked to an One API integration.
  • Required encoding for WhatsApp remains UTF-8.

Online One API developer documentation

 

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

POST /wa/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-Direct-Wa-API-key]

JSON request body:

{

  "messages": [

    {

      "to": "27999000001",

      "content": "Here is an example message",

      "clientMessageId": "Customer-Message-Id"

    }

  ]

}

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-Direct-Wa-API-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "27999000001",

      "content": "Here is an example message",

      "clientMessageId": "Customer-Message-Id"

    }

  ]

}

Content-Type: application/json

Authorization: [Customer-Direct-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "27999000001",

      "content": "4wIHuMqqKIb7poTZfn3FzVA58KT8X8pwmBHw2YiufwuMwn53enhNA8ppfrW/V1LcVnY+ZJ8aHZ0CONWSASaYSg/PGhXRQJAM3g/aq5O3HEmzl6kPUZXNjVsbuiHnXeLW",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwFtLrfBKLlvhXd57szd4Bz1AAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMugYYXnQAUKo9zIy3AgEQgDunOyaASkPc8vpgZ0kA6W/OnrbqodTiNWOZfy6Uj6aY1jk3gPUrTWqhyedSgAp5K4Hi4/0XsAWN6LxpJA=="

    }

  ]

}

  Success response Success response  

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "a4b828469b0a40f29efb1524892b23d9",

      "accepted": true,

      "to": "27999000001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "25a46c36ebd246369f735da77583844e",

      "accepted": true,

      "to": "27999000001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}


Plain text – with preview first URL

Notes

  • No major changes in the JSON structure for sending plain text messages via the One API.
  • A new ‘channel‘ parameter is used for specifying the channel over which the message must be sent if you have multiple channels linked to an One API integration.
  • Required encoding for WhatsApp remains UTF-8.

 

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

POST /wa/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-Direct-Wa-API-key]

JSON request body:

{

  "messages": [

    {

      "to": "27999000001",

      "content": "Here is an example message with a URL https://www.facebook.com",

      "previewFirstUrl": true,

      "clientMessageId": "Customer-Message-Id"

    }

  ]

}

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-Direct-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "27999000001",

      "content": "Here is an example message with a URL https://www.facebook.com",

      "previewFirstUrl": true,

      "clientMessageId": "Customer-Message-Id"

    }

  ]

}

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

 

Authorization: [Customer-Direct-Wa-API-key]

 

 

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "27999000001",

      "content": "JMj1C5XlC1+tTGZrIHp9JAis+A/ar2rvzQrVoWME038LfdIVzx9+TWntOX5J/h76L+bE+Qf0vERm7L5v+5syP1lezI2uaQIiIrWgoPZB5MI=",

      "previewFirstUrl": true,

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwFxyLWSUAOfn2FSdi7tHX3zAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMVvCglm6CoRWaZFmUAgEQgDswBsX7D2cRThRWoypriPx2dmuwssxizdD+MhM1oqQRLuvC3lVLt1nAp1bYNe7NRnFzJ/waPmZa/E/GIg=="

    }

  ]

}

 

 

 

Success response

Success response

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "12d960e2b249454d8f2916062d3ee2c7",

      "accepted": true,

      "to": "27999000001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "707d3ea51ff84afda82d82f512581d9e",

      "accepted": true,

      "to": "27999000001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Inline media

Notes

  • The ‘contentType’ and ‘caption’ parameters have been moved into a ‘media’.
  • The ‘content’ parameter that contains the base64 encoded binary file data remains in the ‘messages‘ object.

 

Restrictions

  • A single media file in an inline media message request has a limit of 20MB
  • The total request payload size is limited at 30MB

 

Online One API developer documentation

 

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

POST /wa/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-Direct-Wa-API-key]

JSON request body:

{

  "messages": [

    {

      "to": "27999000001",

      "contentType": "image/png",

      "content": "Base64 Encoded Binary File Data",

      "caption": "File Caption",

      "clientMessageId": "Customer-Message-Id"

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "content": "Base64 Encoded Binary File Data",

      "media": {

        "contentType": "image/png",

        "fileName": "myfilename.png",

        "caption": "File Caption"

      }

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "content": "Base64 Encoded - Encrypted Binary File Data",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwH4kNy6xp2F8zxQbWccpxKEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMKCiX0wtLihg3xuopAgEQgDtETtj8f3S+rAnwyIxe91ctZOCADFWDxHmFHWmQGMO2egqARTubydLW7YZxaw6LHE2S5ob0qpL5iMHE1Q==",

      "media": {

        "contentType": "image/png",

        "fileName": "myfilename.png",

        "caption": "WoBbuFeAUoqxmUxoJv90OmHjPFLZZVPbbFEOTzD8jeI=",

        "sha256Hash": "529fd5482f43db39992a894bbe4216f51a4d724131a97b93cc5589433b545820"

      }

    }

  ]

}

 

 

Success response

Success response

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "695a996295d24cc3944360ba7168d333",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "5defc030df5c425ca2bb216567c2d091",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Media file upload

Notes

  • This is used to upload media files to the Clickatell server. In response to the upload, you will receive a ‘fileId‘ that will be required in the media file sending request to reference the media file instead of including the base64 encoded binary data inline with the JSON request.

  • The media file data that is sent to the Clickatell server must be raw binary data as read from the file stream, and not base64 encoded.

  • The HTTP parameter 

  • The HTTP parameter ‘broadcastAllowed=true’ is specified in the request if the file does not contain any personal information and the business need to send the same file to multiple end-users. Note that a file uploaded for broadcasting is available for 30 days on the Clickatell servers from the day of upload.

  • The ‘Content-Type’ HTTP header is required to specify the content type of the raw binary data stream if that is being uploaded.

  • The ‘Authorization’ HTTP header containing the API key for the integration is required, as it is only allowed to send an uploaded media file via the WhatsApp business number for which it was uploaded.

  • All file types will be accepted by the media upload endpoint. File type limitations will be enforced on the actual message-sending API call.

 

Restrictions

  • It is not allowed to send a media file uploaded with the broadcasting flag with any template message containing media.

  • The media file size limitation on One API is 30MB per file upload. Note that in conjunction with this restriction, WhatsApp also enforces size restrictions per media type.

 

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

 

 

 

Request detail

Request detail

Not applicable. No actual messages are sent to the handset when media files are uploaded to Clickatell’s server.

POST /v1/media

HTTP Headers:

Content-Type: [Actual-File-Content-Type]

Authorization: [Customer-OneAPI-key]

Request parameters (always ensure that parameter values are URL encoded):

 

1) Media file upload for sending to defined user:

fileName=[filename.extension]

to=2799900001

 

2) Media file uploaded for broadcasting to multiple users:

fileName=[filename.extension]

broadcastAllowed=true

  

Request body:

Raw binary file data

 

POST /v1/media

HTTP Headers:

Content-Type: [Actual-File-Content-Type]

Authorization: [Customer-OneAPI-key]

Request parameters (always ensure that parameter values are URL encoded):

 

1) Media file upload for sending to defined user:

fileName=[filename.extension]

to=2799900001

encryptionKey=[BASE64-ENCODED-ENCRYPTION-KEY]

kmsArn=[AWS-KMS-MT-ARN]

sha256FileHash=[SHA256-FILE-HASH]

 

2) Media file uploaded for broadcasting to multiple users:

fileName=[filename.extension]

broadcastAllowed=true

encryptionKey=[BASE64-ENCODED-ENCRYPTION-KEY]

kmsArn=[AWS-KMS-MT-ARN]

sha256FileHash=[SHA256-FILE-HASH]

 

Request body:

Raw encrypted binary file data

 

 Request Examples

Request Examples 

1) Example curl call to upload an image for sending to one defined user:

 

curl -X POST \

-H "Authorization: [Customer-OneAPI-key]" \

-H 'Content-Type: image/jpg' \

--data-binary @myFilename.jpg \

"https://platform.clickatell.com/v1/media?fileName=myFilename.jpg&to=2799900001"

 

2) Example curl call to upload an image for broadcasting to multiple users:

 

curl -X POST \

-H "Authorization: [Customer-OneAPI-key]" \

-H 'Content-Type: image/jpg' \

--data-binary @myFilename.jpg \

"https://platform.clickatell.com/v1/media?fileName=myFilename.jpg&broadcastAllowed=true"

 

1) Example curl call to upload an image for sending to one defined user:

 

curl -X POST \

-H "Authorization: [Customer-OneAPI-key]" \

-H 'Content-Type: image/jpg' \

--data-binary @myEncryptedFilename.jpg \

"https://platform.clickatell.com/v1/media?https://platform.clickatell.com/v1/media?fileName=myEncryptedFilename.jpg&to=2799900001&encryptionKey=AQIDAHigcx4kN%2BSNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwG%2BGsUGTTvg84B0DGcrKziKAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQML5a3jpKpnd6J5753AgEQgDtdefpq9YRdlqqNX7lixas5XQZuXtnPb8UficO43DwuWRaPvc1D%2BEGKLtlwTVtpbo%2B3GzWYMnW837%2BSMA%3D%3D&kmsArn=arn%3Aaws%3Akms%3Aeu-west-1%3A748156735851%3Akey%2Faa09fa21-6166-4fe2-bb1f-9874a7f7561e&sha256FileHash=529fd5482f43db39992a894bbe4216f51a4d724131a97b93cc5589433b545820"

 

2) Example curl call to upload an image for broadcasting to multiple users:

 

curl -X POST \

-H "Authorization: [Customer-OneAPI-key]" \

-H 'Content-Type: image/jpg' \

--data-binary @myEncryptedFilename.jpg \

"https://platform.clickatell.com/v1/media?fileName=myEncryptedFilename.jpg&broadcastAllowed=true&encryptionKey=AQIDAHigcx4kN%2BSNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwFWoKBkAcY%2BIFRiGHmyz0ngAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMGYsxwlvkvFsc%2B53SAgEQgDsXWAl9vLsasn89P5ATPvZfgWO8sQPZLhSq1pP9fLZNdzvxOeNN0IiR0qtxTdhYf5c00FKFs5I4vImrMw%3D%3D&kmsArn=arn%3Aaws%3Akms%3Aeu-west-1%3A748156735851%3Akey%2Faa09fa21-6166-4fe2-bb1f-9874a7f7561e&sha256FileHash=529fd5482f43db39992a894bbe4216f51a4d724131a97b93cc5589433b545820"

 Success Response

Success Response 

HTTP 201

{

   "fileId" : "uuid.xxx",

   "accepted" : true,

   "error" : null

}

HTTP 201

{

   "fileId" : "uuid.xxx",

   "accepted" : true,

   "error" : null

}

Sending media by reference

Notes

  • Note that the ‘contentType‘ parameter no longer forms part of the ‘media’ object in the One API request, as the content type was specified when the media file was uploaded to the Clickatell server.

  • The ‘fileId’ parameter as received from the media upload API call will serve as the input to the ‘fileId’ in the media object in this send media message request.

Restrictions

  • It is not allowed to send a media file uploaded with the broadcasting flag with any template message containing media.

Online One API developer documentation

 

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "media": {

        "fileId": "UUID.xxx",

        "caption": "File Caption"

      }

    }

  ]

}

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwFtLrfBKLlvhXd57szd4Bz1AAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMugYYXnQAUKo9zIy3AgEQgDunOyaASkPc8vpgZ0kA6W/OnrbqodTiNWOZfy6Uj6aY1jk3gPUrTWqhyedSgAp5K4Hi4/0XsAWN6LxpJA==",

      "media": {

        "fileId": "UUID.xxx",

        "caption": "4wIHuMqqKIb7poTZfn3FzVA58KT8X8pwmBHw2YiufwuMwn53enhNA8ppfrW/V1LcVnY+ZJ8aHZ0CONWSASaYSg/PGhXRQJAM3g/aq5O3HEmzl6kPUZXNjVsbuiHnXeLW"

      }

    }

  ]

}

 

Success Response

Success Response

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "135a9e6daf114381b3e0ce962a7a11a5",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "521aa7d226e04fdb8fe565bfd00b8267",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

Location

Notes

  • A new location pin drop message (from the business to the handset user) is available on One API.

  • This message type is not available on the legacy WhatsApp API.

Restrictions

  • The longitude=0, latitude=0 combination is not

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "location": {

        "longitude": "18.635891216806",

        "latitude": "-33.881037287485",

        "name": "Clickatell",

        "address": "100 Edward Street, Bellville, Bellville, Western Cape 7530"

      }

    }

  ]

}

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwGgAG8uyZ4hYcwvCo2yA472AAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMFl7evO6frS5b2HuHAgEQgDvY/f8HN1PYPHDU2+F3StJtuddVfYz2vkoEfLFgJFFsXBcey0AxiY7L+BWqj3fAxJkAu3GjaJVeZVbK8g==",

      "location": {

        "longitude": "KJIgTSKD/CiAr80WVt+hHHKqPdKS3CjQahyUr7LsuU0=",

        "latitude": "gMhEbJPyB7bQ8mwznV/2PaUmSkOtAPT1C4UDn+SKg4f0QTexyi4BaBTT24l56ur4",

        "name": "8z6Y2LHZvb78yz0ZxkTsBAOQi1PcNorB5ad59qQ8TeE=",

        "address": "vsxlSyHKBKoNNWEBI56x+iU7nSnNoOVRt4lUCB8hJAuyCugpVnxSoJpDhJARESPDFQH8IM0Mj/YcxMvMz2ajz1vmjspYeDalGAeoi+1JLAY="

      }

    }

  ]

}

 

Success Response

Success Response

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "76b4b308bd134866af6cff20c79d1f16",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "8c966e77024244d2957274d57853f639",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Contacts

Notes

  • A new contacts message (from the business to the handset user) is available on One API.

  • This message type is not available on the legacy WhatsApp API.

  • A business can send a single person/business or multiple persons/businesses contact information to a handset user in a single.

Restrictions

  • At least one (1) contact is required for a contacts message.

  • Each contact must contain at least the ‘name’ object plus any one other additional contacts object or parameter.

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

 

 

 

Minimal Contacts Info Example

Minimal Contacts Info Example

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "contacts": [

        {

          "name": {

            "firstName": "John",

            "formattedName": "John Smith",

            "lastName": "Smith"

          },

          "phones": [

            {

              "phone": "+1 (940) 555-1234",

              "type": "HOME"

            }

          ]

        }

      ]

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "contacts": [

        {

          "name": {

            "firstName": "D/ebgTU1x3vakOCj4RXdwvqjWBy6sKVL6269j0umeXc=",

            "formattedName": "chpdfMe6jWtx7P0fqGovJ5pHY3YaKK9DU5RUPwaI43w=",

            "lastName": "3qgOiMjuCpOwvXQoEjh/jNF3sK9deSI0ZuhsAKmlkFk="

          },

          "phones": [

            {

              "phone": "8D6H6gc5pzLjRKotRuHZiAqYyibhMpz/Nl+rmWJLfbkint+L8kLvdKQn6gqGksJU",

              "type": "1iO02Td7gqDldkfUWhxoUn2EmYoT+4iTcn/Ayq5RrK4="

            }

          ]

        }

      ]

    }

  ]

}

 

 

Full Info Contact Example

Full Info Contact Example

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "contacts": [

        {

          "addresses": [

            {

              "city": "Menlo Park",

              "country": "United States",

              "countryCode": "us",

              "state": "CA",

              "street": "1 Hacker Way",

              "type": "HOME",

              "zip": "94025"

            },

            {

              "city": "Menlo Park",

              "country": "United States",

              "countryCode": "us",

              "state": "CA",

              "street": "200 Jefferson Dr",

              "type": "WORK",

              "zip": "94025"

            }

          ],

          "birthday": "2021-12-31",

          "emails": [

            {

              "email": "test@fb.com",

              "type": "WORK"

            },

            {

              "email": "test@whatsapp.com",

              "type": "WORK"

            }

          ],

          "name": {

            "firstName": "John",

            "formattedName": "John Smith",

            "lastName": "Smith"

          },

          "org": {

            "company": "WhatsApp",

            "department": "Design",

            "title": "Manager"

          },

          "phones": [

            {

              "phone": "+1 (940) 555-1234",

              "type": "HOME"

            },

            {

              "phone": "+1 (650) 555-1234",

              "type": "WORK",

              "wa_id": "16505551234"

            }

          ],

          "urls": [

            {

              "url": "https://www.facebook.com",

              "type": "WORK"

            }

          ]

        }

      ]

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "contacts": [

        {

          "addresses": [

            {

              "city": "v99L33eLDQN/zAGU4kZQZZ5QxmDOz4/WnXnNK4Fk1x8=",

              "country": "6tlfaFRPlPi+C2VTbafJ+AaTsVLmAJWQFb9v6mMdA8A=",

              "countryCode": "EgLhANweQI3a5OGO2KlvkxWW4dsXavJgpSZLQ8SGH/I=",

              "state": "DdyoraMPHgPxcoJTtpzUl525NLw00wSk2LKBzOKwpjc=",

              "street": "YyPtMuFEuT4EzkWck4REZ/dOJBShfm30hbJHBcssc3Y=",

              "type": "MaDV/PnCXPU94wlhB/sAJbgMUpKeSeiDvuXqk5HulxI=",

              "zip": "7nvMRQwZBF/ArEe2AbBmRv7qJ2VrPdp2BRR7fCW0PgQ="

            },

            {

              "city": "3zoNmELlPcfDtSPeCsFOqSyqhM1TQeYSMGRlmPjsnN4=",

              "country": "TcpkonJPos1YGxLRCJImJtUfDvxQ/PomY1evrWFZLQQ=",

              "countryCode": "YLuaC4pevJXvtmOBMLWjB9Rpj0c5IjqfvfanbNIv9gU=",

              "state": "qXTEi5ZC3tUdPjGKr+ChJpXtpyaWuubZblHxNEEpGC8=",

              "street": "84N8w7BE5acFPhmP8GJ8sE6oddHF8ZEl8OPl90YhkWqYvfiAMrEoDPbgR5Gr5MBr",

              "type": "t1zX35vhZROmnY6tK/CzISZqKPEQ0KpQbA0VLo5iu4Q=",

              "zip": "9PExw5nK1zCcp5o7ayUD2Oje/d1nqxfIHayoS6Og7g4="

            }

          ],

          "birthday": "fULKQkRQACWBSkUzfhQqvqyZcJYvtntSuKS0q8eG8GI=",

          "emails": [

            {

              "email": "lAPkB/gcN5U67L4rtuX253iYQvkUCtnvzLR05d66hOg=",

              "type": "/L5i3KbXhdj6OzFb3lOUonrrHHo3kNXREQ8u8QvNMIc="

            },

            {

              "email": "oaeKFpxk2a/Z+PlT6/TaekUTNsNDXcRwp+4yNM3vaAi5xkNuh++cVn1SJfStTwSp",

              "type": "ulZADNGT1e2z4cXGPOFzVUANfnK77TYw4E9JEfzXyME="

            }

          ],

          "name": {

            "firstName": "D/ebgTU1x3vakOCj4RXdwvqjWBy6sKVL6269j0umeXc=",

            "formattedName": "chpdfMe6jWtx7P0fqGovJ5pHY3YaKK9DU5RUPwaI43w=",

            "lastName": "3qgOiMjuCpOwvXQoEjh/jNF3sK9deSI0ZuhsAKmlkFk="

          },

          "org": {

            "company": "y88D0eOZzDvLrBk+Oa+FWxCBPD5bij15RellW1fTpDQ=",

            "department": "iZg14767oYiaj+uNUU/3aG1Yxe8pStzRfhSLa6uTrUU=",

            "title": "tcH0r/UWkIzFTk8jm1A8LkT2Y15vH57AYyMhsoKqNAk="

          },

          "phones": [

            {

              "phone": "8D6H6gc5pzLjRKotRuHZiAqYyibhMpz/Nl+rmWJLfbkint+L8kLvdKQn6gqGksJU",

              "type": "1iO02Td7gqDldkfUWhxoUn2EmYoT+4iTcn/Ayq5RrK4="

            },

            {

              "phone": "7WRYkjZY1UD+9dhU9ZFKZx1TeT0YbjnR4/3fPaSzl14WK4H40LuIwKZrxYe3iR2G",

              "type": "Clwuyb2NbN6NEX9kATa1Kc1ALYjUeC6vrnPgR4HFgDA=",

              "wa_id": "jUVisANnDTJKOSoHGbR5qyLEX9MHwdzp/5sj1zXGKBA="

            }

          ],

          "urls": [

            {

              "url": "J+4AuGCrFJHWG709u6SAKlvQfjFkbpk5uYVnd50GQyOAxHo5+9Cyrv9+xXlj1dq+",

              "type": "YSx/d+90pye12MRJc0LEPhQL3NDwzmLuaYiaO48wE5I="

            }

          ]

        }

      ]

    }

  ]

}

 

Success Response

Success Response

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "739434f210d74f92a81b586c4ac9a478",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "0d1164789c084c328dc1a38309924b55",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HSM (legacy support)

Notes

  • The request structure for sending an HSM message with the legacy WhatsApp API has remained the same for the new One API.

HSM could be deprecated in the future.

This message request type is seen as a legacy message type and should be replaced by the plain text template request type. See the ‘Templates – Plain text (NO header parameter) message type section below.

 

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

POST /wa/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-Direct-Wa-API-key]

 

JSON request body:

 

{

  "messages": [

    {

      "to": "27999000001",

      "clientMessageId": "Customer-Message-Id",

      "hsm": {

        "template": "welcome_notification_demo",

        "parameters": {

          "1": "Clickatell"

        }

      }

    }

  ]

}

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "hsm": {

        "template": "welcome_notification_demo",

        "parameters": {

          "1": "Clickatell"

        }

      }

    }

  ]

}

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "hsm": {

        "template": "welcome_notification_demo",

        "parameters": {

          "1": "chpdfMe6jWtx7P0fqGovJ5pHY3YaKK9DU5RUPwaI43w="

        }

      }

    }

  ]

}

 

 

 

Success Response

Success Response

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "65074f0ecc53430a9e3288469e0aadb0",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "557a922421ec467989b8c8bcd415db96",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

Templates

Notes

  • All template message types can be sent to the handset user outside of the 24 hour re-engagement window.

  • Template messages have additional costs associated with the message as determined by Facebook.

  • The handset user must opt-in to receive template messages as specified in the WhatsApp requirements.

  • Template parameters are now allowed to contain any:

  • \n, \t characters.

  • More than 4 consecutive spaces.

  • Character formatting.

  • The template message structure can contain formatting characters during template creation.

Templates – Plain text (NO header parameter)

Notes

  • This message type must be used as the new message type instead of the legacy HSM message type.

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

 Not supported

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",   

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "template": {

        "templateName": "welcome_notification_demo",

        "body": {

          "parameters": {

            "1": "Clickatell"

          }

        }

      }

    }

  ]

}

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

 

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "welcome_notification_demo",

        "body": {

          "parameters": {

            "1": "chpdfMe6jWtx7P0fqGovJ5pHY3YaKK9DU5RUPwaI43w="

          }

        }

      }

    }

  ]

}

 

 

Success Response

Success Response

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "1bb69b30bca74171a759e3c5ede33a3a",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "93681a067f244b9fb32ca5ef4ec56c34",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Templates – Plain text (WITH header parameter)

Notes

  • You are only allowed to create text template headers with one (1) parameter. This means that the text.parameters cannot contain more than one (1) value.

  • The structure allows for more than key-value pair for future expansion if WhatsApp changes this restriction.

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "template": {

        "templateName": "test_header_with_text",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "February 2021"

            }

          }

        },

        "body": {

          "parameters": {

            "1": "Msg 1 Template werner_test_header_with_text",

            "2": "R13.00"

          }

        }

      }

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "test_header_with_text",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "lAPkB/gcN5U67L4rtuX253iYQvkUCtnvzLR05d66hOg="

            }

          }

        },

        "body": {

          "parameters": {

            "1": "D/ebgTU1x3vakOCj4RXdwvqjWBy6sKVL6269j0umeXc=",

            "2": "3qgOiMjuCpOwvXQoEjh/jNF3sK9deSI0ZuhsAKmlkFk="

          }

        }

      }

    }

  ]

}

 

 

 

Success Response

Success Response

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "11b5b4a66b6a4119afab2055f22958b1",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "1d0962d2924c4f539880f55dfca7a07d",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Template – media

Notes

  • WhatsApp currently supports sending media templates for video, image and document file types (see https://docs.clickatell.com/channels/one-api/supported-content-types/ for supported content types)

  • Media templates require that each media file reference in a template media message must be uploaded via the Clickatell media upload API call with the ‘to’ HTTP parameter on the media upload call matching the ‘to’ JSON parameter in the send media template message request.

  • The header.media.fileId parameter is the ‘fileId’ parameter as received in response to the media upload API call.

Restrictions

  • WhatsApp only allows the sending of PDF files for the ‘document’ media type.

  • Audio file types are not

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "template": {

        "templateName": "test_media_header_with_image",

        "header": {

          "type": "media",

          "media": {

            "fileId": "c45ada9b-8a51-4413-a134-928c2b085d31.jpg"

          }

        },

        "body": {

          "parameters": {

            "1": "Msg 1 Template werner_test_media_header_with_image",

            "2": "R21.00"

          }

        }

      }

    }

  ]

}

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "test_media_header_with_image",

        "header": {

          "type": "media",

          "media": {

            "fileId": "c568f4d91d7b45909a6461d2ee1715de.pdf"

          }

        },

        "body": {

          "parameters": {

            "1": "D/ebgTU1x3vakOCj4RXdwvqjWBy6sKVL6269j0umeXc=",

            "2": "fULKQkRQACWBSkUzfhQqvqyZcJYvtntSuKS0q8eG8GI="

          }

        }

      }

    }

  ]

}

 

Success Response

Success Response

 

HTTP 202

 

{

  “messages”: [

    {

      “apiMessageId”: “8799d91cc4e640d490854fdc803445b1”,

      “accepted”: true,

      “to”: “2799900001”,

      “clientMessageId”: “Customer-Message-Id”

    }

  ],

  “error”: null

}

 

HTTP 202

 

{

  “messages”: [

    {

      “apiMessageId”: “5f7eb8d606124aedb7e23c0bba935dfd”,

      “accepted”: true,

      “to”: “2799900001”,

      “clientMessageId”: “Customer-Message-Id”

    }

  ],

  “error”: null

}

 

Template – Interactive text suggested response (NO postbackData parameters)

Notes

  • A suggested response message template will present the handset user with a message where there are predefined buttons at the bottom of the message.

  • The buttons and button text are defined at the time of creating the template.

  • If no postbackData is defined in the send message request, the button text of the button pressed by the handset user will be used in the response message which will be received as a plain text message by the business.

  • The handset user can select one (1) or multiple/all of the buttons that is visible on the message. Each button is returned to the business as a separate message but will contain the same source message reference.

  • As soon as a button is selected, the button will be disabled and greyed out.

  • A text header is not a requirement for a suggested response template.

Restrictions

  • An interactive suggested response template can contain a maximum of three (3) buttons. This is a WhatsApp restriction.

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "template": {

        "templateName": "test_header_with_text_quick_reply",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "February 2021"

            }

          }

        },

        "body": {

          "parameters": {

            "1": "Msg 1 Template werner_test_header_with_text_quick_reply",

            "2": "R16.00"

          }

        }

      }

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "test_header_with_text_quick_reply",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "7nvMRQwZBF/ArEe2AbBmRv7qJ2VrPdp2BRR7fCW0PgQ="

            }

          }

        },

        "body": {

          "parameters": {

            "1": "chpdfMe6jWtx7P0fqGovJ5pHY3YaKK9DU5RUPwaI43w=",

            "2": "9PExw5nK1zCcp5o7ayUD2Oje/d1nqxfIHayoS6Og7g4="

          }

        }

      }

    }

  ]

}

 

Success Response

Success Response

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "8577a02bc3794d1298e7036d5e4387f9",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "53b3a1c2c85c49228ae93f8e34b4d478",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Template – Interactive text suggested response (WITH postbackData parameters)

Notes
  • When postbackData is defined in the message request, the postbackData for the button pressed by the handset user will be passed back to the business in a suggested response inbound message.
  • A handset user can select one (1) or multiple/all of the buttons that is visible on the message.
  • Each button is returned to the business as a separate message but will contain the same source message reference.
  • As soon as a button is selected, the button will be disabled and greyed out.
  • A text header is not a requirement for a suggested response template.
Restrictions
  • An interactive suggested response template can contain a maximum of three (3) buttons. This is a WhatsApp restriction.
Online One API developer documentation
Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "template": {

        "templateName": "test_header_with_text_quick_reply",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "February 2021"

            }

          }

        },

        "body": {

          "parameters": {

            "1": "Msg 1 Template werner_test_header_with_text_quick_reply",

            "2": "R16.00"

          }

        },

        "buttons": {

          "suggestedResponse": {

            "postbackData": {

              "1": "{\"buttonPressed\":\"welcome_button1\"}",

              "2": "{\"buttonPressed\":\"welcome_button2\"}",

              "3": "{\"buttonPressed\":\"welcome_button3\"}"

            }

          }

        }

      }

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "test_header_with_text_quick_reply",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "7nvMRQwZBF/ArEe2AbBmRv7qJ2VrPdp2BRR7fCW0PgQ="

            }

          }

        },

        "body": {

          "parameters": {

            "1": "D/ebgTU1x3vakOCj4RXdwvqjWBy6sKVL6269j0umeXc=",

            "2": "9PExw5nK1zCcp5o7ayUD2Oje/d1nqxfIHayoS6Og7g4="

          }

        },

        "buttons": {

          "suggestedResponse": {

            "postbackData": {

              "1": "3zoNmELlPcfDtSPeCsFOqSyqhM1TQeYSMGRlmPjsnN4=",

              "2": "TcpkonJPos1YGxLRCJImJtUfDvxQ/PomY1evrWFZLQQ=",

              "3": "qXTEi5ZC3tUdPjGKr+ChJpXtpyaWuubZblHxNEEpGC8="

            }

          }

        }

      }

    }

  ]

}

 

Success Response

Success Response

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "1ccd1b083ce84f0d80c74dd481b68050",

      "accepted": true,

      "to": "27845362714",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "47618c32350c4f22972ade63d26d4d65",

      "accepted": true,

      "to": "27845362714",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Template – Interactive text action

Notes

  • An interactive action template can be created with a maximum of two (2) buttons. This template message allows a maximum of one (1) dial button and one (1) website URL button per template.

  • The dial button cannot be changed dynamically during message sending as this is not currently allowed by WhatsApp. When the user presses the dial button on the handset, the handset will open the dial pad on the user’s handset with the number populated.

  • The website URL button contains a base URL that is specified at the time of creating the template. With a dynamic URL message request, one (1) parameter can be specified and will be appended to the base URL on the user’s handset.

  • Currently, only one (1) parameter is allowed for the website URL button on an interactive action template message. This is a WhatsApp restriction.

  • When the handset user presses the website URL button, the user will be prompted if he wants to open the specified URL in his web browser.

  • The ‘listPosition’parameter is used to indicate if the websiteUrl button is located in the 1st or 2nd position of the template message as at the time of creating the action template.

  • This parameter is carried in the request to enable future expansion when WhatsApp might allow more than one dynamic website URL button on an action template message.

  • A text header is not a requirement for an interactive action template.

Restrictions

  • Only one (1) parameter is allowed on a dynamic website URL button.

  • The dial button’s phone number is currently only a static number as per WhatsApp restrictions.

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

 

 

 

Dynamic URL

Dynamic URL

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "template": {

        "templateName": "test_header_with_text_dynamic_action",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "February 2021"

            }

          }

        },

        "body": {

          "parameters": {

            "1": "Msg 1 Template werner_test_header_with_text_dynamic_action",

            "2": "R14.00"

          }

        },

        "buttons": {

          "websiteUrl": [

            {

              "listPosition": 2,

              "parameters": {

                "1": "contact/contact-sales/"

              }

            }

          ]

        }

      }

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "test_header_with_text_dynamic_action",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "fULKQkRQACWBSkUzfhQqvqyZcJYvtntSuKS0q8eG8GI="

            }

          }

        },

        "body": {

          "parameters": {

            "1": "chpdfMe6jWtx7P0fqGovJ5pHY3YaKK9DU5RUPwaI43w=",

            "2": "9PExw5nK1zCcp5o7ayUD2Oje/d1nqxfIHayoS6Og7g4="

          }

        },

        "buttons": {

          "websiteUrl": [

            {

              "listPosition": 1,

              "parameters": {

                "1": "YSx/d+90pye12MRJc0LEPhQL3NDwzmLuaYiaO48wE5I="

              }

            }

          ]

        }

      }

    }

  ]

}

 

Success Response

Success Response

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "81542c76b9a146eca02f1e851b491f43",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "40231a9d4e344446a8baf624b0587550",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Static URL

Static URL

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id-2",

      "template": {

        "templateName": "test_header_with_text_dynamic_action",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "February 2021"

            }

          }

        },

        "body": {

          "parameters": {

            "1": "Msg 1 Template werner_test_header_with_text_dynamic_action",

            "2": "R14.00"

          }

        }

      }

    }

  ]

}

 

POST /v1/messages

 

HTTP Headers:

 

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

 

JSON request body:

 

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id-2",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "test_header_with_text_dynamic_action",

        "header": {

          "type": "text",

          "text": {

            "parameters": {

              "1": "fULKQkRQACWBSkUzfhQqvqyZcJYvtntSuKS0q8eG8GI="

            }

          }

        },

        "body": {

          "parameters": {

            "1": "oaeKFpxk2a/Z+PlT6/TaekUTNsNDXcRwp+4yNM3vaAi5xkNuh++cVn1SJfStTwSp",

            "2": "9PExw5nK1zCcp5o7ayUD2Oje/d1nqxfIHayoS6Og7g4="

          }

        }

      }

    }

  ]

}

 

 

 

Success Response

Success Response

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "cde6db6ee78045ba9fcc0db1af660c34",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id-2"

    }

  ],

  "error": null

}

 

HTTP 202

 

{

  "messages": [

    {

      "apiMessageId": "497112220a1747c3aa0ee0d73980d4ed",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id-2"

    }

  ],

  "error": null

}

 

Template – Interactive media suggested response (NO postbackData parameters)

Notes
  • WhatsApp currently supports sending media templates for video, image and document file types.
  • Media templates require that each media file reference in a template media message must be uploaded via the media upload API call with the ‘to’HTTP parameter on the media upload call matching the ‘to’ JSON parameter in the send media template message request.
  • The header.media.fileId parameter is the ‘fileId’parameter as received in response to the media upload API call.
  • Button responses when pressed by the handset user will react the same as described for the ‘Template – Interactive text suggested response (NO postbackData parameters)message type.
Restrictions
  • WhatsApp only allows the sending of PDF files for the ‘document’ media type.
  • Audio file types are not
Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "template": {

        "templateName": "test_media_quick_reply_header_with_pdf",

          

        "header": {

          "type": "media",

          "media": {

            "fileId": "c45ada9b-8a51-4413-a134-928c2b085d31.pdf"

          }

        },

          

        "body": {

          "parameters": {

            "1": "Msg 1 Template werner_test_media_quick_reply_header_with_pdf",

            "2": "R17.00"

          }

        }

      }

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "test_media_quick_reply_header_with_pdf",

        "header": {

          "type": "media",

          "media": {

            "fileId": "ddc2c4519d1a443ba2d99cc45b05cf6c.pdf"

          }

        },

        "body": {

          "parameters": {

            "1": "chpdfMe6jWtx7P0fqGovJ5pHY3YaKK9DU5RUPwaI43w=",

            "2": "fULKQkRQACWBSkUzfhQqvqyZcJYvtntSuKS0q8eG8GI="

          }

        }

      }

    }

  ]

}

 

Success Response

Success Response

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "59e0e380ce25407da1feb50dc67030cc",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "fb3a88b985f44f7588c2890b45adfd5e",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Template – Interactive media suggested response (WITH postbackData parameters)

Notes

  • WhatsApp currently supports sending media templates for video, image and document file types.

  • Media templates require that each media file reference in a template media message must be uploaded via the media upload API call with the ‘to’ HTTP parameter on the media upload call matching the ‘to’ JSON parameter in the send media template message request.

  • The header.media.fileId parameter is the ‘fileId’ parameter as received in response to the media upload API call.

  • Button responses when pressed by the user will react the same as described for the ‘Template – Interactive text suggested response (WITH postbackData parameters)’ message type.

Restrictions

  • WhatsApp only allows the sending of PDF files for the ‘document’ media type.

  • Audio file types are not supported.

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "template": {

        "templateName": "test_media_quick_reply_header_with_pdf",

          

        "header": {

          "type": "media",

          "media": {

            "fileId": "c45ada9b-8a51-4413-a134-928c2b085d31.pdf"

          }

        },

          

        "body": {

          "parameters": {

            "1": "Msg 1 Template werner_test_media_quick_reply_header_with_pdf",

            "2": "R17.00"

          }

        },

          

        "buttons": {

          "suggestedResponse": {

            "postbackData": {

              "1": "{\"buttonPressed\":\"welcome_button1\"}",

              "2": "{\"buttonPressed\":\"welcome_button2\"}",

              "3": "{\"buttonPressed\":\"welcome_button3\"}"

            }

          }

        }

      }

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "test_media_quick_reply_header_with_pdf",

        "header": {

          "type": "media",

          "media": {

            "fileId": "ddc2c4519d1a443ba2d99cc45b05cf6c.pdf"

          }

        },

        "body": {

          "parameters": {

            "1": "chpdfMe6jWtx7P0fqGovJ5pHY3YaKK9DU5RUPwaI43w=",

            "2": "fULKQkRQACWBSkUzfhQqvqyZcJYvtntSuKS0q8eG8GI="

          }

        },

        "buttons": {

          "suggestedResponse": {

            "postbackData": {

              "1": "ulZADNGT1e2z4cXGPOFzVUANfnK77TYw4E9JEfzXyME=",

              "2": "tcH0r/UWkIzFTk8jm1A8LkT2Y15vH57AYyMhsoKqNAk=",

              "3": "jUVisANnDTJKOSoHGbR5qyLEX9MHwdzp/5sj1zXGKBA="

            }

          }

        }

      }

    }

  ]

}

 

Success Response

Success Response

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "fa155c76d83b4a77b88b72c13bea75c7",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "228eda67522341edacb5e6d8d2520148",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

Templates – Plain text (WITH header parameter and no variable)

Notes

  • You are only allowed to create text template headers with one (1) parameter. This means that the text.parameters cannot contain more than one (1) value.

  • This example illustrates a request for a text template that has a static header defined with no variables. Note that the ‘text‘ parameter is defined as an empty object ‘{ }‘.

  • Changes to One API is currently in development to allow you to submit the request as per the example below or omit the ‘header‘ parameter from the request completely.

  • The structure allows for more than key value pair for future expansion if WhatsApp changes this restriction.

Online One API developer documentation

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted) Visual example as seen on the end-users’ handset

Not supported

 

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "template": {

        "templateName": "template_header_0var_one_param",

        "header": {

          "type": "text",

          "text": {}

        },

        "body": {

          "parameters": {

            "1": "8am-5pm"

          }

        }

      }

    }

  ]

}

 

POST /v1/messages

HTTP Headers:

Content-Type: application/json

Authorization: [Customer-OneAPI-key]

JSON request body:

{

  "messages": [

    {

      "channel": "whatsapp",

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id",

      "encryptionKey": "AQIDAHigcx4kN+SNTVLxxd6cYLmM7DE08asxE6NFNkM64hE3lwHJhdFgu6/pYA70ouO1qr6jAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMzc58TZHjteRTi2fiAgEQgDujc/hjzY8GJjg0LUOw6x+5FUwMoF516JBq8hfTGSxYAX45NLRDfN8Obn0nj8qPYQ0yv9FVhrpuDvE8xg==",

      "template": {

        "templateName": "template_header_0var_one_param",

        "header": {

          "type": "text",

          "text": {}

        },

        "body": {

          "parameters": {

            "1": "chpdfMe6jWtx7P0fqGovJ5pHY3YaKK9DU5RUPwaI43w="

          }

        }

      }

    }

  ]

}

 

Success Response

Success Response

 

HTTP 200

{

  "messages": [

    {

      "apiMessageId": "24592e86e98f423e8aa60a10aabbc94d",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

HTTP 200

{

  "messages": [

    {

      "apiMessageId": "129b1cdb63a54cfda560ae3985ae5eed",

      "accepted": true,

      "to": "2799900001",

      "clientMessageId": "Customer-Message-Id"

    }

  ],

  "error": null

}

 

 

Outbound message request acceptance response (business-to-handset)

 

Note: For error codes see the Error Code Comparison section.

 

Legacy WhatsApp API

One API

  • Returns HTTP status code 202 if there is any message in the request that was successfully accepted.
  • Validate each message status in the messages object to verify if the message was successfully accepted.
  • Returns either a 202 or 207 HTTP status code. HTTP status code 207 indicates a mixed set of status codes.
  • Validate each message status in the messages object to verify if the message was successfully accepted.

1) Example with response with only successfully accepted messages

 

HTTP 202

{

  "messages": [

    {

      "messageId": "6eb5bfe33d4546fa8c2331d51f3506c8",

      "accepted": true,

      "to": "27845362714",

      "error": null,

      "clientMessageId": null

    }

  ]

}

 

2) Example with response with mixed statuses

 

HTTP 202

{

  "messages": [

    {

      "messageId": "34f15fbf4d074677803ce56e44f159eb",

      "accepted": true,

      "to": "27845362714",

      "error": null,

      "clientMessageId": null

    },

    {

      "messageId": null,

      "accepted": false,

      "to": "2784",

      "error": {

        "errorCode": 159,

        "error": "Not approved WhatsApp number."

      },

      "clientMessageId": null

    }

  ]

}

1) Example with response with only successfully accepted messages

 

HTTP 202

{

  "messages": [

    {

      "apiMessageId": "505db1d803dc4f478f07b2054298e9b5",

      "accepted": true,

      "to": "27845362714"

    },

    {

      "apiMessageId": "67ee84e4d22545259b81007fa31aa554",

      "accepted": true,

      "to": "27845362714"

    }

  ],

  "error": null

}

 

2) Example with response with mixed statuses

 

HTTP 207

{

  "messages": [

    {

      "apiMessageId": "9b7660e460454837aff07e2f3ae59bac",

      "accepted": true,

      "to": "27845362714"

    },

    {

      "error": {

        "code": 27,

        "description": "Recipient not available on channel."

      },

      "accepted": false,

      "to": "2784"

    }

  ],

  "error": null

}

 

Inbound message callback comparisons (handset to business)

  • The major difference between the legacy WhatsApp API and One API is that the One API callbacks are better structured and event-driven.
  • The customer callback receiver should ignore any inbound event message that is not known by their system and respond with an HTTP status code in the HTTP 200 range.
  • The customer can also consider sending a response message to the handset user stating that the business does not support the specific kind of message. This will improve the handset user’s experience with the business interaction.
  • Currently, event callbacks will only have a batch size of one (1), but this could change in the future. Ensure you cater for handling multiple events in a batch.
  • Any unknown parameters that are received in the request structure should be ignored and should not result in a failure on the customer’s system.
  • Clickatell reserves the right to add new events or parameters to an existing event at any time, but the main structure of the existing callbacks will always remain constant and backward-compatible.
  • The events in callbacks may be out of sequence. Look at the timestamp parameters to determine the order.
  • Timestamp parameters are populated in millisecond UNIX timestamps.
  • For more information, read the online documentation (link below).

 

Online One API developer documentation

 

Plain text

Notes

  • On the One API callback, the inbound plain text message is identified by the ‘moText‘ event.
  • Unlike the legacy WhatsApp callback structure, the One API structure only contains parameters that are relevant to a plain text message.
  • Channel-specific information for WhatsApp will be populated in the ‘whatsapp‘ object. This structure currently only contains the handset user’s profile name as they configured it on their handset WhatsApp client.
Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted)

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "content": "Inbound Test Message",

  "messageId": "eeffc384e008469983ffbdfc9f958a81",

  "relatedMessageId": null,

  "from": "2799900001",

  "profileName": "Profile Name",

  "timestamp": 1612528111000,

  "clientMessageId": null,

  "profileName": "Profile name as display on handset users WhatsApp Client",

  "caption": null,

  "contentType": null,

  "locationAddress": null,

  "latitude": null,

  "longitude": null,

  "locationName": null,

  "encryptionKey": null,

  "sha256Hash": null

}

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

    "integrationId": "Intergration-Id",

    "integrationName": "Integration-Name",

    "event": {

        "moText": [

            {

                "channel": "whatsapp",

                "messageId": "3a89680503414383af44dcd0e4e5f184",

                "relatedMessageId": "d33eef0838a121f71069a4cc8d55c19e",

                "relatedClientMessageId": "d33eef0838a121f71069a4cc8d55c19e",

                "from": "2799900001",

                "to": "2799900002",

                "timestamp": 1506607698000,

                "encryptionKey": null,

                "whatsapp": {

                    "profileName": "Profile Name"

                },

                "charset": null,

                "content": "Text Content of the reply message",

                "sms": {

                    "udh": null,

                    "network": null

                }

            }

        ]

    }

}

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "event": {

    "moText": [

      {

        "channel": "whatsapp",

        "messageId": "3a89680503414383af44dcd0e4e5f184",

        "relatedMessageId": "d33eef0838a121f71069a4cc8d55c19e",

        "relatedClientMessageId": "d33eef0838a121f71069a4cc8d55c19e",

        "from": "2799900001",

        "to": "2799900002",

        "timestamp": 1506607698000,

        "content": "Yw6Aw8OOeR1ZDBmftbnv43BbO06i/0yY82ggXzQSfRs=",

        "charset": null,

        "encryptionKey": "AQIDAHhzsfkhPWd+TpfJbCQQRvImlshkDJ4GF29TGs/t+Ru0PQE9mTga6Wq87xqZMV26ZWvYAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMwfcMOEVIgMWXao6LAgEQgDusCKy/o6SJhsmFofXh80Jl1ATNf/b9r8+7IdqdchTguUfPxUIcIXikDANw9/K9moC6rsh1vvHtGznOjw==",

        "whatsapp": {

          "profileName": "Bau+4w8c8PP61KE5DIqn0loAeP0iw5r7aEHvhQd/8Nw="

        },

        "sms": {

          "udh": null,

          "network": null

        }

      }

    ]

  }

}

Media by reference

Notes

  • On the One API callback the inbound inline media message is identified by the ‘moMedia’event

  • The ‘files‘ parameter contains an array of objects. Currently, the array will only contain one (1) object, but you need to cater for handling multiple objects as Clickatell can start sending multiple objects in the ‘files‘ array at any time.

  • The ‘contentType‘ parameter contains the content type of media data.

  • The ‘downloadUrl‘ parameter contains the URL that must be used to download the file from the Clickatell server (see the ‘Media Download’ section).

  • The ‘caption‘ parameter contains the caption that was sent with the media file. This parameter is null if no caption was sent.

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted)
Not supported

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "event": {

    "moMedia": [

      {

        "channel": "whatsapp",

        "messageId": "7ed16cedd7ca7c4d252c7ec854dec3cb",

        "relatedMessageId": "8f287d93f5e5c5fd3ba228fef124c975",

        "relatedClientMessageId": null,

        "from": "2799900001",

        "to": "2799900002",

        "timestamp": 1506607698000,

        "encryptionKey": null,

        "caption": "caption text here",

        "charset": null,

        "files": [

          {

            "contentType": "image/jpeg",

            "downloadUrl": "https://platform.clickatell.com/v1/media?fileId=UUID-1.xxx&sha256Hash=529fd5482f43db39992a894bbe4216f51a4d724131a97b93cc5589433b545820&source=client",

            "sha256Hash": "529fd5482f43db39992a894bbe4216f51a4d724131a97b93cc5589433b545820",

            "byteSize": 12345,

            "fileName": "myImage.jpeg"

          }

        ],

        "whatsapp": {

          "profileName": "Profile Name"

        }

      }

    ]

  }

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "event": {

    "moMedia": [

      {

        "channel": "whatsapp",

        "messageId": "7ed16cedd7ca7c4d252c7ec854dec3cb",

        "relatedMessageId": "8f287d93f5e5c5fd3ba228fef124c975",

        "relatedClientMessageId": null,

        "from": "2799900001",

        "to": "2799900002",

        "timestamp": 1506607698000,

        "encryptionKey": "AQIDAHhzsfkhPWd+TpfJbCQQRvImlshkDJ4GF29TGs/t+Ru0PQE9mTga6Wq87xqZMV26ZWvYAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMwfcMOEVIgMWXao6LAgEQgDusCKy/o6SJhsmFofXh80Jl1ATNf/b9r8+7IdqdchTguUfPxUIcIXikDANw9/K9moC6rsh1vvHtGznOjw==",

        "caption": "ixcQHE3KpJUv4QnX4PFGkPGetB+NB+9RG4CUUOVU2VcvTEHkxSZxa++s5a9nZjXk",

        "charset": null,

        "files": [

          {

            "contentType": "image/jpeg",

            "downloadUrl": "https://platform.clickatell.com/v1/media?fileId=UUID-1.xxx&sha256Hash=529fd5482f43db39992a894bbe4216f51a4d724131a97b93cc5589433b545820&source=client",

            "sha256Hash": "529fd5482f43db39992a894bbe4216f51a4d724131a97b93cc5589433b545820",

            "byteSize": 12345,

            "fileName": "myImage.jpeg"

          }

        ],

        "whatsapp": {

          "profileName": "UaScgqep3ZEqohhTnm8/GwR4r6GCK3JLXmdT/S+Iczc="

        }

      }

    ]

  }

}

 

Media download

Notes

  • Use an HTTP GET command to download the file.

  • The URL for downloading the file is available in the ‘downloadUrl‘ parameter as per the ‘Media by reference’ section.

  • The response body that is received contains raw binary data and is not base64 encoded.

  • The content type of the file will also be returned in the HTTP ‘Content-Type‘ header.

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted)
Not supported

Request

Request

GET [downloadUrl-as-per-media-by-reference-callback]

HTTP Headers:

Authorization: [Customer-OneAPI-key]

GET [downloadUrl-as-per-media-by-reference-callback]

HTTP Headers:

Authorization: [Customer-OneAPI-key]

Response

Response

HTTP Headers:

 

Content-Length: content-size

Content-Type: appropriate content type (example image/jpeg)

 

HTTP Status Code: 200 OK

Response body: Raw binary file data

HTTP Headers:

 

Content-Length: content-size

Content-Type: appropriate content type (example image/jpeg)

 

HTTP Status Code: 200 OK

Response body: Encrypted raw binary file data

 

Download Curl Example

Download Curl Example 

 

curl -X GET -H "Authorization: [Customer-OneAPI-key]" -s \

"https://platform.clickatell.com/v1/media?fileId=UUID-1.xxx&sha256Hash=529fd5482f43db39992a894bbe4216f51a4d724131a97b93cc5589433b545820&source=client" > UUID-1.xxx

curl -X GET -H "Authorization: [Customer-OneAPI-key]" -s \

"https://platform.clickatell.com/v1/media?fileId=UUID-1.xxx&sha256Hash=0ed2d727e79a6563569e7a5fc766cb88d677dfda7e42364596b3aff587a85572&source=client" > encrypted_UUID-1.xxx

**********

** NOTE **

**********

The encrypted_UUID-1.xxx file needs to then be decrypted by using the encryptionKey as received in the moMedia event callback.

Location

Notes

  • On the One API callback the inbound location message is identified by the ‘moLocation’

    • ‘latitude’ and ‘longitude’ parameters are mandatory

    • ‘locationAddress’ and ‘locationName’ parameters are optional and may contain a null

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted)

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "content": null,

  "messageId": "41901410e87d4203bc97af1d0e096bcb",

  "relatedMessageId": null,

  "from": "2799900001",

  "timestamp": 1612761211000,

  "clientMessageId": null,

  "profileName": "Profile Name",

  "caption": null,

  "contentType": null,

  "locationAddress": "100 Edward Street, Bellville, Bellville, Western Cape 7530",

  "latitude": "37.536033630371094",

  "longitude": "-122.25885772705078",

  "locationName": "Clickatell",

  "encryptionKey": null,

  "sha256Hash": null

}

 

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

    "integrationId": "Intergration-Id",

    "integrationName": "Intergration-Name",

    "event": {

        "moLocation": [

            {

                "channel": "whatsapp",

                "messageId": "f4915e8edf965566246c995c8703120d",

                "relatedMessageId": "null",

                "relatedClientMessageId": "null",

                "from": "2799900001",

                "to": "2799900002",

                "timestamp": 1506607698000,

                "encryptionKey": null,

                "whatsapp": {

                    "profileName": "Profile Name"

                },

                "charset": null,

                "locationAddress": "100 Edward Street, Bellville, Bellville, Western Cape 7530",

                "locationName": "Clickatell",

                "latitute": "37.536033630371094",

                "longitude": "-122.25885772705078"

            }

        ]

    }

}

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "ff808081778344ef0177a4fe0a614984",

  "integrationName": "Renier Test One",

  "event": {

    "moLocation": [

      {

        "channel": "whatsapp",

        "messageId": "239781173af046f4b6494044ac0c9da4",

        "relatedMessageId": null,

        "relatedClientMessageId": null,

        "from": "2799900001",

        "to": "2799900002",

        "timestamp": 1613475205000,

        "encryptionKey": "AQIDAHhzsfkhPWd+TpfJbCQQRvImlshkDJ4GF29TGs/t+Ru0PQFtFUO3uLltarIa4oeF7kHIAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMTlqam4jSJTK9N6hSAgEQgDs7126uLF2tnVGg+iS3Jj6SmNjshk2wdlW9vRKUVgLMwcsy3I+ddVvVFDaYfdCDoTdjqzPZarw/YAKCpA==",

        "whatsapp": {

          "profileName": "ML9bn0/Jp0zWzpIz4RNA/wgN+mans5xuCMCwpnF65Ek="

        },

        "charset": null,

        "locationAddress": "X+oWIs8sljXLaEpAcvHo9oib//Xj8ZtHA3GnOUntEWFnsiDztBrvFwOinDgVwoyJz5gzKoj5CyuxDBY6FMxpSg==",

        "locationName": "kS1c/H+4078GjA3mKqJVjws0X7disAlaTDXNdnUKWegj9BnyO8rueTWK904ob/w6",

        "latitude": "EIjVCAvWe4NomAlZmTAT9u3N4TZZZ+XecNcVcd5ZjyU=",

        "longitude": "AQy3ZgI66RGgm5JezQi0vCTQrJO17QCYt79xj82S3F4="

      }

    ]

  }

}

 

Contacts

Notes

  • On the One API callback, the inbound contacts message is identified by the ‘moContacts’

  • The ‘moContacts‘ array may contain one (1) or many contacts. The handset user can send the business more than one (1) contact which will result in a single callback with multiple contacts in the array.

  • The ‘name‘ parameter is a mandatory object and it will always be accompanied by at least one (1) other parameter.

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted)

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "content": null,

  "messageId": "d773e69ceec74703a513848eec35ffb0",

  "relatedMessageId": null,

  "from": "2799900001",

  "timestamp": 1612761114000,

  "clientMessageId": null,

  "profileName": "Profile Name",

  "caption": null,

  "contentType": null,

  "locationAddress": null,

  "latitude": null,

  "longitude": null,

  "locationName": null,

  "sha256Hash": null,

  "encryptionKey": null,

  "contacts": [

    {

      "addresses": [

        {

          "city": "Johannesburg",

          "country": "SA",

          "countryCode": "10",

          "state": "state",

          "street": "street",

          "type": "personal",

          "zip": "1010"

        }

      ],

      "birthday": "01.01.1980",

      "emails": [

        {

          "email": "test@test.com",

          "type": "personal"

        }

      ],

      "name": {

        "firstName": "First Name",

        "formattedName": "Formatted Name",

        "lastName": "Last Name"

      },

      "org": {

        "company": "Clickatell"

      },

      "phones": [

        {

          "phone": "2799900001",

          "type": "personal"

        },

        {

          "phone": "2799900002",

          "type": "personal",

          "waId": "waId"

        }

      ],

      "urls": [

        {

          "url": "https://clickatelllabs.com",

          "type": "personal"

        }

      ]

    }

  ]

}

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

    "integrationId": "Intergration-Id",

    "integrationName": "Integration-Name",

    "event": {

        "moContacts": [

            {

                "channel": "whatsapp",

                "messageId": "f4915e8edf965566246c995c8703120d",

                "relatedMessageId": null,

                "relatedClientMessageId": null,

                "from": "2799900001",

                "to": "2799900002",

                "timestamp": 1506607698000,

                "encryptionKey": null,

                 "whatsapp": {

                    "profileName": "Profile Name"

                }

                "contacts": [

                    {

                        "addresses": [

                            {

                                "city": "Johannesburg",

                                "country": "SA",

                                "countryCode": "10",

                                "state": "state",

                                "street": "street",

                                "type": "personal",

                                "zip": "1010"

                            }

                        ],

                        "birthday": "1980-01-31",

                        "emails": [

                            {

                                "email": "test@test.com",

                                "type": "personal"

                            }

                        ],

                        "name": {

                            "firstName": "First Name",

                            "formattedName": "Formatted Name",

                            "lastName": "Last Name"

                        },

                        "org": {

                            "company": "Clickatell"

                        },

                        "phones": [

                            {

                                "phone": "2799900001",

                                "type": "personal"

                            },

                            {

                                "phone": "2799900002",

                                "type": "personal",

                                "waId": "waId"

                            }

                        ],

                        "urls": [

                            {

                                "url": "https://clickatelllabs.com",

                                "type": "personal"

                            }

                        ]

                    }

                ],

                "charset": null,

            }

        ]

    }

}

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "event": {

    "moContacts": [

      {

        "channel": "whatsapp",

        "messageId": "f4915e8edf965566246c995c8703120d",

        "relatedMessageId": null,

        "relatedClientMessageId": null,

        "from": "2799900001",

        "to": "2799900002",

        "timestamp": 1506607698000,

        "charset": null,

        "encryptionKey": "AQIDAHhzsfkhPWd+TpfJbCQQRvImlshkDJ4GF29TGs/t+Ru0PQFtFUO3uLltarIa4oeF7kHIAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMTlqam4jSJTK9N6hSAgEQgDs7126uLF2tnVGg+iS3Jj6SmNjshk2wdlW9vRKUVgLMwcsy3I+ddVvVFDaYfdCDoTdjqzPZarw/YAKCpA==",

        "contacts": [

          {

            "addresses": [

              {

                "city": "tSZZm/i4mxT6zgDxTKPv9xU/sHfqy2l5JY9nmLwdfcA=",

                "country": "b9PUrAea+Twtf/iJIyfiqAfMpOUgbGxlHI0+/cvDXS4=",

                "countryCode": "lKZncmZw5BPE2B/I4lydK/bFr7JUj+01gBr4cbnZ5Hk=",

                "state": "uqeWydKdHg8yFuksG9Gre8UH41J9rnMrrZcqnLxAMh0=",

                "street": "gl5Y4+emGFB24S2IgLXOB0NX3Peajwpd5dmKdUd7Iv0=",

                "type": "WcilwsPeLfhz6tNubRy0LgLb0zsg/YgzU0cU7SSbaXk=",

                "zip": "lKZncmZw5BPE2B/I4lydK/bFr7JUj+01gBr4cbnZ5Hk="

              }

            ],

            "birthday": "Ldqt6QPDoUj/HWzVvvtKsWQmERKDt0x+P9DUzGb8HcM=",

            "emails": [

              {

                "email": "o5yNsGLxjTqqwmzDS5X5Ss/keyLr5rXpbsD8IdslfvF83kFPIw8yfzG8+nMK1Nnd",

                "type": "WcilwsPeLfhz6tNubRy0LgLb0zsg/YgzU0cU7SSbaXk="

              }

            ],

            "name": {

              "firstName": "U8SRBv+819LeG4wbN8A31h1ueIRSmvGbv+TIUUKGZVw=",

              "formattedName": "m6uFupD5EgafDx9pDZE9mmU9SWqLOPgnloic07aft+w=",

              "lastName": "99dYqs9s1Svsotal4eRWAyGh2BLEhqIIJ5u2j+Cyw/8="

            },

            "org": {

              "company": "F9Uy/9ugAZC4/YIUQeOVngDSHeZPBXLC/fIodq6m2gFi1x3ky8Xe/0m8rRlLcvHy"

            },

            "phones": [

              {

                "phone": "Hmka2xi95gu8Lpx3DtxvDDZvW5cE8sebt0x/HSGPBDc=",

                "type": "rs83IcBJFcMVZ6hhgDkebQSXmRck2QuxYsroYQFtQh0="

              },

              {

                "phone": "j6zcct8mQzrBLOWQefsXMJvaivcYE6ydQKRfkjIlHFI=",

                "type": "9IlVeDtL6ApURFb/7dr422qqBAK1yOb8Qkd8+hfGous=",

                "waId": "HrH3yO0I34znlQQOb/FlIUiq0GGLdbunQxAt8L+iSek="

              }

            ],

            "urls": [

              {

                "url": "nSXH2dokRn/aOZi5CJdl6mDwSlCTOYvYeN4U6t+Wov1Pm+9Z8v99T97ymvgFAG4z",

                "type": "lf+imiduMGMbL+RkW+dcSq1BlYn/vEh/Hr5krYwQF4o="

              }

            ]

          }

        ],

        "whatsapp": {

          "profileName": "WtAFnNNVydCuDTMNjaBXN2zCUqtT/txreGXwMQw4onk="

        }

      }

    ]

  }

}

Suggested response

Notes

  • On the One API callback the inbound suggested response message is identified by the ‘moSuggestedResponse’

  • On this type of message the ‘relatedMessageId‘ will always be populated, as the response is based on an outbound message that was sent to a handset user.

  • The ‘content‘ parameter will contain the button text that was selected. This is static text defined at the time of creating the template.

  • The ‘postbackData‘ parameter will contain the postbackData associated with the button. The postbackData is supplied by the business in the template send message

Legacy WhatsApp API One API request (unencrypted) One API request (client-side encrypted)
Not supported

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "event": {

    "moSuggestedResponse": [

      {

        "channel": "whatsapp",

        "messageId": "3a89680503414383af44dcd0e4e5f184",

        "relatedMessageId": "d33eef0838a121f71069a4cc8d55c19e",

        "relatedClientMessageId": "Customer-Message-Id",

        "from": "2799900001",

        "to": "2799900002",

        "timestamp": 1506607698000,

        "encryptionKey": null,

        "content": "Button text",

        "postbackData": "Custom Data As Defined In Outbound Message",

        "charset": null,

        "whatsapp": {

          "profileName": "Profile Name"

        }

      }

    ]

  }

}

HTTP POST [Client-Message-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "event": {

    "moSuggestedResponse": [

      {

        "channel": "whatsapp",

        "messageId": "3a89680503414383af44dcd0e4e5f184",

        "relatedMessageId": "d33eef0838a121f71069a4cc8d55c19e",

        "relatedClientMessageId": "Customer-Message-Id",

        "from": "2799900001",

        "to": "2799900002",

        "timestamp": 1506607698000,

        "encryptionKey": "AQIDAHhzsfkhPWd+TpfJbCQQRvImlshkDJ4GF29TGs/t+Ru0PQFtFUO3uLltarIa4oeF7kHIAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMTlqam4jSJTK9N6hSAgEQgDs7126uLF2tnVGg+iS3Jj6SmNjshk2wdlW9vRKUVgLMwcsy3I+ddVvVFDaYfdCDoTdjqzPZarw/YAKCpA==",

        "content": "xdANpGuE2zdlJVgROXEc0PAAgHeU4U8HqKTxk8syZGEMNbV3OJ2LYCVTwFAF+e2Z",

        "postbackData": "sAAxOLIXZx+/W0kSRdih/a2x8VVapi0sAz05iPqbGHv558AfpgE8tmmBel6okjSBcL5ihrqqxY569URP5aTz6w==",

        "charset": null,

        "whatsapp": {

          "profileName": "TC3Io/2GckCIu4ttxcIHwlmW/mjViboL706DJyAYvj4="

        }

      }

    ]

  }

}

 

Inbound message status callback comparison

 

Status callback

Notes

  • On the One API callback the inbound status update message is identified by the ‘messageStatusUpdate’ event.
  • Message status codes for One API is different from that of the legacy WhatsApp API. Please refer to the ‘Status code comparison’ section to see a full list of One API status codes and their mapping to legacy WhatsApp status codes.
  • Your system should always respond back with an HTTP status code in the 200 range.

Online One API developer documentation

Legacy WhatsApp API One API 

HTTP POST [Client-Status-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "timestamp": 1506607698860,

  "statusCode": 4,

  "status": "RECEIVED_BY_RECIPIENT",

  "messageId": "3a89680503414383af44dcd0e4e5f184",

  "clientMessageId": "2993b6b548000a80989a20549e7558a5"

HTTP POST [Client-Status-Callback-Url]

HTTP Headers:

Content-Type: application/json

Request JSON body:

{

  "integrationId": "Intergration-Id",

  "integrationName": "Integration-Name",

  "event": {

    "messageStatusUpdate": [

      {

        "channel": "whatsapp/sms ",

        "timestamp": 1506607698860,

        "statusCode": 5,

        "status": "DEVICE_ACK",

        "messageId": "3a89680503414383af44dcd0e4e5f184",

        "clientMessageId": "2993b6b548000a80989a20549e7558a5"

      }

    ]

  }

}

 

 

Status code comparison

  • One API status codes can be found in the Clickatell online documentation at https://docs.clickatell.com/channels/one-api/one-api-message-status-table/
  • Status codes are returned to the business via a status callback. This customer callback URL is configured on the One API integration.
  • If any status code not listed in the One API status code list below is received, that status code should be interpreted as a failure status by the customer system.

 

Legacy WhatsApp Status Codes One API Status Codes
Status Code Status Status Details

Map to One API Status Code/s

Map to Legacy WhatsApp Status Code/s Status Code Status Status Details

1

UNKOWN

Unknown status

1

1

1

UNKOWN

Message not found

2

QUEUED

Message is queued for delivery

2

2, 1001, 1002

2

QUEUED

Queued

3

DELIVERED_TO_GATEWAY

Message has been submitted to WhatsApp server (one checkmark on handset)

4

— N/A —

3

SCHEDULED

Scheduled for later delivery

4

RECEIVED_BY_RECIPIENT

Message delivered to recipient (two checkmarks)

5

3

4

SENT_TO_SUPPLIER

Sent to supplier

 

 

 

 

4

5

DEVICE_ACK

Device acknowledged delivery

 

 

 

 

27

6

READ

Read receipt

7

FAILED

Message failed to send

—multiple—

 

 

 

 

9

UNDELIVERED

Message expired before it could be delivered to the business WhatsApp client application

 

20

 

 

 

 

10

WHATSAPP_DELIVERY_FAILED

WhatsApp accepted the message, but could not deliver the message

 

—multiple—

 

 

 

 

11

FAILED

Message failed to send

 

—multiple—

 

 

 

 

12

UNKNOWN_USER

The MSISDN is not on the WhatsApp network

28

 

 

 

 

14

REENGAGEMENT_REQUIRED

Non-Message Template message sent more than 24 hours after the customer last messaged the business

131

 

 

 

 

15

SPAM_RATE_LIMIT

Message blocked due to spam rate limit being hit on the WhatsApp server

132

 

 

 

 

16

WHATSAPP_SERVER_THROTTLING

Message throttled by the WhatsApp server

133

 

 

 

 

 

 

 

 

Generic errors (shared by all channels)

 

 

 

 

2001, 9

20

EXPIRED

Message has expired

 

 

 

 

—NEW—

21

STOPPED_BY_USER

Message stopped by user

 

 

 

 

—NEW—

22

STOPPED_BY_ADMIN

Message stopped by admin

 

 

 

 

— multiple —

23

DELIVERY_FAILURE

Error delivering message

 

 

 

 

1006

24

EMULATED

Emulated

 

 

 

 

 

25

INSUFFICIENT_ACCOUNT_BALANCE

Insufficient account balance

 

 

 

 

 

26

VOLUME_LIMIT

Volume limit exceeded

27

READ

Message read by recipient (two blue checkmarks)

6

1005

27

VOLUME_LIMIT_DAILY

Daily volume limit exceeded

28

UNKNOWN_USER

The MSISDN is not on the WhatsApp network

29

1004

28

VOLUME_LIMIT_MONTHLY

Monthly volume limit exceeded

 

 

 

 

28

29

RECIPIENT_DOES_NOT_EXIST

Recipient does not exist on channel

30

ERROR_WITH_MESSAGE

Media not found

80

 

 

 

 

31

ERROR_WITH_MESSAGE

Media size error

81

 

 

 

 

32

ERROR_WITH_MESSAGE

Media checksum failure

82

 

 

 

 

33

ERROR_WITH_MESSAGE

The media file upload was rejected by the WhatsApp network

83

 

 

 

 

34

ERROR_WITH_MESSAGE

Metadata for the media file was not found or does not match the message request

84

 

 

 

 

40

ERROR_WITH_MESSAGE

Security access denied

60

 

 

 

 

41

ERROR_WITH_MESSAGE

Invalid content

61

 

 

 

 

50

HSM_NOT_AVAILABLE

The requested structure is not available

134-138

 

 

 

 

 

 

 

 

40

60

ENCRYPTION_ACCESS_DENIED

Security access denied

 

 

 

 

41

61

ENCRYPTION_CONTENT_ERROR

Content decryption failed

 

 

 

 

30

80

MEDIA_NOT_FOUND

Media not found

 

 

 

 

31

81

MEDIA_SIZE_ERROR

Media size error

 

 

 

 

32

82

MEDIA_CHECKSUM_FAILURE

Media checksum failure

 

 

 

 

33

83

MEDIA_REJECTED_BY_SUPPLIER

Channel supplier rejected media file

 

 

 

 

34

84

MEDIA_METADATA_ERROR

Metadata for the media file was not found or does not match the message request

 

 

 

 

—NEW—

85

MEDIA_ACCESS_ERROR

An access/permissions-related error occurred when handling the media file

 

 

 

 

WhatsApp-related

 

 

 

 

—NEW—

130

WHATSAPP_ACCOUNT_PAYMENT_ISSUE

WhatsApp account payment issue

 

 

 

 

14

131

WHATSAPP_RE_ENGAGEMENT_REQUIRED

Re-engagement required

 

 

 

 

15

132

WHATSAPP_SPAM_RATE_LIMIT_REACHED

Spam rate limit reached

 

 

 

 

16

133

WHATSAPP_SERVER_RATE_LIMIT

WhatsApp server rate limit

 

 

 

 

50

134

WHATSAPP_HSM_NOT_AVAILABLE

WhatsApp HSM request structure not available

 

 

 

 

50

135

WHATSAPP_HSM_PARAM_COUNT_MISMATCH

 

 

 

 

 

50

136

WHATSAPP_HSM_IS_MISSING

 

 

 

 

 

50

137

WHATSAPP_HSM_DOWNLOAD_FAILED

 

 

 

 

 

50

138

WHATSAPP_HSM_PACK_IS_MISSING

 

 

 

 

 

—NEW—

139

WHATSAPP_EXPERIMENTAL_NUMBER

Non-delivery due to WhatsApp experimental number feature

 

 

 

 

—NEW—

140

WHATSAPP_TEMPLATE_TEXT_TOO_LONG

Length of the parameters and the template text exceeds the maximum allowed length

 

 

 

 

—NEW—

141

WHATSAPP_TEMPLATE_FORMAT_MISMATCH

Specified template header format not in the expected format

 

 

 

 

—NEW—

142

WHATSAPP_TEMPLATE_FORMATTING_POLICY_VIOLATED

Template header parameter formatting not allowed (bold, italics, etc.)

 

 

 

 

—NEW—

143

WHATSAPP_TEMPLATE_MEDIA_FORMAT_UNSUPPORTED

Correct media type used in template, but mime type is unsupported

 

 

 

 

—NEW—

144

WHATSAPP_PARAMETER_MISSING

Required parameter is missing for this message

 

 

 

 

—NEW—

145

WHATSAPP_PARAMETER_INVALID

A message parameter contains an invalid value

 

 

 

 

—NEW—

146

WHATSAPP_PARAMETER_NOT_REQUIRED

A parameter was specified for the message that is not required

 

 

 

 

—NEW—

147

WHATSAPP_TEMPLATE_INVALID_URL

Invalid hydrated URL received in template message

 

 

 

 

—NEW—

148

WHATSAPP_TEMPLATE_INVALID_PHONE_NUMBER

Phone number in template message is missing

 

 

 

 

—NEW—

149

WHATSAPP_TEMPLATE_RECEIVER_NO_BUTTON_SUPPORT

End-user device does not support buttons

1001

QUEUED

Message accepted by MC2

2

 

 

 

 

1002

QUEUED

Message accepted by MC2

2

 

 

 

 

1004

VOLUME_LIMIT_EXCEED

Monthly sandbox quota exceeded

28

 

 

 

 

1005

VOLUME_LIMIT_EXCEED

Daily sandbox quota exceeded

27

 

 

 

 

1006

EMULATED

EMULATED

24

 

 

 

 

2000

MEDIA_FILE_UPLOAD_FAILED

Upload of media file has failed

—multiple—

 

 

 

 

2001

MEDIA_FILE_UPLOAD_EXPIRED

Upload of media file has expired

20

 

 

 

 

 

Error code comparison

  • One API will return an HTTP 207 status code if there are multiple statuses in the response.
    • This indicates that messages in the ‘messages’ object could have different status codes, some of which could be successfully accepted and some of which could be rejected.

 

Legacy WhatsApp Example Error Response

One API Example Error Response

Global level error example

Global level error example

HTTP 401

{

    "messages": [],

    "error": {

       "errorCode": 1,

       "error": "Invalid or missing Integration API Key."

    }

}

HTTP 400

{

    "error":  {

       "code": 21,

       "description": "Payload data is malformed."

    }

}

 

Message level error example

Message level error example

HTTP 202

{   

    "messages": [

        {

            "messageId": null,

            "accepted": false,

            "to": "27123",

            "error": {

                "errorCode": 158,

                "error": "Invalid destination address."

            },

            "clientMessageId": n.ull

        }

    ]

}

 

HTTP 400

{

    "messages": [

       {

           "error": {

               "code": 23,

              "description": "Invalid or missing parameter: to ."

           },

           "accepted": false,

           "to": "278"

       }

    ],

    "error": null

}

 

 

Legacy WhatsApp Error Codes One API Error Codes

Error Code

HTTP Status Code

Error Message

Global Level

Message Level

Map to One API Error Code(s)

Map to Legacy WhatsApp Error Code(s)

Error Code

HTTP Status Code

Error Message

Global Level

Message Level

1

401

Invalid or missing Integration API Key

X

 

1

1

1

401

Invalid or missing integration API Key

X

 

2

202

Integration is not active

X

 

3

3

2

400

Account is not active

X

 

3

202

Account is not active

X

 

2

2

3

400

Integration is not active

X

 

7

401

IP lockdown violation

X

 

7

7

7

401

Originating IP address is not approved in your account

X

 

 

 

 

 

 

 

901

18

500

Internal error

X

X

 

 

 

 

 

 

900

19

503

Internal error, please retry

X

X

            Generic errors (shared by all channels)
           

301

20

402

Insufficient account balance

 

X

           

—NEW—

21

400

Payload data is malformed

X

 

           

153

22

400

Maximum messages per request payload exceeded

X

 

           

100, 102, 106, 151, 152, 158, 107, 111

23

400

Invalid or missing parameter: (parameter name)

 

X

 

 

 

 

 

 

101

24

400

Maximum message content size exceeded

 

X

 

 

 

 

 

 

150

25

400

Invalid recipient address: (MSISDN)

 

X

 

 

 

 

 

 

—NEW—

26

400

Recipient opted out

 

X

 

 

 

 

 

 

159

27

400

Recipient not available on channel

 

X

 

 

 

 

 

 

160

28

400

Recipient not available on sandbox

 

X

           

 

29

—Reserved—
           

103

30

400

Content type not supported

 

X

           

104

31

400

Media file size exceeds limit of xx MB

 

X

           

105

32

400

Media payload size exceeds limit of xx MB

 

X

           

—NEW—

33

400

Media item not found

 

X

           

 

34

—Reserved—

           

 

35

—Reserved—

           

 

36

—Reserved—
           

 

37

—Reserved—

 

 

 

 

 

 

—NEW—

38

400

Channel/feature is not active on integration

 

X

 

 

 

 

 

 

—NEW—

39

400

Channel is not available on integration

 

X

 

 

 

 

 

 

 

40

400

Character set is not supported: (charset)

 

X

 

 

 

 

 

 

161

41

400

Resource does not exist

X

 

 

 

 

 

 

 

—NEW—

42

400

HTTP method is not supported on this resource

X

 

 

 

 

 

 

 

—NEW—

43

400

Rate limit

X

X

 

 

 

 

 

 

—NEW—

44

400

FROM number is suspended

 

X

 

 

 

 

 

 

—NEW—

45

400

FROM number is not related to integration

 

X

 

 

 

 

 

 

—NEW—

46

400

Demo access has expired

 

X

100

202

Empty message content

 

X

23

 

 

 

 

 

 

101

202

Message content is too long

 

X

24

 

 

 

 

 

 

102

202

Empty receivers list

 

X

23

 

 

 

 

 

 

103

202

Content type for media file is not supported

 

X

30

 

 

 

 

 

 

104

202

WhatsApp media file is too big

 

X

31

 

 

 

 

 

 

105

202

Request contains media files more than 20Mb in total

X

 

32

 

 

 

 

 

 

106

202

HSM is incorrect

 

X

23

 

 

 

 

 

 

107

202

SHA256 hash missing for encrypted media message

 

X

23

 

 

 

 

 

 

108

202

You have exceeded the allowed amount of whitelisted numbers

 

X

—–

 

 

 

 

 

 

109

202

IP lockdown violation. Requests from %s is forbidden according to settings

X

 

7

 

 

 

 

 

 

110

202

Account exceeded daily quota

 

X

—–

 

 

 

 

 

 

111

202

Client message id too long

 

X

23

 

 

 

 

 

 

150

202

Invalid country code found for the input phone: %s

 

X

25

 

 

 

 

 

 

151

202

Too long input phone: %s

 

X

23

 

 

 

 

 

 

152

202

Too short input phone: %s

 

X

23

 

 

 

 

 

 

153

202

Too many MSISDNs

 

X

22

 

 

 

 

 

 

158

202

Invalid destination address

 

X

23

 

 

 

 

 

 

159

202

Number %s is not approved WhatsApp number

 

X

27

 

 

 

 

 

 

160

202

Sandbox number without WhatsApp

 

X

28

 

 

 

 

 

 

161

202

Resource does not exist

X

 

41

 

 

 

 

 

 

301

202

Not enough money

X

X

20

 

 

 

 

 

 

901

202

Internal error -please retry

X

X

19

 

 

 

 

 

 

900

202

Internal error

X

X

18

 

 

 

 

 

 

 

 

Did you find this information informative?

Other Resources

Ask the Community

Visit Stack Overflow to join our community of developers and find the answer you need

Contact Support

Contact our support team and one of our agents will be in touch with you to answer any questions you have