ZOHO webhook to send whatsapp message

Webservices to send text messages

Scenario

There are many scenarios where you may need to automate outgoing text messages. They can be used to save time for your agents, inform your customers about updates, send basic info if the company is closed at the time of receiving the message, etc.

You can automate outgoing messages using the WorkFlows of ZOHO CRM, ZOHO DESK, ZOHO Books, ZOHO Creator, etc., or any other ZOHO tool.
The outgoing messages can be Session messages or Template messages. If you have not subscribed to template sending services or you have no available credits, you an send an email to presales@woztell.com to subscribe.

Examples of webhooks

  1. ZOHO CRM
    1. Qualify leads: When you receive a message from a new lead, you can do some automatical questions to save the time of your agents
    2. Out of service: When you receive a message at the weekend you can automate the answer, based on time, based on the type of customer, based on the words used, etc.
    3. Send promotion: Before the window of 24 closes, you can send an automated message with a promotion, do a dummy question or launch a funny message. If your customer answers you, you will have 24 hours the window opened. 
    4. A reminder of meeting: Each time that you will visit a customer or you will do an online meeting, you can send a Template message to be sure that your customer will remember you.
  2. ZOHO DESK
    1. Knowledge Base: You could automate the first answer with a canned message explaining where is your knowledge base, or you could automate the search in your knowledge base and answer the relational articles.
    2. Lost call: When you have a lost call to your Customer Care department, you could send a message proposing to use WhatsApp to contact you.
  3. ZOHO BOOKS
    1. Invoice sent: Each time that you send an invoice to your customer by email, you can notice him or send the link to do the payment.
  4. ZOHO RECRUIT
    1. A new job offer to candidates: You can automate the alert to the candidates each time that you publish a new job offer that matches with a segment of your candidates.
  5. ZOHO HUB
    1. Nurture: just manage your lead flow!
  6. etc
Some of these examples can need experience doing the setup of your ZOHO apps. Please contact with an experimented WOZTELL partner or contact us to tell us your needs.

FAQ

  1. Which is the limit of outgoing messages? WOZTELL doesn't limit you. You can send as many messages as your ZOHO tools allow.
  2. Can I send Templates and Session messages? Yes. You can send both
  3. Can I use "variables" inside the Templates? Yes. You can use up to 10 variables.
  4. How many seconds are needed to send a batch of 1.000 messages? The exact time depends on several variables, but usually, it can be sent in 250 seconds. If you need more speed please contact presales@woztell.com to study your requirements.
  5. Can I send files? Actually the webhooks of WOZTELL don't allow you to include files. If you need you could include a URL with the link to the file that you want to send.
  6. Can I send messages using other applications that are not ZOHO apps? The actual plans allow you to use webhooks launched from ZOHO servers. We can open the service to other scenarios depending on your needs. Please contact to presales@woztell.com
If you find a limitation in the use of Webhooks please contact us to study your needs in presales@woztell.com

VIDEO: How to use a Webhook within a ZOHO CRM WorkFlow


Document scope

This document covers the technical info about:
  • Prerequisites
  • Requests
  • Phone number format
  • Send URLs in text messages
  • Apply formatting in text messages
  • Responses
  • Example
  • Cut-off control



Prerequisites


  • Woztell account activated.
  • To use the Woztell API, you must first authenticate yourself and receive a token that enables you to access the service.
    Contact 
    support@woztell.com for more information on how to do this.

  • The message must meet the cut-off control service requirements.


Requests

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:


Parameters:

Parameter name

Data type

Description

Possible values

WOZTELL_ADMIN*

String

Email address for your Woztell account.

admin@company.com

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.

 

*Parameter is required


  • Text message

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



  • Template message


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.


Phone number formats


The phone number in the request can be in any WhatsApp format.


  |
The recommended best practice is to specify the country code with the phone number always and explicitly prefix it with a plus sign (+).

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"



Send URLs in text messages


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.



Apply formatting in text messages


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'; ''



Response

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":"" }


Example

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;


When a message is sent in a request, the customer will receive a message such as this in WhatsApp interface:





Cut-off Control

Cut-off control prevents messages from being delivered to users out of certain conditions. Here's a summary of the requirements:


  • Regular text messages (i.e., any non-template Messages) can only be delivered on the 24 hours after the last time the customer sent a message to your business.
  • Template Messages do not have this restriction and should be the preferred way of reaching a customer.
  • The business account should be eligible for payments.