WhatsApp Connect API
End Point: https://wbiztool.com/api/v1/whatsapp/connect/
Request Type: POST
Required Fields in Request
Fields in Response
-
status (Integer)
- 1 if WhatsApp client created successfully, 0 if error -
message (String)
- Response message describing the result -
whatsapp_client_id (Integer)
- ID of the created WhatsApp client (only on success)
Example
Use this API to programmatically create a new WhatsApp client connection. The webhook URL will receive status updates about the connection process.
curl -X POST https://wbiztool.com/api/v1/whatsapp/connect/ -d '{
"client_id": "client_id",
"api_key": "api_key",
"whatsapp_number": "919876543210",
"webhook_url": "https://yoursite.com/webhook"
}'
// Response (Success)
{"status": 1, "message": "Whatsapp Client Created", "whatsapp_client_id": 123}
// Response (Error)
{"status": 0, "message": "Already Connected With Given Number"}
Connect WhatsApp Account 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
import requests
data = {
"client_id": "client_id",
"api_key": "api_key",
"whatsapp_number": "919876543210",
"webhook_url": "https://yoursite.com/webhook"
}
url = 'https://wbiztool.com/api/v1/whatsapp/connect/'
response = requests.post(url, data=data)
result = response.json()
if result['status'] == 1:
print("WhatsApp client created successfully!")
print(f"WhatsApp Client ID: {result['whatsapp_client_id']}")
print(f"Message: {result['message']}")
else:
print(f"Error: {result['message']}")
Connect WhatsApp Account with PHP
$url = 'https://wbiztool.com/api/v1/whatsapp/connect/';
$data = 'client_id=client_id&api_key=api_key&whatsapp_number=919876543210&webhook_url=https://yoursite.com/webhook';
$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);
if ($result['status'] == 1) {
echo "WhatsApp client created successfully!\n";
echo "WhatsApp Client ID: " . $result['whatsapp_client_id'] . "\n";
echo "Message: " . $result['message'] . "\n";
} else {
echo "Error: " . $result['message'] . "\n";
}
curl_close($ch);
Connect WhatsApp Account 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_number: "919876543210",
webhook_url: "https://yoursite.com/webhook"
};
const options = {
url: 'https://wbiztool.com/api/v1/whatsapp/connect/',
method: 'POST',
form: data
};
request(options, (error, response, body) => {
if (!error && response.statusCode === 200) {
const result = JSON.parse(body);
if (result.status === 1) {
console.log("WhatsApp client created successfully!");
console.log(`WhatsApp Client ID: ${result.whatsapp_client_id}`);
console.log(`Message: ${result.message}`);
} else {
console.log(`Error: ${result.message}`);
}
} else {
console.log('Request failed:', error);
}
});