WHATSAPP API

Bulk WhatsApp API Messaging

Send WhatsApp messages to multiple recipients at once using our Bulk WhatsApp API.

API Endpoint

POST https://darajapay.com/api/v1/whatsapp/sendBulk

Headers

{
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
}

Request Body

{
    "message_type": "text",
    "session": "YOUR_SESSION_ID",
    "message": "Hello, this is a bulk message",
    "document_url": "https://example.com/document.pdf",  // Optional, for document messages
    "recipients": [
        {
            "phone": "254712345678",
            "name": "John Doe"
        },
        {
            "phone": "254787654321",
            "name": "Jane Smith"
        }
    ]
}

Response

{
    "status": "success",
    "message": "Messages queued for sending",
    "message_ids": [
        "msg_123456789",
        "msg_987654321"
    ]
}

Code Examples

PHP
 'text',
    'session' => 'YOUR_SESSION_ID',
    'message' => 'Hello, this is a bulk message',
    'recipients' => array('254712345678', '254723456789', '254734567890')
);

$headers = array(
    'Content-Type: application/json',
    'Authorization: Basic YOUR_API_KEY'
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;