Introduction
The wa.sendpk.com API enables businesses to communicate with customers through WhatsApp, offering features such as automated messaging, template-based notifications, and integration with CRM systems. It supports sending and receiving text, images, and media, while ensuring data security and compliance with WhatsApp's guidelines. The API facilitates efficient customer interactions, automation, and analytics to enhance engagement and support.
How to get started
Easy. Only two steps actually:
1. Create an account at wa.sendpk.com
In order to use our API, you will need api_token
. This can be obtained by creating an account and then by logging in to the customer portal.
2. Copy api_token
api_token
can be obtained on the profile page. Here is the page profile link:
Simple Template API (Fixed Content)
Click here for Postman LibraryTo Send A Template Message First Of All We Need To Approve An Template From Whatsapp
For Example, We Have Approved The Following Template Message:
“Thank you for your order! We have received your order and are currently processing it. You will receive updates as your order moves forward. If you have any questions, feel free to contact us”

Please note that this message has no variable (meaning you can't change anything in the message content, it is fixed). If you have variables like {{}}, you can change the text as per your need, which will be discussed in the next chapter.
To Send This Message, Simply We Need The Following Parameters in Our URL:
Successful Response
{
"success": "true",
"method": "API",
"message_type": "TEMPLATE",
"total_price": "1",
"total_gsm": "1",
"remaining_credit": "912",
"results": [
{
"status": "OK",
"id": "5da97116-6d63-496c-a5d4-38a54b089248",
"mobile": "92XXXXXX"
}
]
}

To Send Message To More Than 2 People:
Simply add the numbers in the following JSON format in template_data
parameter:
[
{
"mobile": "92313XXXX"
},
{
"mobile": "92300XXXX"
},
{
"mobile": "92340XXXXX"
}
]
Successful Response
{
"success": "true",
"method": "API",
"message_type": "TEMPLATE",
"total_price": "3",
"total_gsm": "3",
"remaining_credit": "906",
"results": [
{
"status": "OK",
"id": "3266e0c2-c494-4451-80b1-dd0096b9c6be",
"mobile": "9234XXXX"
},
{
"status": "OK",
"id": "1455604f-a984-499e-bddc-1c333823f1aa",
"mobile": "9230XXXX"
},
{
"status": "OK",
"id": "fa18f99c-b757-4a67-a630-56b6af62fa94",
"mobile": "9231XXXX"
}
]
}
Dynamic Template API
With this API, we can dynamically modify the message header and body content, which can include text, images, or media files. This flexibility enables you to tailor messages to fit various needs and contexts, providing a more personalized and engaging experience for recipients.
Click here for Postman LibraryTo Send A Template Message First Of All We Need To Approve An Template From Whatsapp
For Example, We Have Approved The Following Template Message:
“Hi {{1}},
Your order has been successfully placed!
The total amount is {{2}}
Thank you for choosing us!”

Please Note, In the Dynamic Template API, placeholders such as {{1}}
& {{2}}
are used to represent dynamic variables within the message template. These placeholders can be replaced with specific values as needed to customize the message for each recipient.
{{1}}
This placeholder corresponds to the first dynamic variable in the message template.{{2}}
This placeholder corresponds to the second dynamic variable in the message template.
To send a Dynamic Template message with these placeholders, use the following URL:
Parameter template_data Sample: [{"mobile":"RECIPIENT_NUMBER","body":[{"type":"text","text":"Abdul Basit"},{"type":"text","text":"1500"}]}]
Successful Response
{
"success": "true",
"method": "API",
"message_type": "TEMPLATE",
"total_price": "1",
"total_gsm": "1",
"remaining_credit": "906",
"results": [
{
"status": "OK",
"id": "8ed138a8-d9dd-41c8-833d-d314c269493e",
"mobile": "9231341XXXX"
}
]
}

To Send Message To More Than 2 People:
Simply add the numbers in the following JSON format in template_data
parameter:
[
{
"mobile": "92313XXXXX",
"body": [
{
"type": "text",
"text": "Abdul Basit"
},
{
"type": "text",
"text": "1500"
}
]
},
{
"mobile": "92300XXXX",
"body": [
{
"type": "text",
"text": "Abdul Qayyoum"
},
{
"type": "text",
"text": "2000"
}
]
}
]
Successful Response
{
"success": "true",
"method": "API",
"message_type": "TEMPLATE",
"total_price": "2",
"total_gsm": "2",
"remaining_credit": "906",
"results": [
{
"status": "OK",
"id": "3266e0c2-c494-4451-80b1-dd0096b9c6be",
"mobile": "9234XXXX"
},
{
"status": "OK",
"id": "1455604f-a984-499e-bddc-1c333823f1aa",
"mobile": "9230XXXX"
}
]
}
Media Template API
The Media API supports sending media files such as images and documents.
Click here for Postman LibraryTo send a media message, you must have an approved template from WhatsApp. For example, we have an approved template featuring an image with dynamic text content.
“Hi {{1}},
This is to confirm your order of the {{2}} watch.
The total price is {{3}}.
Thank you for your purchase ”
Please Note, In this Template, placeholders such as {{1}}
, {{2}}
& {{3}}
are used to represent dynamic variables within the message template. These placeholders can be replaced with specific values as needed to customize the message for each recipient.
{{1}}
This placeholder corresponds to the first dynamic variable in the message template.{{2}}
This placeholder corresponds to the second dynamic variable in the message template.{{3}}
This placeholder corresponds to the third dynamic variable in the message template.

template_data
Paramter Will be
[
{
"mobile": "RECIPIENT_NUMBER",
"header": {
"type": "image",
"url": "https://wa.sendpk.com/assets-front-end/images/api_docs/watch.jpg"
},
"body": [
{
"type": "text",
"text": "Abdul Hadi"
},
{
"type": "text",
"text": "Apple Watch Ultra 2"
},
{
"type": "text",
"text": "$ 800"
}
]
}
]
As you can see in the JSON, the "header"
contains:
"type": "image"
header should be the
image document video textIf you skip the "header"
in the JSON, the default media will be attached during WhatsApp's template approval time.
You can provide your own media URL to include dynamic content such as images, documents, or any other media files. This allows you to personalize the media in your messages, making it adaptable to different contexts and purposes.
Follow this URL as a Sample:
Successful Response
{
"success": "true",
"method": "API",
"message_type": "TEMPLATE",
"total_price": "1",
"total_gsm": "1",
"remaining_credit": "906",
"results": [
{
"status": "OK",
"id": "8ed138a8-d9dd-41c8-833d-d314c269493e",
"mobile": "9231341XXXX"
}
]
}

Header, Body, Footer Template API
Click here for Postman Library
A WhatsApp template can consist of 3 key elements: , , and . The is mandatory, while the and are optional.
The allows for a maximum of 60 characters and can include 1 dynamic variable if it consists of text. In contrast, the supports up to 1024 characters and can accommodate over 50 dynamic variables, making it the most flexible section.
The , like the , is limited to 60 characters but does not support any dynamic variables.
Please ensure that these specifications are adhered to in order to create a valid template.
In this template, we will send a message that consists of three main elements: a header, a body, and a footer.
To Send A Template Message First Of All We Need To Approve An Template From Whatsapp
For Example, We Have Approved The Following Template Message:
Hi {{1}}, Upcoming Scheduled Payment
Thank you for scheduling your payment of {{1}} for your {{2}} account on {{3}}
visit your account if you would like to make any changes.

Please Note, In this Template, placeholders such as {{1}}
in header & {{1}}
, {{2}}
variable are used in body to represent dynamic values within the message template. These placeholders can be replaced with specific values as needed to customize the message for each recipient.
To send a Dynamic Template message with these placeholders, use the following URL:
Parameter template_data Sample: [{"mobile":"RECIPIENT_NUMBER","header":{"type":"text","text":"Luqman Rasul"},"body":[{"type":"text","text":"$ 180"},{"type":"text","text":"CS Mutual Debit Plus"},{"type":"text","text":"Jan 1, 2024"}]}]
Successful Response
{
"success": "true",
"method": "API",
"message_type": "TEMPLATE",
"total_price": "1",
"total_gsm": "1",
"remaining_credit": "906",
"results": [
{
"status": "OK",
"id": "8ed138a8-d9dd-41c8-833d-d314c269493e",
"mobile": "9231341XXXX"
}
]
}

Header, Body, Footer, Button Template API
Click here for Postman Library
A WhatsApp template can consist of 4 key elements: , , & . The is mandatory, while the , & are optional.
The allows for a maximum of 60 characters and can include 1 dynamic variable if it consists of text. In contrast, the supports up to 1024 characters and can accommodate over 50 dynamic variables, making it the most flexible section.
The , like the , is limited to 60 characters but does not support any dynamic variables. Up to 13, including 2 website , 1 call , & 10 quick reply .
Please ensure that these specifications are adhered to in order to create a valid template.
In this template, we will send a message that consists of three main elements: a header, a body, and a footer.
To Send A Template Message First Of All We Need To Approve An Template From Whatsapp
For Example, We Have Approved The Following Template Message:
Order shipped, Order ID {{1}}
{{1}}, your order has shipped!
Your tracking number is {{2}}.
Estimated delivery is {{3}}.We will continue to provide updates on this shipment.
Please Note, In this Template, placeholders such as {{1}}
in header & {{1}}
, {{2}}
& {{3}}
variable are used in body to represent dynamic values within the message template. These placeholders can be replaced with specific values as needed to customize the message for each recipient.

To send a Dynamic Template message with these placeholders & buttons, use the following URL:
Parameter template_data Sample: [{"mobile":"RECIPIENT_NUMBER","header":{"type":"text","text":"66457"},"body":[{"type":"text","text":"Mubashar Shahzad"},{"type":"text","text":"3434656-43434-33"},{"type":"text","text":"22 December 2024"}],"button":[{"type":"url","text":"/url-trackering-address/"}]}]
Successful Response
{
"success": "true",
"method": "API",
"message_type": "TEMPLATE",
"total_price": "1",
"total_gsm": "1",
"remaining_credit": "906",
"results": [
{
"status": "OK",
"id": "8ed138a8-d9dd-41c8-833d-d314c269493e",
"mobile": "9231341XXXX"
}
]
}

Please Note! When creating templates, it's important to understand that not all buttons need to be defined in the JSON under the button variable. Specifically, only the buttons that include dynamic website URLs should be mentioned there. Static buttons or buttons that do not change based on the content do not need to be included in the button variable. For example, if you have a static button in your template that links to a fixed URL, you don't need to mention it in the JSON. However, if the button's URL is dynamic and changes based on the content you're sending, then it should be included in the JSON. Let's say your main domain is 'https://example.com/', and you have a dynamic URL path that varies depending on the report you send. In such cases, you would specify this dynamic path in the JSON as follows:
"button": [
{
"type": "url",
"text": "/url-tracking-address/"
}
]
Here, '/url-tracking-address/'
is a dynamic part that will be added to the main domain, resulting in a complete URL like 'https://example.com/url-tracking-address/' This method allows you to customize URLs easily without hardcoding every possible button link directly into the template, giving you more flexibility in your messaging.