Send Multi Messages API
End Point: https://wbiztool.com/api/v1/send_msg/multi/
Request Type: POST
Required Fields in Request
-
client_id (Integer)
- Your Client Id (Given on API Keys page) -
api_key (String)
- Your API Key (Given on API Keys page) -
whatsapp_client (Integer)
- Your WhatsApp Client Id (Given on Whatsapp Setting Page) -
msg_type (Integer)
- 0 for Text msg, 1 for Image with msg, 2 for File with msg -
phone (String)
- Comma-separated list of recipient WhatsApp numbers (with country code) and/or WhatsApp group names. The API automatically detects whether each item is a phone number (numerical) or group name (text). eg: "919632066772,Sales Team,919876543210,Marketing Group" -
msg (String)
- Message Text
Optional Fields in Request
-
img_url (String, Optional)
- Image Url (Mandatory when msg_type is 1) and url should be ending with valid image extension (.png, .jpg, .jpeg etc) -
file_url (String, Optional)
- File Url from which file can be directly downloaded (Mandatory when msg_type is 2 and file is not uploaded) -
file_name (String, Optional)
- File Name (Mandatory when msg_type is 2) -
file (FILE, Optional)
- File(Mandatory when msg_type is 2 and file_url is not provided) -
country_code (string)
- Receiver's country code. eg: 91 for india, 1 for USA -
webhook (String, Optional)
- Webhook Url where msg_id and status will be posted
Fields in Response
-
msg_ids (Array)
- Array of message IDs for each successfully created message. You can save these IDs to check the status of particular messages. -
messages (Array)
- Array of objects containing msg_id, contact, and is_group for each message -
message (String)
- Readable status of your request -
status (Integer)
- 1 if successful, 0 if there is error
Example
Use this API to send the same message to multiple recipients efficiently. You can mix phone numbers and group names, separated by commas. Phone numbers are automatically detected (numerical values), while text values are treated as group names.
curl -X POST https://wbiztool.com/api/v1/send_msg/multi/ -d '{
"client_id": "client_id",
"api_key": "api_key",
"whatsapp_client": "whatsapp_client_id",
"msg_type": 0,
"msg": "Hi, This is a *test* msg from _WbizTool.com_",
"phone": "919632066772,Sales Team,919876543210,Marketing Group",
"country_code": "91"
}'
// Response
{
"status": 1,
"message": "Successfully created 4 messages",
"msg_ids": [12345, 12346, 12347, 12348],
"messages": [
{"msg_id": 12345, "contact": "919632066772", "is_group": false},
{"msg_id": 12346, "contact": "Sales Team", "is_group": true},
{"msg_id": 12347, "contact": "919876543210", "is_group": false},
{"msg_id": 12348, "contact": "Marketing Group", "is_group": true}
]
}
Send Messages to Multiple Recipients with Python
Use our official Python package: We recommend using our official Python client for easier integration.
Install it with:
Install it with:
pip install wbiztool-client
Normal Text Message to Multiple Recipients
import requests
data = {
"client_id": "client_id",
"api_key": "api_key",
"whatsapp_client": "whatsapp_client_id",
"msg_type": 0,
"msg": "Hi, This is a *test* msg from _WbizTool.com_",
"phone": "919632066772,Sales Team,919876543210,Marketing Group",
"country_code": "91"
}
url = 'https://wbiztool.com/api/v1/send_msg/multi/'
response = requests.post(url, data=data)
result = response.json()
print(f"Status: {result['status']}")
print(f"Message: {result['message']}")
Send Messages to Multiple Recipients with PHP
$url = 'https://wbiztool.com/api/v1/send_msg/multi/';
$data = 'client_id=client_id&api_key=api_key&whatsapp_client=whatsapp_client_id&msg_type=0&phone=919632066772,Sales Team,919876543210,Marketing Group&country_code=91&msg=Hi, This is a test message';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$result = json_decode($response, true);
echo "Status: " . $result['status'] . "\n";
echo "Message: " . $result['message'] . "\n";
curl_close($ch);
Send Messages to Multiple Recipients with Node.js
Use our official Node.js package: We recommend using our official Node.js client for easier integration.
Install it with:
Install it with:
npm install wbiztool-client
const request = require('request');
const data = {
client_id: "client_id",
api_key: "api_key",
whatsapp_client: "whatsapp_client_id",
msg_type: 0,
msg: "Hi, This is a *test* msg from _WbizTool.com_",
phone: "919632066772,Sales Team,919876543210,Marketing Group",
country_code: "91"
};
const options = {
url: 'https://wbiztool.com/api/v1/send_msg/multi/',
method: 'POST',
form: data
};
request(options, (error, response, body) => {
if (!error && response.statusCode === 200) {
const result = JSON.parse(body);
console.log(`Status: ${result.status}`);
console.log(`Message: ${result.message}`);
} else {
console.log('Request failed:', error);
}
});