Message API calls are sent to the /messages endpoint regardless of message type, but the content of the JSON message body differs for each type of message (text or templates). See the following documentation for information regarding the type of messages you want to send:
Parameter name |
Data type |
Description |
Possible values |
WOZTELL_ADMIN* |
String |
Email address for your Woztell account. |
|
WOZTELL_TOKEN* |
String |
Your Woztell account token. |
abc-defgh-ijk-123 |
WOZTELL_NUMBER |
String |
Woztell phone number validated by WhatsApp. If you don't send a number, the main WhatsApp number will be used |
"+1-631-555-1002", "16315551002", "001(631)555-1002"or "1 631 555 1002" |
DATA |
JSON |
See the following documentation in the Data Parameters section. |
|
POST https://webservice.woztell.com/webhook/messages
{
"WOZTELL_ADMIN":"your-woztell-admin-email",
"WOZTELL_TOKEN":"your-woztell-token",
"DATA":
{
"TO":"whatsapp-number",
"MESSAGE":"your-message-text",
"USER":"issuer-name"
} }
DATA parameters:
Parameter name |
Data type |
Description |
Possible Values |
TO* |
String |
Contact phone number. The numbers can be in any standard telephone number format. For more information, see the Phone Number Formats section. The recommended format for contact phone numbers is starting with a plus sign (+) and the country code. |
"+1-631-555-1002", "16315551002", "001(631)555-1002"or "1 631 555 1002" |
MESSAGE* |
String |
Text of the text message, which may contain URLs and format. See the sections Send URLs in text messages and Apply formatting in text messages for more information. A text message can have a maximum length of 4096 characters. |
Hi!, Now you can visit *Woztell* web page: https://woztell.com/ |
USER* |
String |
Identifying name of the bot, webhook, custom function or person sending the message. This name will only be visible on the Zoho Cliq channel. |
John Woztell, Webhook #123#, Custom function |
INSERT
|
Boolean
|
Insert message in Zoho Cliq. Default value: true
|
true or false
|
MARK_AS_READ
|
Boolean
|
All user messages on Zoho channel will be marked as read once this message is sent. IMPORTANT: If there was a message on this channel pending to be read, it will be marked as read. Default value: false |
true or false
|
*Parameter is required
You can use the messages endpoint to send message templates to your customers. You can use /w -list in WhatsApp channel to show your verified templates. If you have no verified templates or you need more, follow the instruction in this article to create templates.
POST https://webservice.woztell.com/webhook/messages
{
"WOZTELL_ADMIN":"your-woztell-admin-email",
"WOZTELL_TOKEN":"your-woztell-token",
"DATA":
{
"TO":"whatsapp-number",
"TEMPLATE":"your-template-code",
"PARAMETER 1":"your-parameter-1-value",
...
"PARAMETER 10":"your-parameter-10-value"
"USER":"issuer-name"
} }
DATA parameters:
Parameter name |
Data type |
Description |
Possible Values |
TO* |
String |
Contact phone number. The numbers can be in any standard telephone number format. For more information, see the Phone Number Formats section. The recommended format for contact phone numbers is starting with a plus sign (+) and the country code. |
"+1-631-555-1002", "16315551002", "001(631)555-1002"or "1 631 555 1002" |
TEMPLATE* |
String |
Code of the templates. The correct format for template code is starting with a pound sign (#) and the template code. |
#welcome, #call, #54, #bye, ... |
PARAMETER 1 |
String |
1st template parameter. |
For the template "You made a purchase for {{1}} using a credit card ending in {{2}}", PARAMETER 1 is the value for {{1}} and PARAMETER 2 is the value for {{2}} |
PARAMETER 2 |
String |
2nd template parameter. |
|
PARAMETER 3 |
String |
3rd template parameter. |
|
PARAMETER 4 |
String |
4th template parameter. |
|
PARAMETER 5 |
String |
5th template parameter. |
|
PARAMETER 6 |
String |
6th template parameter. |
|
PARAMETER 7 |
String |
7th template parameter. |
|
PARAMETER 8 |
String |
8th template parameter. |
|
PARAMETER 9 |
String |
9th template parameter. |
|
PARAMETER 10 |
String |
10th template parameter. |
|
USER* |
String |
Identifying name of the bot, webhook, custom function or person sending the message. This name will only be visible on the Zoho Cliq channel. |
John Woztell, Webhook #123#, Custom function |
INSERT
|
Boolean
|
Insert message in Zoho Cliq. Default value: true
|
true or false
|
*Parameter is required.
The phone number in the request can be in any WhatsApp format.
Phone number |
Translated phone number |
"+1-631-555-1002" |
"+16315551002" |
"6315551002" |
"+6315551002" (invalid) |
"1-631-555-1002" |
"+16315551002" |
001 (516) 283-7151" |
"+15162837151" |
"+54 9 11 5612-1008" |
"+5491156121008" |
By default, the WhatsApp mobile application recognizes URLs and makes them interactive. To include a preview of the URL, make sure the URL starts with http:// or https://. A hostname is also required since the IP addresses do not match.
Most of the time, when you send a URL, with or without a preview, the recipient of the message will see a URL that you can click on.
WhatsApp allows you to apply some formatting options to messages. To format a message, or part of it, use the following formatting symbols:
Format |
Symbol |
Example |
Bold font |
Asterisk (*) |
Your total is * 10.50 USD *. |
Italics |
Undersore (_) |
Welcome to _WhatsApp_! |
Strikethough |
Tilde of the ñ (~) |
This is ~ better ~ the best! |
Code |
Three serious accents (``) |
`` print 'Hello world'; '' |
See the following document for more information about the following types of error and status messages:
STATUS |
DESCRIPTION |
ERROR |
METHOD NOT ALLOWED |
ERROR |
INVALID AUTHORIZATION |
ERROR |
INVALID JSON DATA |
ERROR |
NO WHATSAPP ACTIVED |
ERROR |
Other error details |
{
"STATUS":"ERROR",
"DESCRIPTION":"INVALID JSON DATA" }
STATUS |
IDMESSAGE |
SUCESS |
WhatsApp ID Message |
{
"STATUS":"SUCCESS",
"IDMESSAGE":"whatsapp-message-id",
"DESCRIPTION":"" }
When a message is sent in a request, the customer will receive a message such as this:
POST https://webservice.woztell.com/webhook/messages
{
"WOZTELL_ADMIN":"admin@woztell.com",
"WOZTELL_TOKEN":"123-45678-90abcdefg-hij-klmn",
"DATA":
{
"TO":"00123456789",
"MESSAGE":"Hello World!",
"USER":"John Woztell"
} }
You can use this PHP to send WhatsApp messages using your Woztell account:
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://webservice.woztell.com/webhook/messages',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>
array(
'WOZTELL_ADMIN' => 'admin@woztell.com',
'WOZTELL_TOKEN' => '123-45678-90abcdefg-hij-klmn',
'DATA' => '{
"TO":"00123456789",
"MESSAGE":"Hello world!",
"USER":"John Woztell"
}'
),
));
$response = curl_exec($curl);
curl_close($curl); echo $response;
Cut-off control prevents messages from being delivered to users out of certain conditions. Here's a summary of the requirements: