Send WhatsApp messages via approved WhatsApp Templates, either through your own connected Business Account or the default KudiSMS fixed number for OTPs.
Send WhatsApp (custom template)
POST
/whatsapp_customRequires connecting your WhatsApp Business Manager to KudiSMS, adding your WhatsApp Business phone numbers, and submitting your WhatsApp Templates for approval. Messages are sent from your business-branded WhatsApp number, and you can see and reply to customer responses.
| Field | Example | Description |
|---|---|---|
| token* | Api Key | Your API key. |
| recipient* | 23480xxxx | Recipient phone number. |
| phone_number_id* | xxxxxxxxxxxxxxx | Sender WhatsApp Phone Number ID — from the Connect WhatsApp page (/user/whatsapp_connect). |
| template_code* | xxxxxxxxxxxx | Template code to use — from the Custom WhatsApp Template page (/user/whatsapptemplatereport). |
| parameters | xxxx,xxxxx,xxxx,xxxx | Required parameters in the template body, comma-separated. |
| button_parameters | xxxx,xxxx,xxx | Button parameter for a Dynamic URL, e.g. https://example.com/{{1}} — value of URL parameter {{1}}. |
| header_parameters | xxxx,xxxx | Header parameters, if any. |
Example response — 200 OK
{
"status": "success",
"error_code": "000",
"data": "234XXXXXXXX|42a455f3-8d4d-a775-4311-13790d5820c0",
"msg": "Message sent Successfully"
}Whatsapp Webhooks
POST
https://your-server.com/webhooks/kudismsKudisms sends POST webhooks to your configured callback URL whenever a WhatsApp message or reply is received from a recipient.
- Set your callback URL in the Kudisms dashboard.- Webhooks include type: "custom_whatsapp" so you can tell them apart from SMS/email/voice.- Respond with HTTP 200 to acknowledge.
Example Request
{
"type": "custom_whatsapp",
"status": "success",
"data": {
"object": "whatsapp_business_account",
"entry": [
{
"id": "2016975642187757",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "234xxxxxxxxxx",
"phone_number_id": "1093090143877747"
},
"contacts": [
{
"profile": {
"name": "Profile Name"
},
"wa_id": "234xxxxxxxxxx",
"user_id": "IN.866201666498626"
}
],
"messages": [
{
"from": "234xxxxxxxxxx",
"from_user_id": "IN.866201666498626",
"id": "wamid.HBgMOTE5MDE2MTA1MDk2FQIAEhgWM0VCMEIzRkQ1NUJENjc5MUY2RTMwOQA=",
"timestamp": "1788176108",
"text": {
"body": "hello"
},
"type": "text"
}
]
},
"field": "messages"
}
]
}
]
}
}