Taqnyat WhatsApp Business API provides a rich, enterprise grade messaging solution for clients who wish to communicate with their customers via WhatsApp.
WhatsApp is the most popular communication and chatting app for the past few years. With its rich features, it can be a powerful platform for business owners to communicate with their clients. Therefore, WhatsApp for Business API has been introduced as a business version of WhatsApp.
WhatsApp helps more than 2 billion people connect and share with the people they care about. For businesses, WhatsApp is a simple, secure, and reliable way to reach customers.
WhatsApp offers the following solutions for businesses looking to connect with their customers: WhatsApp Business API: Recommended for medium and large businesses, the API allows companies to communicate with their customers at scale.
The WhatsApp Business API client offers many of the features provided by the WhatsApp applications you already know from Android, iOS, and Web.
The difference is that this application can be deployed on a server, providing a local API that allows you to programmatically send and receive messages and integrate this workflow with your own systems (e.g., CRMs, contact center platforms, etc.).
Be aware that, to use our API, businesses must complete a series of requirements, including, but not limited to:
To use taqnyat.sa API, you should have a taqnyat.sa account, here is an explanation of how you can register, checking your current balance, request a recharge for your balance through a “request recharge form” in taqnyat.sa website.
Registration process: You can register on taqnyat.sa website through the following link: Contact and go to Sales tab ,fill the form and hit send.
Using bearer Tokens: bearer Tokens will have a unique value generated in the taqnyat.sa user account , because it provides a more secure connection with the API.
type | Supported content types | Limit |
---|---|---|
Image | image/jpeg, image/png | 5 MB |
Audio | audio/aac, audio/mp4, audio/amr, audio/mpeg, audio/ogg, audio/opus | 16 MB |
Video | video/mp4, video/3gpp | 16 MB |
Sticker | image/webp | 100 KB |
Document | Any content type listed for other message types, text/plain, text/csv, application/pdf, application/msword, application/x-tar, application/rtf.0, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.spreadsheet, application/vnd.ms-excel, application/vnd.oasis.opendocument.text |
100 MB |
To use our API, you will need a unique Bearer token generated from your account at our platform by following the below steps Setup Bearer token
For REST API Bearer token must be submitted withen the header Authorization
.
With Taqnyat you can set up your bearer token in seconds using the below steps:
https://api.taqnyat.sa/wa/v2/
Updated requirements:
The policy will no longer dictate the following requirements that are in the current opt-in policy:
Additionally, businesses should:
A callback is a HTTP POST request with a notification made by Taqnyat WhatsApp API to a URI of your choosing. Taqnyat WhatsApp API expects the receiving server to respond with a response code within the 2xx Success range. If no successful response is received then the API will retry up to three attempts.
Name | Description | Type |
---|---|---|
type | Will always be whatsapp | String |
statuses | Array of delivery reports | Array[Object] |
contacts | Array of inbound messages contact | Array[Object] |
notifications | Array of inbound messages | Array[Object] |
Name | Description | Type |
---|---|---|
status | The status of the message, either success or failure | String |
state | The state of the message | String |
message_id | The message id of the message to which this delivery report belong to | String |
details | Detailed message containing information. | String |
recipient | The recipient of the message that this delivery report belong to | String |
timestamp | ISO-8601 datetime of the status update | String |
State | Description |
---|---|
queued | Message has been received and queued by Taqnyat WhatsApp API |
dispatched | Message has been dispatched by Taqnyat WhatsApp API to WhatsApp servers |
sent | Message has been sent by WhatsApp to end-user |
delivered | Message has been successfully delivered to end-user by WhatsApp |
read | Message has been read by the end-user in the WhatsApp application |
deleted | Message has been deleted or expired in the application |
failed | Message has failed |
no_opt_in | Message rejected by Taqnyat API as recipient is not registered to have opted in |
no_capability | Message rejected by Taqnyat API as the recipient lacks WhatsApp capability |
An inbound message or MO (Mobile Originated) is a message sent to one of your bots from a WhatsApp user. The format is as follows:
Notifications
Name | Description | Type |
---|---|---|
from | MSISDN of the user sending the message | String |
to | The identifier of the receiving bot | String |
replying_to | A context object, present only if the user is replying to a specific thread | Object |
message_id | Generated message id for the inbound message | String |
message | Message object describing the inbound message | Object |
timestamp | ISO-8601 datetime of the status update | String |
forwarded | Boolean object stating if message was forwarded | Boolean |
frequently_forwarded | Boolean object stating if message was frequently forwarded | Boolean |
referral | A referral object, if the message is sent in reponse to an ad or a post | Object |
Message API is use to send Messages to all numbers are pre opt-in only
when sending message , you should initiat the conversation with template type message , and you can spicify which template by using one of pre define templates.
other than this you are free to use the free form messages if the end user reply to your Template message or send you a message.
also you may want to specify the conversation time to live in queue waiting for receptors to receive the message using the parameter ttl (Time To Live) default time is 7 days, after that message will be deleted from the queue and fail error will be return.
Name | Description | Type | Constraints | Required |
---|---|---|---|---|
To | List of MSISDNs | String | array 1 to 20 elements | Yes |
template.name | the template name at your account on Taqnyat | String | Valid Message object | Yes |
code | the language code of the used template | String | Valid Message object | Yes |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value image | String | N/A | N/A | Yes |
url | Public url of the image file. Should be either HTTP or HTTPS link. | String | N/A | Accepted Content-Type header | Yes |
template.name | the template name at your account on Taqnyat | String | N/A | Valid Message object | Yes |
code | the language code of the used template | String | ar | Valid Message object | Yes |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value video | String | N/A | N/A | Yes |
url | Public url of the video file (mp4). Should be either HTTP or HTTPS link. | String | N/A | Accepted Content-Type header | Yes |
template.name | the template name at your account on Taqnyat | String | N/A | Valid Message object | Yes |
code | the language code of the used template | String | ar | Valid Message object | Yes |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value document | String | N/A | N/A | Yes |
url | Public url of the document file. Should be either HTTP or HTTPS link. | String | N/A | Accepted Content-Type header | Yes |
filename | Optional parameter that describes the filename of the document. | String | None | N/A | No |
template.name | the template name at your account on Taqnyat | String | N/A | Valid Message object | Yes |
code | the language code of the used template | String | ar | Valid Message object | Yes |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value text | String | N/A | N/A | Yes |
text | the OTP which will be send to the end user | String | N/A | Accepted Content-Type header | Yes |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value text | String | N/A | N/A | Yes |
text | the value of the variable | String | N/A | Accepted Content-Type header | Yes |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | JSON Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value location | String | N/A | N/A | Yes |
lat | The latitude position as a float number. | Number | N/A | [-90, 90] | Yes |
lng | The longitude position as a float number. | Number | N/A | [-180, 180] | Yes |
name | The name for the location. Will be displayed in the message. | String | N/A | N/A | No |
address | The address for the location. Will be displayed in the message. | String | N/A | N/A | No |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | JSON Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value contacts | String | N/A | N/A | Yes |
contacts | List of contact cards | Object array N/A | Valid contact cards | Yes |
Message API is use to send Messages after session is beeing opened
unlike template messages you may send messages to your customer during the 24 session houre with no restrection .
Available formatting and using emojis for the text message content can be found in the introduction.
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value text | String | N/A | N/A | Yes |
preview_url | Message object | Boolean | false | true or false | No |
text | The text message content | String | N/A | Up to 4096 characters | Yes |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value image | String | N/A | N/A | Yes |
url | Public url of the image file. Should be either HTTP or HTTPS link. | String | N/A | Accepted Content-Type header | Yes |
caption | Optional caption that will be displayed underneath the image. | String | None | N/A | No |
provider | Optional name of a provider to be used when trying to download the file. | String | None | N/A | No |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value video | String | N/A | N/A | Yes |
url | Public url of the video file (mp4). Should be either HTTP or HTTPS link. | String | N/A | Accepted Content-Type header | Yes |
caption | Optional caption that will be displayed underneath the video. | String | None | N/A | No |
provider | Optional name of a provider to be used when trying to download the file. | String | None | N/A | No |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value document | String | N/A | N/A | Yes |
url | Public url of the document file. Should be either HTTP or HTTPS link. | String | N/A | Accepted Content-Type header | Yes |
filename | Optional parameter that describes the filename of the document. | String | None | N/A | No |
caption | Optional caption that will be displayed as the document title. | String | None | N/A | No |
provider | Optional name of a provider to be used when trying to download the file. | String | None | N/A | No |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value audio | String | N/A | N/A | Yes |
url | Public url of the audio file. Should be either HTTP or HTTPS link. | String | N/A | Accepted Content-Type header | Yes |
provider | Optional name of a provider to be used when trying to download the file. | String | None | N/A | No |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | JSON Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value location | String | N/A | N/A | Yes |
lat | The latitude position as a float number. | Number | N/A | [-90, 90] | Yes |
lng | The longitude position as a float number. | Number | N/A | [-180, 180] | Yes |
name | The name for the location. Will be displayed in the message. | String | N/A | N/A | No |
address | The address for the location. Will be displayed in the message. | String | N/A | N/A | No |
Refer to the Supported ContentTypes for more information .
JSON object parameters:
Name | Description | JSON Type | Default | Constraints | Required |
---|---|---|---|---|---|
type | Constant value contacts | String | N/A | N/A | Yes |
contacts | List of contact cards | Object array N/A | Valid contact cards | Yes |