WhatsApp API Business Protocol v3.9.0
WhatsApp API Business Protocol v3.9.0
FILE NAME -
WhatsApp Business Protocol v3.9.0
1 Document Information
1.0 Purpose
This document provides complete Protocol technical specification for Jatis’s WhatsApp Interactive
Service
Page 3 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
2 Webhooks
Webhooks are user-defined HTTP callbacks that are triggered by specific events. Whenever that trigger
event occurs, the Jatis WhatsApp API sees the event, collect the data, and immediately sends a
notification (HTTP Request) to the webhook URL specified by client updating the status of sent messages
or indicating when you receive a message.
When a customer sends you a message, the Jatis WhatsApp API will send an HTTP POST request
notification to the webhook URL with the details that are described in the following sections:
- Inbound Message Notifications
- Inbound Media Message Notifications
- Outbound Message Status Notifications
- Parameter/Field Descriptions for Inbound Messages
The following is an example of a text message you received from a customer. See the text object section
below for more information
{
"messages":[{
"from": "16315551234",
"id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
"timestamp": "1518694235",
"text": {
"body": "Hello this is an answer"
},
"type": "text"
}]
}
Page 4 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
The following is an example of a message you received from a customer specifying their static location.
See the location object section below for more information.
{
"messages":[{
"from":"16315551234",
"id":"ABGGFlA5FpafAgo6tHcNmNjXmuSf",
"location":{
"latitude":38.9806263495,
"longitude":-131.9428612257
},
"timestamp":"1521497875",
"type":"location"
}]
}
Page 5 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
The following is an example inbound message that contains an image. See the media object section below
to learn more about the different media types.
{
"messages":[{
"from":"16315551234",
"id":"ABGGFlA5FpafAgo6tHcNmNjXmuSf",
"image":{
"id":"b1c68f38-8734-4ad3-b4a1-ef0c10d683",
"mime_type":"image/jpeg",
"caption": "Check out my new phone!"
},
"timestamp":"1521497954",
"type":"image"
}]
}
The caption field is optional for media messages. It is only included if the user has set the caption.
The following is an example inbound message that contains a document. See the media object section
below to learn more about the different media types.
{
"messages":[{
"from":"16315551234",
"id":"ABGGFlA5FpafAgo6tHcNmNjXmuSf",
"timestamp":"1522189546",
"type":"document",
"document":{
"caption":"80skaraokesonglistartist",
"id":"fc233119-733f-49c-bcbd-b2f68f798e33",
"mime_type":"application/pdf"
}
}]
}
Page 6 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
The following is an example inbound message that contains a voice message. See the media object
section below to learn more about the different media types.
{
"messages":[{
"from": "16315551234",
"id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
"timestamp": "1521827831",
"type": "voice",
"voice": {
"id": "463eb7ec-ff4e-4d9b-b110-1879cbd411b2",
"mime_type": "audio/ogg; codecs=opus"
}
}]
}
An interactive object is found in webhooks related to interactive messages, including List Messages,
Reply Button, and Place Order inbound messages. This object contains the following components:
Name Description
list_reply Used to notify you when customers are replying to List Messages.
button_reply Used to notify you when customers are replying to Quick Reply Messages.
Page 7 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
{
"messages": [ {
"context": {
"from": "sender_wa_id_of_context_message",
"group_id": "group_id_of_context_message",
"id": "message_id_of_context_message",
"mentions": [ "wa_id1", "wa_id2" ]
},
"from": "sender_wa_id",
"group_id": "group_id",
"id": "message_id",
"timestamp": "message_timestamp",
"type": "interactive",
"interactive": {
"type": "list_reply",
"list_reply": {
"title": "row-title-content-here",
"id": "unique-row-identifier-here",
"description": "row-description-content-here"
}
}
}
{
"messages": [
{
"context": {
"from": "sender_wa_id_of_context_message",
"group_id": "group_id_of_context_message",
"id": "message_id_of_context_message",
"mentions": [ "wa_id1", "wa_id2" ]
},
"from": "sender_wa_id",
"group_id": "group_id",
"id": "message_id",
"timestamp": "message_timestamp",
"type": "interactive",
"interactive": {
"type": "button_reply",
"button_reply": {
"id": "unique-button-identifier",
"title": "button-text"
}
} # end interactive node
} # end message item
] # end messages array
}
Page 8 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
{
"messages": [ {
"from": "customer-whatsapp-id",
"group_id": "group-id",
"id": "message-ID",
"timestamp": "message-timestamp",
"type": "order"
"order": {
"catalog_id": "catalog_id",
"product_items": [
{
"product_retailer_id":"product-ID",
"quantity":"number-of-items",
"item_price":"unitary-price-of-item",
"currency":"price-currency"
},
...
],
"text":"text-message-sent-along-with-the-order"
}
}
}
Message status notifications provided information about the state of your messages.
This section covers:
- Message Status Notifications
- Message Status Notifications Parameters
The Jatis WhatsApp API will send notifications to inform you of the status of the messages between you
and users. When a message is sent successfully, you will receive notification when the message is sent,
delivered, and read. The order of these notifications in your app may not reflect the actual timing of the
message status. View the timestamp to determine the timing, if necessary. The notifications you may
receive are:
Page 9 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
o read – your sent message was read by the user. Read notifications will only be available for
those users that have read receipts enabled. For users that do not have it enabled, you will only
receive the delivered notification.
o failed – your message was failed to send. Reason for failure will be included in the callback
o Success reroute to sms – your message was failed to send but successfully re-route to
SMS.
{
"statuses":[{
"id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
"recipient_id": "16315555555",
"status": "sent",
"timestamp": "1518694700"
}]
}
{
"statuses":[{
"id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
"recipient_id": "16315555555",
"status": "delivered",
"timestamp": "1518694708"
}]
}
{
"statuses":[{
"id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
"recipient_id": "16315555555",
"status": "read",
"timestamp": "1518694722"
}]
}
Page 10 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
{
"statuses":[{
"id": "qIL4bA5RRSOb73nas7KawEl6",
"sms_message_id": "5Y44bLRQHOS0kQz1NhMngvGi",
"recipient_id": "6287825735522",
"status": "Success reroute to sms",
"timestamp": "1630256497"
}]
}
{
"statuses": [{
"errors": [{
"code": 480,
"title": "Failed to send message since we detect an identity change of
the contact"
}],
"id": "gBGGFjFVU2AfAgldhhKwWDGSrTs",
"recipient_id": "16315553601",
"status": "failed",
"timestamp": "1602535356"
}]
}
When you send a message to a user and have your webhook configured, you will receive status updates
letting you know when the message is sent, delivered, and when it was read by the user. There are fields
that comprise the status message.
Page 11 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Name
Description Type
id Message ID String
Pricing Updates
Starting June 1, 2023, the conversation and pricing object in your outbound notifications will have
new conversation and pricing categories, the business-initiated category will be replaced by:
Page 12 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
The following webhook will be received when a business sends a message as part of a Service
Conversations (if that conversation did not originate in a free entry point):
{
"statuses": [{
"id": "3A0C810BBE72C289F9CD",
"recipient_id": 6281384438846,
"status": "sent",
"timestamp": 1518694236,
"type": "message",
"conversation": {
"id": "conversation-ID",
"expiration_timestamp": 1518780636,
"origin": {
"type": "service"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "service"
}
}]
}
The following webhook will be received when a business sends a message as part of a Utility
Conversations:
{
"statuses": [{
"id": "3A0C810BBE72C289F9CD",
"recipient_id": 6281384438846,
"status": "sent",
"timestamp": 1518694236,
"type": "message",
"conversation": {
"id": "532b57b5f6e63595ccd74c6010e5c5c7",
"expiration_timestamp": 1518780636,
Page 13 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
"origin": {
"type": "utility"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "utility"
}
}]
}
The following webhook will be received when a business sends a message as part of a Authentication
Conversations:
{
"statuses": [{
"id": "3A0C810BBE72C289F9CD",
"recipient_id": 6281384438846,
"status": "sent",
"timestamp": 1518694236,
"type": "message",
"conversation": {
"id": "532b57b5f6e63595ccd74c6010e5c5c7",
"expiration_timestamp": 1518780636,
"origin": {
"type": "authentication"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "authentication"
}
}]
}
The following webhook will be received when a business sends a message as part of a Marketing
Conversations:
{
"statuses": [{
"id": "3A0C810BBE72C289F9CD",
"recipient_id": 6281384438846,
"status": "sent",
Page 14 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
"timestamp": 1518694236,
"type": "message",
"conversation": {
"id": "532b57b5f6e63595ccd74c6010e5c5c7",
"expiration_timestamp": 1518780636,
"origin": {
"type": "marketing"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "marketing"
}
}]
}
The following webhook will be received when a business sends a message in reply to a Service
Conversation originating from free entry points:
{
"statuses": [{
"id": "3A0C810BBE72C289F9CD",
"recipient_id": 6281384438846,
"status": "sent",
"timestamp": 1518694236,
"type": "message",
"conversation": {
"id": "532b57b5f6e63595ccd74c6010e5c5c7",
"expiration_timestamp": 1518780636,
"origin": {
"type": "referral_conversion",
}
},
"pricing": {
"pricing_model": "CBP",
"billable": false,
"category": "referral_conversion"
}
}]
}
Page 15 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
as shown in the examples contained within this document, notifications of received messages are
contained within a messages object. The tables in this section describe the fields in the inbound
notifications.
The messages object provides all of the information about the incoming message.
Id Message ID String
Page 16 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
id ID of the media. Can be used to delete the media if stored locally String
on the client.
Page 17 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Request
The message_id indicated is the id provided in the inbound notification
PUT /wa/messages/message-id
{
"status": "read"
}
Parameters
status Yes Updating status to read is applicable only for incoming messages.
Response
null # or {}
Page 18 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
3 Reference
3.1 Users
/wa/users
Use the users node for managing authentication and accessing the Jatis WhatsApp API.
Page 19 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
/wa/users Endpoints
To authenticate your self with Jatis WhatsApp API, you must log in. To login you send your username
and password basic authentication and receive a bearer token in response. You then use the bearer token
for authentication when sending request to any Jatis WhatsApp API endpoint.
Authentication
To use the Jatis WhatsApp API, you must authenticate yourself. Only users with valid authentication
tokens can access the service.
Login Requests
Jatis will provide you username and password. You will authenticate yourself using basic authentication
(username,password) when you login. The Authorization is set in the HTTP header. The type is
Basic and the credentials are a base64-encoded string consisting of the given username and
password joined with a colon (i.e., username:password).
Authentication Header
Many client software app (e.g., Postman) will take the username:password parameter and build the
authentication header automatically. If you need to build it yourself, here are the basic steps:
1. Create the username:password string
2. Use your favorite tool to base64-encode the string
For example, your username and password string is admin:secret, the base64-encoding for this is
YWRtaW46c2VjcmV0, so the user credentials will be Authorization: Basic
YWRtaW46c2VjcmV0.
Standard Login
Page 20 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
After you prepare the user credentials, you can use a standard login for the Jatis WhatsApp API, which
should look like:
POST /wa/users/login
curl -X POST \
-H 'Authorization: Basic base64(username:password)' \
-H 'Content-Type: application/json' \
-d '{}' \
https://{{BASE-URL}}/users/login
Login Responses
When your login request id received by the Jatis WhatsApp API, your credentials are processed for
validation.
- If successful, your token is generated. The response contains your token in the token field.
Success
On success, a status of 200 Ok is returned, along with the token and token expiration time. All generated
tokens expired in 7 days.
{
"users": [{
"token": "eyJhbGciOHlXVCJ9.eyJ1c2VyIjoNTIzMDE2Nn0.mEoF0COaO00Z1cANo",
"expires_after": "2018-03-01 15:29:26+00:00"
}]
Page 21 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Parameters:
Tokens
For your initial login, use your username and password for basic authentication. For all other secure
transactions, you must use the bearer token that is returned after a successful login.
Usage
The tokens are sent in the authorization header of the HTTP request for many of the Jatis WhatsApp API
calls. In particular, notice in the following example that the type of authorization that is used with this is
token Bearer.
HTTP-METHOD /secured-path
For all secured paths, we validate the token. During the validation, if the token is found to be expired, that
token is removed from the system. Upon successful validation, the request is allowed to proceed.
Expiration
You can use your token for authentication until the token expires. Tokens are set to expire after a default
time, such as 7 days. The expires_after parameter in the response provides the expiration date for
the token. Login again to generate a new token.
Page 22 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
3.2 Media
/wa/media
Uploading Media
To upload media to the Jatis WhatsApp API, use the media node. The POST body must contain the
binary media data and the Content-Type header must be set to the type of media being uploaded.
See the Supported File Types section for information about supported file types. Note: the maximum file
size for uploaded media is 64MB.
Sending binary data in a POST HTTP request is a standard way of uploading binary data. If you want to
upload an image, for example, you issue a POST request with the actual image bytes in the payload.
Request
Uploading media:
POST /wa/media/upload
Content-Type: image/jpeg or other appropriate media type
binary-media-data
curl -X POST \
https://{{BASE-URL}}/media/upload \
-H 'Authorization: Bearer your-auth-token' \
-H 'Content-Type: image/jpeg' \ # or other appropriate media type
--data-binary @your-file-path
Response
Page 23 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
A successful response returns the id field, which is the information you need for downloading media files
and sending a media message to your customers.
{
"media": [
{
"id": "f043afd0-f0ae-4b9c-ab3d-696fb4c8cd68"
}
]
}
Downloading Media
Downloading media is particularly useful when a user has uploaded an image that is sent to your
webhook. When a message with media is received, the Jatis WhatsApp API will download the media.
Once the media is downloaded, you will receive a notification through your webhook. Use the media ID
found in the notification to download the media.
Request
Page 24 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
GET /wa/media/download?media_id={{media-id}}
Or
GET /v1/media/{{media-id}}
For example, using the example image uploaded in the previous section:
curl -X GET \
https://interactive.jatismobile.com/wa/media/download?media_id=f043afd0-f0ae-
4b9c-ab3d-696fb4c8cd68 \
-H 'Authorization: Bearer your-auth-token'
Or
curl -X GET \
https://interactive.jatismobile.com/v1/media/f043afd0-f0ae-4b9c-ab3d-
696fb4c8cd68 \
-H 'Authorization: Bearer your-auth-token'
To send this example media to a file, use the -o parameter, as shown below:
curl -X GET \
https://interactive.jatismobile.com/wa/media/download?media_id=f043afd0-f0ae-
4b9c-ab3d-696fb4c8cd68 \
-H 'Authorization: Bearer your-auth-token' \
-o path/filename
Or
curl -X GET \
https://interactive.jatismobile.com/v1/media/f043afd0-f0ae-4b9c-ab3d-
696fb4c8cd68 \
-H 'Authorization: Bearer your-auth-token' \
-o path/filename
Page 25 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Response
If successful, you will see a response containing a 200 OK status and the binary data you downloaded.
binary-media-data
If you used tool like postman, you will see the image that was downloaded. If you are using a command
line tool, you will see the binary data that was downloaded. If you sent the data to a file, you will see the
image in your file browser.
3.3 Contacts
/v1/contacts
Use the contacts node to manage WhatsApp users in your database by validating them before
sending messages and verify a user's identity with identity hashes.
• Verify that a phone number in your database belongs to a valid WhatsApp account. You
must ensure that the status is valid before you can message a user.
• Get the WhatsApp ID for a phone number. WhatsApp IDs are needed to send messages and
user notifications.
Constraints
• If you check too many phone numbers without sending messages to them, you will be
banned. Only check only phone numbers critical to your business for which you have already
received customer opt-in.
• At this time, there is no callback to inform you when a WhatsApp user joins or leaves the
network, so you must check contacts frequently.
Page 26 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Creating
Before sending messages to users who have opted in, send a POST API call to /v1/contacts to
create a WhatsApp account user validation request. In your call, include a list of phone numbers you
want to validate.
Example
Send an API call to /v1/contacts containing an array of registered phone numbers. The phone
numbers can be in any standard telephone number format.
POST /v1/contacts
{
"blocking": "wait" | "no_wait",
"contacts": [
"16315551000",
"+1 631 555 1001",
"6315551002",
"+1 (631) 555-1004",
"1-631-555-1005"
],
"force_check": false | true
}
You will receive a response with the current status of the requested numbers and their WhatsApp
IDs (wa_id):
{
"contacts": [ {
"wa_id": "16315551000",
"input": "16315551000",
"status": "valid"
},
{
"wa_id": "16315551001",
"input": "+1 631 555 1001",
"status": "processing" # Only applicable when request is non-blocking
},
{
"input": "6315551002",
"status": "invalid"
},
{
"input": "+163155588",
"status": "failed"
}
Page 27 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Save the WhatsApp IDs for those numbers that returned a status of valid. Valid users are those
with a WhatsApp account. Use the WhatsApp IDs to send messages and notifications.
Repeat these steps on a regular basis to manage your list of valid users. The results are cached in
the WhatsApp Business API client's database for 7 days.
Parameters
Name Description
blocking Optional.
Whether the API request should wait for processing to complete or not
before returning a response. For more information, read
the Blocking section below.
contacts Required.
Array of phone numbers that you are validating.
force_check Optional.
Whether to check the contacts cache or not. Contact information is
normally cached for 7 days. By setting the force_check parameter
to true, the cache will be bypassed ensuring a check is performed.
Blocking
There are two options for the blocking parameter: no_wait and wait. If the blocking parameter
is not specified in a call it is no_wait by default.
Page 28 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
The blocking parameter determines whether the request should wait for the processing to
complete (synchronous) or not (asynchronous).
Setting Description
The API response may include some numbers with status set
to processing. If that happens, we recommend you follow these steps:
wait The processing of the numbers is synchronous. You see the final status
for all of the contacts after syncing with server. This setting makes the
query block wait until the numbers have all been checked before returning
results. This might take some time.
When there is no plus sign (+) at the beginning of the phone number, the country code is determined
using the phone number that your WhatsApp Business API client is registered under, so phone
numbers associated with a different country code will fail.
The recommended best practice is to always specify the country code with the phone number and
explicitly prefix it with a plus sign (+).
Here are some examples that demonstrate this behavior, assuming the WhatsApp Business API
client is registered with an Indian phone number (i.e., country code is +91):
"6315551002" "+916315551002" No
Page 29 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
"1-631-555-1002" "+9116315551002" No
Returned Fields
The contacts response payload contains the same array of phone numbers sent in the request with
the input, status, and wa_id properties:
Name Description
input The value you sent in the contacts field of the API call.
Possible values:
wa_id WhatsApp user ID that can be used in other API calls. Only returned if
the status is valid
Along with the processing status, you should see an HTTP status of 200 OK. If there are any
errors in the response, see Error and Status Messages for more information.
Best Practices
We recommend checking contacts before sending messages, however you do not need to check
contacts when responding to incoming customer messages as you can immediately respond using
the provided wa_id. There is no additional cost as results are cached.
Page 30 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
3.4 Messages
/wa/messages
Use the messages node to send text messages, media/documents to your customers.
/wa/messages
Request
After you have the WhatsApp ID for the user you want to message, use it to send a text message. A text
message can be max of 4096 characters long.
POST /wa/messages
{
"recipient_type": "individual",
"to": "whatsapp-id",
"type": "text",
"text": {
"body": "your-text-message-content"
}
}
Parameters
Page 31 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Response
A successful response includes a messages object with an identifier for the newly created message.
{
"messages": [{
"id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
}]
}
/wa/messages
Use the messages endpoint to send messages containing audio, video, images, or documents to your
customers.
POST /wa/messages
Page 32 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
{
"recipient_type": "individual",
"to": "whatsapp-id",
"type": "audio" | "document" | "image" | "video" | "sticker",
"audio": {
"link": "http(s)://the-url.mp3"
}
"document": {
"link": "http(s)://the-url.pdf",
"caption": "your-document-caption"
}
"image": {
"link": "http(s)://the-url.jpg",
"caption": "your-image-caption"
}
"video": {
"link": "http(s)://the-url.mp4",
"caption": "your-video-caption"
}
"sticker": {
"link": "http(s)://the-url.webp"
Page 33 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
link Yes The protocol and URL of the media to be sent. Use only with
HTTP/HTTPS URLs.
Page 34 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
caption No Describes the specified image, video or document media. Do not use
with audio and sticker media.
Response
The successful response includes a messages object with a message ID.
{
"messages": [{
"id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
}]
}
Page 35 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
The interactive object generally contains 4 main components: header, body, footer,
and action. Additionally, some of those components can contain one or more different objects:
Name
Description
type Required.
Supported values:
header Optional.
Header content displayed on top of a message. See header object for more
information.
body Required.
The body of the message. Emojis and markdown are supported.
footer Optional.
The footer of the message. Emojis and markdown are supported.
action Required.
Action you want the user to perform after reading the message.
Name Description
type Required.
The header type you would like to use. Supported values are:
Page 36 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Name Description
Name Description
text Required.
The body content of the message. Emojis and markdown are supported. Links
are supported.
Name Description
Name Description
Page 37 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Name Description
Name Description
Example:
"rows": [
Page 38 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Name Description
"id":"unique-row-identifier-here",
"title": "row-title-content-here",
"description": "row-description-content-here",
Example
POST /v1/messages
{
"recipient_type": "individual",
"to": "whatsapp-id",
"type": "interactive",
"interactive":{
"type": "list",
"header": {
"type": "text",
"text": "your-header-content-here"
},
"body": {
"text": "your-text-message-content-here"
},
"footer": {
"text": "your-footer-content-here"
},
"action": {
"button": "cta-button-content-here",
"sections":[
{
"title":"your-section-title-content-here",
"rows": [
{
"id":"unique-row-identifier-here",
"title": "row-title-content-here",
"description": "row-description-content-here",
}
]
},
{
"title":"your-section-title-content-here",
Page 39 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
"rows": [
{
"id":"unique-row-identifier-here",
"title": "row-title-content-here",
"description": "row-description-content-here",
}
]
},
...
]
}
}
POST /v1/messages
{
"recipient_type": "individual",
"to": "whatsapp-id",
"type": "interactive",
"interactive": {
"type": "button",
"header": { # optional
"type": "text" | "image" | "video" | "document",
"text": "your text"
# OR
"document": {
"id": "your-media-id",
"filename": "some-file-name"
}
# OR
"document": {
"link": "the-provider-name/protocol://the-url",
"provider": {
"name": "provider-name",
},
"filename": "some-file-name"
},
# OR
"video": {
"id": "your-media-id"
}
# OR
"video": {
"link": "the-provider-name/protocol://the-url",
"provider": {
"name": "provider-name"
}
}
# OR
"image": {
"id": "your-media-id"
Page 40 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
}
# OR
"image": {
"link": "http(s)://the-url",
"provider": {
"name": "provider-name"
}
}
}, # end header
"body": {
"text": "your-text-body-content"
},
"footer": { # optional
"text": "your-text-footer-content"
},
"action": {
"buttons": [
{
"type": "reply",
"reply": {
"id": "unique-postback-id",
"title": "First Button’s Title"
}
},
{
"type": "reply",
"reply": {
"id": "unique-postback-id",
"title": "Second Button’s Title"
}
}
]
} # end action
} # end interactive
Page 41 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Page 42 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Page 43 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
POST /v1/messages
{
"recipient_type": "individual",
"to": "whatsapp-id",
"type": "interactive",
"interactive":
{
"type": "product_list",
"header":{
"type": "text",
"text": "text-header-content"
},
"body":{
"text": "text-body-content"
},
"footer":{
"text":"text-footer-content"
},
"action":{
"catalog_id":"catalog-id",
"sections": [
{
"title": "the-section-title",
"product_items": [
{ "product_retailer_id": "product-SKU-in-catalog" },
{ "product_retailer_id": "product-SKU-in-catalog" },
...
]},
{
"title": "the-section-title",
"product_items": [
{ "product_retailer_id": "product-SKU-in-catalog" }
...
]},
...
]
},
}
}
Page 44 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Page 45 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
POST /v1/messages
{
"recipient_type": "individual",
"to": "whatsapp-id",
"type": "interactive",
"interactive": {
"type": "product",
"body": {
"text": "text-body-content"
},
Page 46 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
"footer": {
"text": "text-footer-content"
},
"action": {
"catalog_id": "catalog-id",
"product_retailer_id": "product-SKU-in-catalog"
}
}
}
Page 47 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Beginning with v3.5.0, media message templates expand the content you can send recipients
beyond the standard message template type to include media, headers, and footers using
a components object. The components object allows you to indicate the type of message and the
message's parameters.
Request
POST /v1/messages
"to": "recipient_wa_id",
"type": "template",
"template": {
"namespace": "your-namespace",
"language": {
"policy": "deterministic",
"code": "your-language-and-locale-code"
},
"name": "your-template-name",
"components": [
{
"type" : "header",
"parameters": [
# The following parameters code example includes several different possible
header types,
# not all are required for a media message template API call.
{
"type": "text",
"text": "replacement_text"
}
# OR
{
"type": "document",
"document": {
"link": "the-provider-name/protocol://the-url",
# provider and filename are optional parameters
"provider": {
"name" : "provider-name"
},
"filename": "your-document-filename"
}
Page 48 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
}
# OR
{
"type": "image",
"image": {
"link": "http(s)://the-url",
# provider is an optional parameter
"provider": {
"name" : "provider-name"
},
}
}
]
# end header
},
{
"type" : "body",
"parameters": [
{
"type": "text",
"text": "replacement_text"
},
{
"type": "currency",
"currency" : {
"fallback_value": "$100.99",
"code": "USD",
"amount_1000": 100990
}
},
{
"type": "date_time",
"date_time" : {
"fallback_value": "February 25, 1977",
"day_of_week": 5,
"day_of_month": 25,
"year": 1977,
"month": 2,
"hour": 15,
"minute": 33, #OR
"timestamp": 1485470276
}
},
{
...
Page 49 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Parameters
template Yes (For template messages) Contains all the template information
Page 50 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Response
A successful response includes a messages object with an id.
"messages": [{
"id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
}]
An unsuccessful response will contain an error object that will contain an error string, error code and
other information.
Page 51 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
You can use the messages endpoint to send message templates to your customers. Use the
WhatsApp Manager to create your message templates.
Request
As with other messages, the message is sent to the /v1/messages endpoint. What's different about
sending message templates is the content of the message body specified with
the template parameter.
The template parameter contains a namespace and a name pair that identify a template and the
values to apply to variables in that template. Note: Beginning with v3.6.1,
the namespace and name parameters must match up or the message will fail to send.
The following code provides an example of sending a message template. This example uses
the purchase_with_credit_card element name within
the cdb2df51_9816_c754_c5a4_64cdabdcad3e namespace.
POST /v1/messages
{
"to": "whatsapp_id" | "whatsapp_group_id",
"type": "template",
"template": {
"namespace": "cdb2df51_9816_c754_c5a4_64cdabdcad3e",
"name": "purchase_with_credit_card",
"language": {
"policy": "deterministic",
"code": "en_US"
},
"components": [
{ "type": "body",
"parameters": [
{"type": "text",
"text": "$10" },
{"type": "text",
"text": "1234" }
]
}
]
}
}
The resulting message received by the customer will look like this:
You made a purchase for $10 using a credit card ending in 1234.
Page 52 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
As you can see from looking at the localizable parameters and the message the client received, the
template used the default value of 10 as the amount of the purchase and the default value of 1234
as the last numbers of the account.
Parameters
template Yes (for The containing element for the message content — Indicates
message that the message is highly structured. Parameters contained
templates) within provide the structure.
name Yes The template name that indicates which template to use
within the namespace
Note: Beginning with v3.6.1, if the name does not match
up to the namespace, the message will fail to send
Page 53 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Response
{
"messages": [{
"id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
}]
}
An unsuccessful response will contain an error object that will contain an error string, error code and
other information.
• Call-to-Action — Allows your customer to call a phone number and visit a website
• Quick Reply — Allows your customer to return a simple text message
These buttons can be attached to text messages or media messages. Once your interactive
message templates have been created and approved, you can use them in notification messages as
well as customer service/care messages.
Request
POST /v1/messages
{
"to": "recipient_wa_id",
"type": "template",
"template": {
"namespace": "your-namespace",
"language": {
"policy": "deterministic",
"code": "your-language-and-locale-code"
},
"name": "your-template-name",
"components": [
{
"type" : "header",
"parameters": [
{
"type": "text",
"text": "replacement_text"
Page 54 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
}
]
# end header
},
{
"type" : "body",
"parameters": [
{
"type": "text",
"text": "replacement_text"
},
{
"type": "currency",
"currency" : {
"fallback_value": "$100.99",
"code": "USD",
"amount_1000": 100990
}
},
{
"type": "date_time",
"date_time" : {
"fallback_value": "February 25, 1977",
"day_of_week": 5,
"day_of_month": 25,
"year": 1977,
"month": 2,
"hour": 15,
"minute": 33, #OR
"timestamp": 1485470276
}
},
{
...
# Any additional template parameters
}
]
# end body
},
"payload":"aGlzIHRoaXMgaXMgY29vZHNhc2phZHdpcXdlMGZoIGFTIEZISUQgV1FEV0RT"
}
]
},
Page 55 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
{
"type": "button",
"sub_type" : "url",
"index": "1",
"parameters": [
{
"type": "text",
# Business Developer-defined dynamic URL suffix
"text": "9rwnB8RbYmPF5t2Mn09x4h"
}
]
},
{
"type": "button",
"sub_type" : "url",
"index": "2",
"parameters": [
{
"type": "text",
# Business Developer-defined dynamic URL suffix
"text": "ticket.pdf"
}
]
}
]
}
}
Parameters
Page 56 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
parameters Yes The parameters for the button, which are set at creation time in your
Business Manager
quick_reply No Refers to a previously created quick reply button that allows for the
customer to return a predefinied message
url No Refers to a previously created button that allows the customer to visit
the URL generated by appending the text parameter to the pre-
defined prefix URL in the template
Page 57 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
text Yes (for url buttons) Developer provided suffix that will be appended to a
previously created dynamic URL button
Response
A successful response includes a messages object with an id.
{
"messages": [{
"id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
}]
}
An unsuccessful response will contain an error object that will contain an error string, error code and
other information.
If a template is sent to an account that is incapable of receiving the template, the 1026
(ReceiverIncapable) error will be sent in the error object to the configured Webhook server.
Note: A customer may not click a button and either reply to the interactive message or just send you
a message. Make sure that you are able to support this type of scenario as well.
{
"contacts": [
{
"profile": {
"name": "Kerry Fisher"
},
"wa_id": "16505551234"
}
],
Page 58 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
"messages": [
{
"button": {
"payload": "No-Button-Payload",
"text": "No"
},
"context": {
"from": "16315558007",
"id": "gBGGFmkiWVVPAgkgQkwi7IORac0"
},
"from": "16505551234",
"id": "ABGGFmkiWVVPAgo-sKD87hgxPHdF",
"timestamp": "1591210827",
"type": "button"
}
]
# If there are any errors, an errors field (array) will be present
"errors": [ { ... } ]
}
Page 59 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
3.5 Settings
/wa/settings
/wa/settings Endpoints
Application Settings
/wa/settings/application
Update or reset your application settings using API calls to the /wa/settings/application
endpoint.
To configure settings for the Jatis WhatsApp API, use the /wa/settings/application endpoint
with a JSON message body containing the field names and values to be set.
Request
Currently the API only support on updating or setting webhooks. When you need to set or if there is a
change in webhook URL, you can call this API.
PATCH /wa/settings/application
{
"webhooks": {
# see Webhooks Settings below
"url": "webhook.your-domain"
}
}
Parameters
Page 60 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Webhooks Parameters
The following table describes fields in the webhooks object in more detail
url String Inbound and outbound notifications are routed to this URL. A HTTPS-based
endpoint is required; HTTP will not work. This URL may look like
this: https://spotless-process.glitch.me/webhook.
Response
A successful response is the HTTP status code 200 OK with a null or {} message body:
3.6 Health
/wa/health
Check the status of your WhatsApp Business API client with the health node. This node samples
the health of the gateway to the WhatsApp server and sends back a JSON response.
Request
GET /wa/health
{
Authorization: Bearer your-auth-token | Apikey your-api-key-token
}
Authorization
The health node supports Bearer token authenication similar to other WhatsApp Business API
nodes. However, if you wish to monitor the health status from an orchestrator, Bearer tokens are
not the best option for ongoing health checks as they expire every 7 days. To mediate this, you can
use an API key, which can be set using the WA_API_KEY environment variable in the waweb
environment section in the .yml file of your installation setup.
Page 61 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Note: The API key you set must have a minimum of 12 characters and a maximum of 128
characters.
services:
...
waweb:
...
environment:
...
WA_API_KEY: your-api-key-token
Response
The response will provide the status of the health of the gateway to the WhatsApp server. If
the Authorization header is not present or invalid, a 401 error code will be returned.
Single instance
{
"health": {
"gateway_status": "connected | connecting | disconnected | uninitialized |
unregistered"
}
}
High Availability/Multiconnect
{
"health": {
"your-hostname1:your-container-id1": {
"gateway_status": "connected | connecting | disconnected |
uninitialized | unregistered",
"role": "primary_master | secondary_master | coreapp"
},
"your-hostname2:your-container-id2": {
"gateway_status": "connected | connecting | disconnected |
uninitialized | unregistered",
"role": "primary_master | secondary_master | coreapp"
},
}
}
Note: In High Availability mode, only one Coreapp will be connected to the WhatsApp server, all
other nodes including the primary master will have a gateway_status of disconnected. In
Multiconnect mode with X shards, X Coreapps will be connected to the WhatsApp server, and the
primary master will also connect to the WhatsApp server.
Page 62 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
Parameters
health The health object contains the fields that describe the health of Object
the WhatsApp Business API Client.
gateway_status Status of the connection between the Coreapp and WhatsApp String
servers.
Values:
• connected, connecting — The health is good.
• uninitialized — The application could be in the process
of upgrading or initializing the database schema. Try again in a few
minutes and contact Jatis Support if you continue to see this status.
• unregistered — You need to register your WhatsApp
Business API Client.
Page 63 of 64 5/2/2023
WhatsApp Business Protocol Confidential Jatis Mobile
4 Sequence Diagram
Below is the detail sequence diagram of push template message mechanism.
1. Login request
WhatsApp API using oAuth mechanism for API access authentication. So, before you could access every
API in this document, you should get token access by hitting login API.
2. Token response
If your credential is correct, the login API will return a token key which has expiry time. Use this token in
every hit of any WhatsApp API.
3. Check contact
Before you send a template message to a WA number, you should perform a check contact of the number
to know if it’s a valid WA user or not.
4. Valid WA id
The check contact API will return a valid/invalid contact, if it’s a valid contact then you can perform the
send template message.
5. Send message request
Use this API to send a template message.
6. Message id response
Messages API returns message id if success, you should keep the message id and wait for the delivery
status related to the message id.
7. Delivery status
Delivery status of the message id from point 6 will be sent to you once WhatsApp send it to Jatis.
Page 64 of 64 5/2/2023