What can you do with this API?
Send Whatsapp Message to a phone number or group of phone numbers through our API. HTTP API sends a WhatsApp message using POST and form-encoded data. The URL you use to send a WhatsApp message has a required field called user_name and password, which is unique and assigned to your account
For Existing User
Credit Check
https://send2.digital/whatsapp/api/check_balance.php?user_name=XXXXXXXXXX&password=XXXXXXXX
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type |
---|---|---|
user_name | user_name provided by Leeway Softtech | Mandatory |
password | password provided by Leeway Softtech | Mandatory |
Add Template
https://send2.digital/whatsapp/api/template_api.php?user_name=XXXXX&password=XXXXXX&temp_type=XXXXX&temp_id=XXXXX&category=XXXXX&media_type=XXXXX&language=XXX&message=XXXXXX&footer_txt=XXXXX&button_type=XXXXX
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type |
---|---|---|
user_name | user_name provided by Leeway Softtech | Mandatory |
password | password provided by Leeway Softtech | Mandatory |
temp_type | sales,support | Mandatory |
temp_id | unique id (only lowercase alphabets, numbers and underscores allowed. Other characters or spaces are not allowed) |
Mandatory |
category | MARKETING,UTILITY,AUTHENTICATION | Mandatory |
media_type | none,text, image, video, document, location Pass media_text as well if you choose media_type as text. | Mandatory |
language | example en, refer language and locale code. | Mandatory |
message | template message (base64_encode) [Max 1024 characters]. If message contains any variable then pass the numbers in {{}}. for ex. This is test message from {{1}}. Thank you for choosing {{2}} services. |
Mandatory |
footer_txt | template footer [Max 60 characters] | Optional |
button_type | quick,cta,quick_optout,no Only when you add the template category "MARKETING" will the quick_optout button be added. | Mandatory |
NOTE |
if button_type = quick , total_button= 1,2,3 [required] if button_type = add quick_reply1, quick_reply2, quick_reply3 [required] |
|
if button_type = quick_optout , total_button= 1 [required] if button_type = quick_optout add quick_reply1 [required] | ||
if button_type = cta total_button= 1,2 [required] if button_type = add phone_label, phone_number, url_label, url [required] |
||
Variable({{1}}) is able to passed along with media_text and url. There can be only one variable ({{1}}) allowed. Button Label Max 24 characters |
Template Status
https://send2.digital/whatsapp/api/template_status.php?user_name=XXXXX&password=XXXXX&temp_id=XXXXX&language=XXXXX
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type |
---|---|---|
user_name | user_name provided by Leeway Softtech | Mandatory |
password | password provided by Leeway Softtech | Mandatory |
temp_id | Your Template id | Mandatory |
language | example en, refer language and locale code. | Mandatory |
Send Message
https://send2.digital/whatsapp/api/sendwhatsapp_1.php?user_name=XXXXXX&password=XXXXXXX&template_name=XXXXX&number=XXXXXXXXXX&media_type=XXXXX&media_link=XXXXXXXX&variable=XXXX,XXXX
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type |
---|---|---|
user_name | user_name provided by Leeway Softtech | Mandatory |
password | password provided by Leeway Softtech | Mandatory |
template_name | Approved Template Name to Send Whatsapp. | Mandatory |
number | Number to Send WhatsApp. ( Add Numbers With Country Code. ) | Mandatory |
media_type | If Template Approved With Media Than Add Media Type. Example : none OR text OR image OR document OR video OR location. |
Mandatory |
media_link | If Template Approved With Media Than Add Media URL( URL encode with base64_encode ) | Optional |
Location Value | Add the value below if the template is approved with location media. 1. location_longitude 2. location_latitude 3. location_name 4. location_address | Optional |
variable | Variable Means Normal text Message. If Template Approved With Variable Than Add Variable Value. Multiple Variable's set with (,) seprated |
Optional |
cta_variable | Variable Means Normal text Message. If Template Approved With CTA button variable Than Add cta_var Value. Multiple Variable's set with (,) seprated |
Optional |
header_variable | If Template Approved With Header text variable Than Add header_variable Value. | Optional |
coupon_code | If Template Approved With Coupon Code Than Add coupon_code Value. | Optional |
Send Message Bulk
https://send2.digital/whatsapp/api/sendwhatsapp_bulk.php?user_name=XXXXXX&password=XXXXXXX&template_name=XXXXX&number=XXXXXXX,xxxx,xxxx,xxxx&media_type=XXXXX&media_link=XXXXXXXX&variable=XXXX,XXXX
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type |
---|---|---|
user_name | user_name provided by Leeway Softtech | Mandatory |
password | password provided by Leeway Softtech | Mandatory |
template_name | Approved Template Name to Send Whatsapp. | Mandatory |
number | Number to Send WhatsApp. ( Add Numbers With Country Code. ) | Mandatory |
media_type | If Template Approved With Media Than Add Media Type. Example : none OR text OR image OR document OR video OR location. |
Mandatory |
media_link | If Template Approved With Media Than Add Media URL( URL encode with base64_encode ) | Optional |
Location Value | Add the value below if the template is approved with location media. 1. location_longitude 2. location_latitude 3. location_name 4. location_address | Optional |
variable | Variable Means Normal text Message. If Template Approved With Variable Than Add Variable Value. Multiple Variable's set with (,) seprated |
Optional |
cta_variable | Variable Means Normal text Message. If Template Approved With CTA button variable Than Add cta_var Value. Multiple Variable's set with (,) seprated |
Optional |
header_variable | If Template Approved With Header text variable Than Add header_variable Value. | Optional |
coupon_code | If Template Approved With Coupon Code Than Add coupon_code Value. | Optional |
Send Report API
https://send2.digital/whatsapp/api/get_report.php?user_name=XXXXXXX&password=XXXXXX&from_date=YYYY-MM-DD&to_date=YYYY-MM-DD
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type | user_name | user_name provided by Leeway Softtech | Mandatory |
---|---|---|
password | password provided by Leeway Softtech | Mandatory |
from_date | from_date of report | Mandatory |
to_date | to_date of report | Mandatory |
Report API Bulk
https://send2.digital/whatsapp/api/get_report.php?user_name=XXXXXXX&password=XXXXXX&from_date=YYYY-MM-DD&to_date=YYYY-MM-DD&msgid=xxxx
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type | user_name | user_name provided by Leeway Softtech | Mandatory |
---|---|---|
password | password provided by Leeway Softtech | Mandatory |
from_date | from_date of report | Mandatory |
to_date | to_date of report | Mandatory |
msgid | msgid which you received from submit time | Mandatory |
Incoming Message Report API
https://send2.digital/whatsapp/api/incoming_msg.php?user_name=XXXX&password=XXXX&from_date=XXXXX&to_date=XXXXXXXX
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type | user_name | user_name provided by Leeway Softtech | Mandatory |
---|---|---|
password | password provided by Leeway Softtech | Mandatory |
from_date | from_date of report | Mandatory |
to_date | to_date of report | Mandatory |
Session Message Send API
https://send2.digital/whatsapp/api/session_message.php?user_name=XXXX&password=XXXX&contact_no=xxxxxxxxxxxx&message_type=xxxx&message=xxxxxx
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type | user_name | user_name provided by Leeway Softtech | Mandatory | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
password | password provided by Leeway Softtech | Mandatory | ||||||||||||||||||
contact no | Mobile number to send message | Mandatory | ||||||||||||||||||
message type | type of message to send
|
Mandatory | ||||||||||||||||||
message |
message to send
|
Mandatory |
Add Template New
https://send2.digital/whatsapp/api/template_api.php?user_name=XXXXX&password=XXXXXX&temp_type=XXXXX
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
Args | Value | Type |
---|---|---|
user_name | user_name provided by Leeway Softtech | Mandatory |
password | password provided by Leeway Softtech | Mandatory |
temp_type | sales,support | Mandatory |
Request Body Parameters
Placeholder | Description | Sample Value |
---|---|---|
NAME | Required. Template name. Maximum 512 characters. | order_confirmation |
CATEGORY | Required. Template category. [MARKETING, UTILITY, AUTHENTICATION] | UTILITY |
LANGUAGE | Required. refer language and locale code. | en_US |
COMPONENTS | Required. Components that make up the template. | HEADER, FOOTER, BODY, BUTTONS |
Components Parameters
Header
Syntax
{
"type": "HEADER",
"format": "TEXT",
"text": "TEXT",
# Required if TEXT string contains variables
"example": {
"header_text": [
"HEADER_TEXT"
]
}
}
Placeholder | Description | Sample Value |
---|---|---|
HEADER_TEXT | Sample header text. | Summer Sale |
TEXT | Text to appear in template header when sent. Supports 1 variable. If the string contains a variable, you must include the example property and a sample variable value. 60 characters maximum. | Our {{1}} is on! |
Example
{
"type": "HEADER",
"format": "TEXT",
"text": "Our {{1}} is on!",
"example": {
"header_text": [
"Summer Sale"
]
}
}
Media Headers
Media headers can be an image, video, or a document such as a PDF. All media must be uploaded with the Resumable Upload API. The syntax for defining a media header is the same for all media types.
Syntax
{ "type": "HEADER", "format": "FORMAT", "example": { "header_handle": [ "HEADER_HANDLE" ] } }
Placeholder | Description | Sample Value |
---|---|---|
FORMAT | Indicates media asset type. Set to IMAGE, VIDEO, or DOCUMENT. | IMAGE |
HEADER_HANDLE | Uploaded media asset handle. Use the Resumable Upload API to generate an asset handle. | 4::aW... |
Example
{
"type": "HEADER",
"format": "IMAGE",
"example": {
"header_handle": [
" 4::aW..."
]
}
}
Location Headers
Location headers appear as generic maps at the top of the template and are useful for order tracking, delivery updates, ride hailing pickup/dropoff, locating physical stores, etc. When tapped, the app user's default map app will open and load the specified location. Locations are specified when you send the template using the Cloud API or On-Premises API.
Location headers can only be used in templates categorized as UTILITY or MARKETING. Real-time locations are not supported.
Syntax
{ "type": "HEADER", "format": "LOCATION" }
Property values cannot be customized.
Example
{
"type": "HEADER",
"format": "LOCATION"
}
Body
Body components are text-only components and are required by all templates. Templates are limited to one body component.
Syntax
{
"type": "BODY",
"text": "TEXT",
# Required if TEXT string contains variables
"example": {
"body_text": [
[
BODY_TEXT
]
]
}
}
Placeholder | Description | Sample Value |
---|---|---|
BODY_TEXT | Sample header text. | "the end of August","25OFF","25%" |
TEXT | Text string. Supports multiple variables. If the string contains variables, you must include the example property and sample variable values. 1024 characters maximum. | Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise. |
Example
{
"type": "BODY",
"text": "Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.",
"example": {
"body_text": [
[
"the end of August","25OFF","25%"
]
]
}
}
Footer
Footers are optional text-only components that appear immediately after the body component. Templates are limited to one footer component.
Syntax
{
"type": "FOOTER",
"text": "TEXT"
}
Placeholder | Description | Sample Value |
---|---|---|
TEXT | Text to appear in template footer when sent. 60 characters maximum. | Use the buttons below to manage your marketing subscriptions |
Example
{
"type": "FOOTER",
"text": "Use the buttons below to manage your marketing subscriptions"
}
Buttons
Buttons are optional interactive components that perform specific actions when tapped. Templates can have a mixture of up to 10 button components total, although there are limits to individual buttons of the same type as well as combination limits. These limits are described below.
Buttons are defined within a single buttons component object, packed into a single buttons array. For example, this template uses a phone number button and a URL button:
{ "type": "BUTTONS", "buttons": [ { "type": "PHONE_NUMBER", "text": "Call", "pho ne_number": "15550051310" }, { "type": "URL", "text": "Shop Now", "url": "https://www.luckyshrub.com/shop/" } ] }
If a template has more than three buttons, two buttons will appear in the delivered message and the remaining buttons will be replaced with a See all options button. Tapping the See all options button reveals the remaining buttons.
Phone Number Buttons
Phone number buttons call the specified business phone number when tapped by the app user. Templates are limited to one phone number button.
Syntax
{
"type": "PHONE_NUMBER",
"text": "TEXT",
"phone_number": "PHONE_NUMBER"
}
Placeholder | Description | Sample Value |
---|---|---|
PHONE_NUMBER | Alphanumeric string. Business phone number to be (display phone number) called when the user taps the button. 20 characters maximum. | 15550051310 |
TEXT | Button label text. 25 characters maximum. | Call |
Example
{
"type": "PHONE_NUMBER",
"text": "Call",
"phone_number": "15550051310"
}
URL Buttons
URL buttons load the specified URL in the device's default web browser when tapped by the app user. Templates are limited to two URL buttons.
Syntax
{
"type": "URL",
"text": "TEXT",
"url": "URL",
# Required if URL contains a variable
"example": [
"EXAMPLE"
]
}
Placeholder | Description | Sample Value |
---|---|---|
EXAMPLE | URL of website. Supports 1 variable. If using a variable, add sample variable property to the end of the URL string. The URL loads in the device's default mobile web browser when the customer taps the button. 2000 characters maximum. | https://www.luckyshrub.com/shop?promo=summer2023 |
TEXT | Button label text. Supports 1 variable. If using a variable, must include the example property and a sample value. 25 characters maximum. | Shop Now |
URL | URL of website that loads in the device's default mobile web browser when the button is tapped by the app user. Supports 1 variable, appended to the end of the URL string. 2000 characters maximum. | https://www.luckyshrub.com/shop?promo={{1}} |
Example
{
"type": "URL",
"text": "Shop Now",
"url": "https://www.luckyshrub.com/shop?promo={{1}}",
"example": [
"summer2023"
]
}
Quick Reply Buttons
Quick reply buttons are custom text-only buttons that immediately message you with the specified text string when tapped by the app user. A common use case-case is a button that allows your customer to easily opt-out of any marketing messages.
Templates are limited to 10 quick reply buttons. If using quick reply buttons with other buttons, buttons must be organized into two groups: quick reply buttons and non-quick reply buttons. If grouped incorrectly, the API will return an error indicating an invalid combination.
Examples of valid groupings:
- Quick Reply, Quick Reply
- Quick Reply, Quick Reply, URL, Phone
- URL, Phone, Quick Reply, Quick Reply
Examples of invalid groupings:
- Quick Reply, URL, Quick Reply
- URL, Quick Reply, URL
When using the Cloud API or On-Premises API to send a template that has multiple quick reply buttons, you can use the index property to designate the order in which buttons appear in the template message.
Syntax
{
"type": "QUICK_REPLY",
"text": "TEXT"
}
Placeholder | Description | Sample Value |
---|---|---|
TEXT | Button label text. 25 characters maximum. | Unsubscribe |
Example
{
"type": "QUICK_REPLY",
"text": "Unsubscribe from Promos"
}
Copy Code Buttons
Copy code buttons copy a text string (defined when the template is sent in a template message) to the device's clipboard when tapped by the app user. Templates are limited to one copy code button.
Syntax
{
"type": "COPY_CODE",
"example": "EXAMPLE"
}
Placeholder | Description | Sample Value |
---|---|---|
EXAMPLE | String to be copied to device's clipboard when tapped by the app user. Maximum 15 characters. | 250FF |
Example
{
"type": "COPY_CODE",
"text": "250FF"
}
Credit Check
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/check_balance.php?user_name=XXXXXXXXXX&password=XXXXXXXX
Example Response
Add Template
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/template_api.php?user_name=XXXXX&password=XXXXXX&temp_type=XXXXX&temp_id=XXXXX&category=XXXXX&media_type=XXXXX&language=XXX&message=XXXXXX&footer_txt=XXXXX&button_type=XXXXX
Example Response
Template Status
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/template_status.php?user_name=XXXXX&password=XXXXX&temp_id=XXXXX&language=XXXXX
Example Response
Send Message
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/sendwhatsapp_1.php?user_name=XXXXXX&password=XXXXXXX&template_name=XXXXX&number=XXXXXXXXXX&media_type=XXXXX&media_link=XXXXXXXX&variable=XXXX,XXXX
Example Response
Send Message Bulk
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/sendwhatsapp_bulk.php?user_name=XXXXXX&password=XXXXXXX&template_name=XXXXX&number=XXXXX,xxxxx,xxx,xxx&media_type=XXXXX&media_link=XXXXXXXX&variable=XXXX,XXXX
Example Response
Send Report API
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/get_report.php?user_name=XXXXXXX&password=XXXXXX&from_date=YYYY-MM-DD&to_date=YYYY-MM-DD
Example Response
Report API Bulk
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/get_report_bulk.php?user_name=XXXXXXX&password=XXXXXX&from_date=YYYY-MM-DD&to_date=YYYY-MM-DD&msgid=xxx
Example Response
Incoming Message Report API
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/incoming_msg.php?user_name=XXXX&password=XXXX&from_date=XXXXX&to_date=XXXXXXXX
Example Response
[{"messageid":"XXXXXXXXXXXXX","Number":"919876543210","Message":"http://domain-name/webhook_media/XXXXXXXXXXXXXXmedia.jpeg","status":"received","Date":"2023-04-28 11:41:41"}]
Session Message Send API
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/session_message.php?user_name=XXXX&password=XXXX&contact_no=xxxxxxxxxx&message_type=xxxx&message=xxxxxx
Example Response
Message Sent Successfully
Add Template New
Example Request
curl --location --request POST
https://send2.digital/whatsapp/api/template_api.php?user_name=XXXXX&password=XXXXXX&temp_type=XXXXX
--header 'Content-Type: application/json'
--data '{
"name": "XXXXXXXX",
"language": "XXXX",
"category": "XXXXXXXXX",
"components": []
}'