Quickstart
Send WhatsApp messages from your own software: get an API key, find your phone number ID and send your first template message in three steps.
You can send your first message in three steps.
1. Get your API key. Sign in at app.hostmentor.com, open Messaging → WhatsApp and create an API key. Your WhatsApp number must already be connected there.
2. Check the key and find your IDs. This call lists the WhatsApp numbers your key can use:
curl https://wa.hostmentor.com/v3/getuserdetails \
-H "apikey: hm_live_..."{
"code": 200,
"status": "SUCCESS",
"data": [
{
"whatsapp_business_account_id": "105954558954427",
"wanumber": "+919876500000",
"phone_number_id": "106540352242922"
}
]
}Keep phone_number_id, which you need to send messages, and whatsapp_business_account_id, which you need to manage templates.
3. Send a template. A business must start a conversation with an approved template (see The 24-hour window). Replace order_shipped with one of your approved templates:
curl https://wa.hostmentor.com/v3/106540352242922/messages \
-H "apikey: hm_live_..." \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "919876543210",
"type": "template",
"template": { "name": "order_shipped", "language": { "code": "en" } }
}'The response contains the message ID (wamid.…). Delivery and read receipts for it arrive on your webhook.
WhatsApp Business API
Send and receive WhatsApp messages from your own software with the HostMentor WhatsApp Business API: templates, media, product catalogs, payments and webhooks.
Authentication
Authenticate WhatsApp Business API requests with your HostMentor API key in the apikey header, and keep your keys safe on your server.