Taqnyat is a licensed company from CITC in the Saudi Arabia kingdom, recently we have signed an agreement with a verified WhatsApp Business Solutions Provider specializing in WhatsApp Business API Access and hosting.
As a Provider for official business solution providers, we host the WhatsApp Business API. You can access and use the API by calling the endpoints provided, The WhatsApp Business API uses a REST API Architecture with JSON data formats. The API follows the standard HTTP request-response exchange.
also in Taqnyat, we have many other channels that can be provided for our customers, like SMS, Voice, Email, and Push notification, we just recently added the WhatsApp business API to the list with a variety of features WhatsApp already included for years WhatsApp is known as a preferred channel for users with more than 2.4 billion around the globe.
why go with taqnyat no directly with Whatsapp or any other business solution providers.
first of all, we need to clarify that WhatsApp business API is a limited access service provided by Meta, Facebook company and going directly to WhatsApp is not recommended by WhatsApp them self, and they strongly advise businesses to work with one of the solution providers listed in a directory provided by Facebook.
most of the business solution providers are not available in the MENA, and if they are they don't have support for Arabic or are licensed from CITC, unlike us since taqnyat provide a flexible solution for the business and help them all the way to get started and keep them updated with 24/7/365 supporting, also taking care the tech, and business issues scale them and put 100% power to resolve them in no time.
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:
Before a business can access the WhatsApp Business API, each client has to go through an approval procedure, and list of requirments are needed.
WhatsApp has switched from a notification-based pricing model to a conversation-based pricing model. Businesses are charged per conversation, which includes all messages delivered in a 24 hour session.
How It Works WhatsApp Business API conversations fall into two categories that are priced differently:
All conversations are measured in fixed 24-hour sessions. A conversation starts when the first business message in a conversation is delivered, either initiated by the business or in reply to a user message. Businesses and users can exchange any number of messages, including template messages, within a 24 hour conversation session without incurring additional charges. Each 24 hour conversation session results in a single charge.
Charges for conversations are based on the user’s country code. A user here is defined as the customer that your business is communicating with. Rates for business-initiated and user-initiated conversations vary by country or region.
You can download the individual rate cards and find the country to region mapping for countries where regional rates apply whatsapp price list .
To start using the WhatsApp Business API, you will need the following:
You need to have a Facebook Business ID before you can proceed to the WhatsApp approval process. To find your Business ID, log into the Facebook Business Manager of the business and navigate to Business Settings. The Business Manager ID is displayed under the business name.
If you don’t have a verified Facebook Business account, you need to create a Facebook Business Manager. To create a Business Manager:
After the Facebook Business Manager ID is provided, you will receive a Message on Behalf request. You need to accept it, so Taqnyat can send messages on your behalf with your Facebook Business Manager ID.
Please navigate in your Facebook Business Manager Account to Requests > Received to accept the request.
Start the process of verifying your business in Facebook Business Manager. This procedure helps to protect users from false information.
It can take some time for Facebook to check all the details and approve your Business Verification.
After the verification is successful, you will be able to add your phone number and the Display Name for your WhatsApp business profile. During the WhatsApp approval procedure, the WhatsApp team reviews the client’s request according to the WhatsApp Business Policy . You can check the status in the Facebook Business Manager account.
In contrast to the regular Business Account, an Official Business Account will receive a green checkmark
in the WhatsApp profile.
To receive the
status, the company needs to reach a number of notability requirements.
This is why Official Business Account applications rarely get approved. Please apply for an OBA only if you're sure that your business is notorious and impactful enough for Facebook's requirements.
Notability requires a business to represent a well-known, often searched brand or entity. This should not be taken as a signal of the authenticity of the business. A business is considered authentic if they have gone through the Business Verification which verifies the business as a legal entity and their access to the business.
Notability, on the other hand, reflects substantial presence in online news articles. Notability is assessed based on an account’s presence in news articles from publications with sizable audiences. Facebook does not consider paid or promotional content as sources for review, including business or app listings.
Official business accounts are issued at the phone number and display name level. Facebook assesses notability for the Display Name of the business account that is requesting OBA status —If the display name is changed after receiving the OBA status, the account will need to go through the approval process again.
Additionally, previous OBA approvals within a WhatsApp Business Account do not guarantee approval for other numbers (with different display names) associated with that account. If your WABA contains one main parent brand and the phone number associated with that brand meet notability requirements, we suggest updating the display names for the child brands as follows: '{{sub-brand name}} by {{notable name}}'.
If your OBA request has been denied, it means the Facebook team has carefully reviewed your account, and unfortunately, your account is not eligible for the OBA status at this time. Currently, these decisions cannot be appealed.
Businesses can continue to grow their presence and wait 90 days before submitting another Official Business Account request —It may take time to build the business's presence in news articles as described above.
In the meantime, this decision doesn't limit your ability to share your business details. Each phone number also has a business profile which includes profile picture, email, website, and business description. These are fields that you can edit at any time.
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 | jpeg, png | 5 MB |
| Audio | aac, mp4, amr , mpeg , ogg , opus | 16 MB |
| Video | mp4 , 3gpp | 16 MB |
| Sticker | image/jpeg, image/png | 100 MB |
| Document | text , pdf , msword , x-tar , powerpoint , excel | 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/
version 1 /wa/v1/ endpoints have been deprecated and you must use the new version starting from 01/02/2022.
Opt-in numbers to enable the receiving of business messages via WhatsApp.
The WhatsApp Business Policy outlines the following requirements:
Constraints
| Parameters | Description | Required | Values | Default |
|---|---|---|---|---|
| Blocking | Whether the API request should wait for processing to complete or not before returning a response. | Optional | no_wait , wait | no_wait |
| contacts | Array of phone numbers that you are validating. | Required | Phone format | N/A |
| force_check | Whether to check the contacts cache or not. normally cached for 7 days | Optional | false , true | false |
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.
The blocking parameter determines whether the request should wait for the processing to complete (synchronous) or not (asynchronous).
no_wait : The processing of the phone numbers is asynchronous. he 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.
The phone numbers in the contacts API request can be in any dialable format.
| Phone Number | Translated Phone Number | Valid? |
|---|---|---|
| +966-xxxxxxxxxx | +966xxxxxxxxxx | Yes |
| 966xxxxxxxxxx | 966xxxxxxxxxx | Not |
Media providers used for sending media links. A providers list allows you to have different media providers for the same provider type while being able to pick a provider to use on a per request basis.
| Parameter | Description | Required? |
|---|---|---|
| name | The name for the provider | Yes |
| type | The type of provider | Yes |
| config | The config object | Yes |
the config object can be a number of types
Basic type
| Parameter | Description | Required? |
|---|---|---|
| username | your-username | Yes |
| password | your-password | Yes |
bearer token
| Parameter | Description | Required? |
|---|---|---|
| bearer | your-bearer-token | Yes |
Use the messages node to send text messages, media/documents, and message templates to your customers.
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, image, etc.). See the following documentation for information regarding the type of messages you want to send:
You need to meet all the prerequisites listed in the Before You Start section of the Messages documentation.
The following types of message are supported: text, message templates, images, documents and audio.
By default, the mobile WhatsApp application recognizes URLs and makes them clickable. To include a URL preview, include "preview_url": true in the message body and make sure the URL begins with http:// or https://. A hostname is required, IP addresses are not matched.
| Parameter | Description | Required? | Default |
|---|---|---|---|
| recipient_type | The type of recipient the message is being sent to. | Optional | individual |
| preview_url | Allows for URL previews in text messages. | Only used with messages of text type. | - |
| to | The WhatsApp ID for the recipient of your message. | Required | contacts endpoint |
| type | The WhatsApp ID for the recipient of your message. | Required for all except for text messages | text |
| text | Required when type is set to text. | Required for all except for text messages | Text object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| body | Contains the text of the message, which can contain URLs and formatting. | Required | - |
You need to meet all the prerequisites listed in the Before You Start section of the Messages documentation.
| Parameter | Description | Required? | Default |
|---|---|---|---|
| recipient_type | The type of recipient the message is being sent to. | Optional | individual |
| preview_url | Allows for URL previews in text messages. | Only used with messages of text type. | - |
| to | The WhatsApp ID for the recipient of your message. | Required | contacts endpoint |
| type | The WhatsApp ID for the recipient of your message. | Required for all except for text messages | for image its image |
| template | Required when type is set to template. | Required | template object |
| Parameter | Description | Required? |
|---|---|---|
| name | Name of the template. | Required |
| language | Contains a language object. Specifies the language the template may be rendered in. | Required |
| components | Array of components objects containing the parameters of the message. | Optional |
| Parameter | Description | Required? |
|---|---|---|
| type | header, body, or button | Required |
| parameters | Array of parameter objects with the content of the message. | Optional |
| Parameter | Description | Required? |
|---|---|---|
| type | Values: text, image, document, video | Required |
Use the messages node to send messages containing audio, documents, images, stickers, or videos to your customers.
In essence, when you send a message that includes media, you must provide a link to the media in the request body. You must also specify the type of media that you are sending: audio, document, image, sticker, or video. When the request is received, the media is uploaded to the WhatsApp server and sent to the user indicated in the to field.
Currently, there are two ways to send media messages with the WhatsApp Business API:
You need:
Media Image is one of the whatsapp messages type can be send , it use /messages/ endpoint .
| Parameter | Description | Required? | Default |
|---|---|---|---|
| recipient_type | The type of recipient the message is being sent to. | Optional | individual |
| to | The WhatsApp ID for the recipient of your message. | Required | contacts endpoint |
| type | The WhatsApp ID for the recipient of your message. | Required | image |
| image | Required when type is set to image. | Required | Image object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| link | Allows for URL previews in text messages. | Required | - |
| caption | Describes the specified document, image, or video media. | Optional | contacts endpoint |
| filename | Describes the filename for the specific document. Use only with document media. | Optional | - |
| provider | when the link is not directly accessible and need additional config like a username and password. | Optional | Provider object |
| Parameter | Description | Required? |
|---|---|---|
| name | provider name if the media require auth for access. | Required |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| recipient_type | The type of recipient the message is being sent to. | Optional | individual |
| to | The WhatsApp ID for the recipient of your message. | Required | contacts endpoint |
| type | The WhatsApp ID for the recipient of your message. | Required | audio |
| audio | Required when type is set to audio. | Required | Audio object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| link | Allows for URL previews in text messages. | Required | - |
| caption | Describes the specified document, image, or video media. | Optional | contacts endpoint |
| filename | Describes the filename for the specific document. Use only with document media. | Optional | - |
| provider | when the link is not directly accessible and need additional config like a username and password. | Optional | Provider object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| recipient_type | The type of recipient the message is being sent to. | Optional | individual |
| to | The WhatsApp ID for the recipient of your message. | Required | contacts endpoint |
| type | The WhatsApp ID for the recipient of your message. | Required | video |
| video | Required when type is set to video. | Required | Video object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| link | Allows for URL previews in text messages. | Required | - |
| caption | Describes the specified document, image, or video media. | Optional | contacts endpoint |
| filename | Describes the filename for the specific document. Use only with document media. | Optional | - |
| provider | when the link is not directly accessible and need additional config like a username and password. | Optional | Provider object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| recipient_type | The type of recipient the message is being sent to. | Optional | individual |
| to | The WhatsApp ID for the recipient of your message. | Required | contacts endpoint |
| type | The WhatsApp ID for the recipient of your message. | Required | document |
| document | Required when type is set to document. | Required | Document object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| link | Allows for URL previews in text messages. | Required | - |
| caption | Describes the specified document, image, or video media. | Optional | contacts endpoint |
| filename | Describes the filename for the specific document. Use only with document media. | Optional | - |
| provider | when the link is not directly accessible and need additional config like a username and password. | Optional | Provider object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| recipient_type | The type of recipient the message is being sent to. | Optional | individual |
| to | The WhatsApp ID for the recipient of your message. | Required | contacts endpoint |
| type | The WhatsApp ID for the recipient of your message. | Required | location |
| location | Required when type is set to document. | Required | Location object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| link | Allows for URL previews in text messages. | Required | - |
| caption | Describes the specified document, image, or video media. | Optional | contacts endpoint |
| filename | Describes the filename for the specific document. Use only with document media. | Optional | - |
| provider | when the link is not directly accessible and need additional config like a username and password. | Optional | Provider object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| recipient_type | The type of recipient the message is being sent to. | Optional | individual |
| to | The WhatsApp ID for the recipient of your message. | Required | contacts endpoint |
| type | The WhatsApp ID for the recipient of your message. | Required | contacts |
| contacts | Required when type is set to document. | Required | Contacts object |
| Parameter | Description | Required? | Default |
|---|---|---|---|
| link | Allows for URL previews in text messages. | Required | - |
| caption | Describes the specified document, image, or video media. | Optional | contacts endpoint |
| filename | Describes the filename for the specific document. Use only with document media. | Optional | - |
| provider | when the link is not directly accessible and need additional config like a username and password. | Optional | Provider object |
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] |
The following webhook is received when a business sends a message as part of a user-initiated conversation (if that conversation did not originate in a free entry point):
| State | Description |
|---|---|
| deleted | A message send by the user was deleted by the user. Upon receiving this notification, you should ensure that the message is deleted from your system if it was downloaded from the server. |
| delivered | A message sent by your business was delivered to the user's device. |
| failed | A message sent by your business failed to send. A reason for the failure will be included in the callback. Check the error message documentation for help debugging: |
| read | A message sent by your business was read by the user. read notifications are only available for users that have read receipts enabled. For users that do not have it enabled, you only receive the delivered notification. |
| sent | A message sent by your business is in transit within our systems. |
| warning | A message your business sent contains an item in a catalog that is not available or does not exist. |
{
"statuses": [{
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "sent",
"timestamp": "TIMESTAMP",
"type": "message",
"conversation": {
"id": "CONVERSATION_ID",
"expiration_timestamp": TIMESTAMP,
"origin": {
"type": "user_initiated"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "user_initiated"
}
}]
}
The following webhook is received when a business sends a message as part of a business-initiated conversation:
{
"statuses": [{
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "sent",
"timestamp": "TIMESTAMP",
"type": "message",
"conversation": {
"id": "CONVERSATION_ID",
"expiration_timestamp": TIMESTAMP,
"origin": {
"type": "business_initiated"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "business_initiated"
}
}]
}
The following webhook is received when a business sends a message in reply to a user-initiated conversation originating from free entry points:
{
"statuses": [{
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "sent",
"timestamp": "TIMESTAMP",
"type": "message",
"conversation": {
"id": "CONVERSATION_ID",
"expiration_timestamp": TIMESTAMP,
"origin": {
"type": "referral_conversion",
}
},
"pricing": {
"pricing_model": "CBP",
"billable": false,
"category": "referral_conversion"
}
}]
}
The following webhook is received when a business’ message is delivered and that message is part of a user-initiated conversation (if that conversation did not originate in a free entry point):
{
"statuses": [{
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "delivered",
"timestamp": "TIMESTAMP",
"type": "message",
"conversation": {
"id": "CONVERSATION_ID",
"origin": {
"type": "user_initiated"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "user_initiated"
}
}]
}
The following webhook is received when a business’ message is delivered and that message is part of a business-initiated conversation:
{
"statuses": [{
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "delivered",
"timestamp": "TIMESTAMP",
"type": "message",
"conversation": {
"id": "CONVERSATION_ID",
"origin": {
"type": "business_initiated"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "business_initiated"
}
}]
}
The following webhook is received when a business’ message is delivered and that message is part of a user-initiated conversation originating from a free entry point:
{
"statuses": [{
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "delivered",
"timestamp": "TIMESTAMP",
"type": "message",
"conversation": {
"id": "CONVERSATION_ID",
"origin": {
"type": "referral_conversion",
}
},
"pricing": {
"pricing_model": "CBP",
"billable": false,
"category": "referral_conversion"
}
}]
}
Standard callback for a message read:
{
"statuses":[{
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "read",
"timestamp": "TIMESTAMP",
"type": "message"
}]
}
Error code 470
{
"statuses": [{
"errors": [{
"code": 470,
"title": "Failed to send message because you are outside the support window for freeform messages to this user. Please use a valid HSM notification or reconsider."
}],
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "failed",
"timestamp": "TIMESTAMP"
}]
}
Error code 480
{
"statuses": [{
"errors": [{
"code": 480,
"title": "Failed to send message since we detect an identity change of the contact"
}],
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "failed",
"timestamp": "TIMESTAMP"
}]
}
Standard callback for a deleted message:
{
"statuses": [{
"id": "ID",
"recipient_id": "WHATSAPP_ID",
"status": "deleted",
"timestamp": "TIMESTAMP",
"type": "message"
}]
}