Table of Contents
Send bulk chat messages. Requires “wa_send_bulk” API permission.POST https://androidapi.net/api/send/whatsapp.bulk
Parameter #
Field | Type | Description |
---|---|---|
secret | String | The API secret you copied from (Tools -> API Keys) page |
account | String | WhatsApp account you want to use for sending, you can get the account unique ID from /get/wa.accounts or in the dashboard. |
campaign | String | Name of the campaign, you will see this in the WhatsApp campaign manager. |
recipients (optional) | String | List of phone numbers or group addresses separated by commas. It can be optional if “groups” parameter is not empty. It will accept whatsapp group address E.164 formatted number or locally formatted numbers using the country code from your profile settings. Example for Philippines E.164: +639184661533 Local: 09184661533 |
groups (optional) | String | List of contact group ID’s separated by commas. It can be optional if “numbers” parameter is not empty. You can get group ID’s from /get/groups (Your contact groups). |
type | String | Type of WhatsApp message.Allowed values: "text" , "media" , "document" |
message | String | Message or caption you want to send, spintax and shortcodes are supported. |
media_file (optional) | File | This is for “media” and “button” type message only. The media file you want to attach in the WhatsApp message, it supports jpg, png, gif, mp4, mp3 and ogg files. Please use POST method if you are using this parameter. |
media_url (optional) | String | This is for “media” and “button” type message only. The media file url, please use direct link to the media file. It will be downloaded and be attached in the WhatsApp message, it supports jpg, png, gif, mp4, mp3 and ogg files. You can use GET method for this. |
media_type (optional) | String | This is for “media” type message only. You only need to enter this parameter if you are using “media_url” instead of “media_file”. You need to declare the file type of the media in the url you provided.Allowed values: "image" , "audio" , "video" |
document_file (optional) | File | This is for “document” type message only. The document file you want to attach in the WhatsApp message, it supports pdf, xls, xlsx, doc and docx files. Please use POST method if you are using this parameter. |
document_url (optional) | String | This is for “document” type message only. The document file url, please use direct link to the document file. It will be downloaded and be attached in the WhatsApp message, it also supports pdf, xls, xlsx, doc, and docx files. You can use GET method for this. |
document_name (optional) | String | This is for “document” type with “document_url” message only. The document file name, please include the file extension. For example: document.pdf |
document_type (optional) | String | This is for “document” type message only. You only need to enter this parameter if you are using “document_url” instead of “document_file”. You need to declare the file type of the document in the url you provided.Allowed values: "pdf" , "xls" , "xlsx" , "doc" , "docx" |
shortener (optional) | Number | Shortener ID, specify the shortener you want to use if you want to shorten the links in your message. You can get the list of available shorteners from /get/shortenersDefault value: none |
Success Response Format #
Field | Type | Description |
---|---|---|
status | Number | List of Codes 200 = Success |
message | String | Response message |
data | Array | Array of data |
Error Response Format #
Name | Type | Description |
---|---|---|
status | Number | List of Codes 400 = Invalid parameters 401 = Invalid API secret 403 = Access denied 404 = WhatsApp account doesn’t exist 500 = Something went wrong |
message | String | Response message |
data | Array | Array of data |
PHP Sample #
<?php
$chat = [
"secret" => "API_SECRET", // your API secret from (Tools -> API Keys) page
"account" => 1,
"type" => "text",
"campaign" => "bulk test",
"numbers" => "+923012345678,+639123456789,+639123456789",
"groups" => "1,2,3,4",
"phone" => "+923012345678",
"message" => "Hello World!"
];
$cURL = curl_init("https://androidapi.net/api/send/whatsapp.bulk");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURL, CURLOPT_POSTFIELDS, $chat);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
// do something with response
print_r($result);
Python Sample #
import requests
# your API secret from (Tools -> API Keys) page
apiSecret = "API_SECRET"
chat = {
"secret": apiSecret,
"account": 1,
"type": "text",
"campaign": "bulk test",
"numbers": "+923012345678,+639123456789,+639123456789",
"groups": "1,2,3,4",
"phone": "+923012345678",
"message": "Hello World!"
}
r = requests.post(url = "https://androidapi.net/api/send/whatsapp.bulk", params = chat)
# do something with response object
result = r.json()
Successful Response #
{
"status": 200,
"message": "WhatsApp bulk chats has been queued!",
"data": false
}
Error Response #
{
"status": 400,
"message": "Invalid Parameters!",
"data": false
}