Send Text Message
Send a simple text message. (Note: Only works within the 24-hour window).
POST /send-message
| Parameter | Type | Description |
phone REQ |
String |
Recipient mobile (e.g., 919876543210). |
type REQ |
String |
Must be text. |
message REQ |
String |
Message content. |
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gd.kharidi.in/api/send-message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
"phone" => "919999999999",
"type" => "text",
"message" => "Hello form Shambhu API!"
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY_XXXXXXXX",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
curl_close($curl);
Send Template Message
Required to initiate conversations. Use variables (e.g. {{1}}) for dynamic content.
POST /send-template
$data = [
"phone" => "919999999999",
"template_name" => "otp_verification",
"language" => "en_US",
"components" => [
[
"type" => "body",
"parameters" => [
[ "type" => "text", "text" => "123456" ]
]
]
]
];
// ... Send Request ...
Webhooks
Configure your callback URL in the dashboard to receive real-time updates.
{
"object": "whatsapp_business_account",
"entry": [
{
"changes": [
{
"field": "messages",
"value": {
"messages": [
{
"from": "919999999999",
"text": { "body": "Hello!" },
"type": "text"
}
]
}
}
]
}
]
}