Comparison: Clickatell's first generation WhatsApp API vs new One API
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 |
|
|
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 textNotes
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 |
|
|
|
![]() |
Success response | Success response | ||
|
|
||
Plain text – with preview first URLNotes
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 |
|
|
|
![]() |
|
Success response |
Success response |
|
|
|
||
Inline mediaNotes
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 |
|
|
|
![]() |
|
Success response |
Success response |
|
|
|
||
Media file uploadNotes
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
|
Request detail |
Request detail |
Not applicable. No actual messages are sent to the handset when media files are uploaded to Clickatell’s server. |
|
|
||
Request Examples |
Request Examples |
||
|
|
||
Success Response |
Success Response |
||
|
|
||
Sending media by referenceNotes
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
|
|
|
![]() |
Success Response |
Success Response |
||
|
|
||
LocationNotes
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
|
|
|
![]() |
Success Response |
Success Response |
||
|
|
||
ContactsNotes
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
|
Minimal Contacts Info Example |
Minimal Contacts Info Example |
![]() |
|
|
||
Full Info Contact Example |
Full Info Contact Example |
||
|
|
||
Success Response |
Success Response |
||
|
|
||
HSM (legacy support)Notes
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 |
|
|
|
![]() |
|
Success Response |
Success Response |
|
|
|
||
TemplatesNotes
|
|||
Templates – Plain text (NO header parameter) Notes
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 |
|
|
![]() |
|
Success Response |
Success Response |
|
|
|
||
Templates – Plain text (WITH header parameter) Notes
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 |
|
|
![]() |
|
Success Response |
Success Response |
|
|
|
||
Template – media Notes
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
|
|
|
![]() |
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
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
|
|
|
![]() |
Success Response |
Success Response |
||
|
|
||
Template – Interactive text suggested response (WITH postbackData parameters) Notes
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
|
|
|
![]() |
Success Response |
Success Response |
||
|
|
||
Template – Interactive text action Notes
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 |
![]() |
|
|
||
Success Response |
Success Response |
||
|
|
||
Static URL |
Static URL |
||
|
|
||
|
Success Response |
Success Response |
|
|
|
||
Template – Interactive media suggested response (NO postbackData parameters) Notes
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
|
|
|
![]() |
Success Response |
Success Response |
||
|
|
||
Template – Interactive media suggested response (WITH postbackData parameters) Notes
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
|
|
|
![]() |
Success Response |
Success Response |
||
|
|
||
Templates – Plain text (WITH header parameter and no variable) Notes
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
|
|
|
![]() |
Success Response |
Success Response |
||
|
|
Outbound message request acceptance response (business-to-handset)
Note: For error codes see the Error Code Comparison section.
Legacy WhatsApp API |
One API |
|
|
1) Example with response with only successfully accepted messages
2) Example with response with mixed statuses
|
1) Example with response with only successfully accepted messages
2) Example with response with mixed statuses
|
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 textNotes
|
||
Legacy WhatsApp API | One API request (unencrypted) | One API request (client-side encrypted) |
|
|
|
Media by referenceNotes
|
||
Legacy WhatsApp API | One API request (unencrypted) | One API request (client-side encrypted) |
Not supported |
|
|
Media downloadNotes
|
||
Legacy WhatsApp API | One API request (unencrypted) | One API request (client-side encrypted) |
Not supported |
Request |
Request |
|
|
|
Response |
Response |
|
|
|
|
Download Curl Example |
Download Curl Example |
|
|
********** ** NOTE ** ********** The encrypted_UUID-1.xxx file needs to then be decrypted by using the encryptionKey as received in the moMedia event callback. |
|
LocationNotes
|
||
Legacy WhatsApp API | One API request (unencrypted) | One API request (client-side encrypted) |
|
|
|
ContactsNotes
|
||
Legacy WhatsApp API | One API request (unencrypted) | One API request (client-side encrypted) |
|
|
|
Suggested responseNotes
|
||
Legacy WhatsApp API | One API request (unencrypted) | One API request (client-side encrypted) |
Not supported |
|
|
Inbound message status callback comparison
Status callbackNotes
Online One API developer documentation |
|
Legacy WhatsApp API | One API |
|
|
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 |
|
|
Message level error example |
Message level error example |
|
|
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 |
|
|
|
|
|
|
Submit a Comment
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