WhatsApp Official template
Send a WhatsApp template
1. Which number should customers see?
Use Rasel’s number if it is available for your account. Customers will receive the message from that number.
View WhatsApp numbers2. Prepare a template for this number
Write the message, choose its language and provide a sample for each variable. Check its status after submission. If it is rejected, review the reason before submitting again.
Create a template3. Send the approved template
Open templates, choose an approved template and use it in a message. Enter the recipient and variable values in order, then review before sending.
Open WhatsApp templates
Before you start
Choose an eligible official number and an approved template. Match its language and variable order.
Required. Send the account API key in the X-API-Key header. Never expose the key in a public browser or git repository.
- List official WhatsApp senders
- Create a template
- List templates
- Platform-number templates
- Get one template by id
- Choose the number customers will see. GET /api/v2/official-senders?approvedOnly=true lists eligible senders for this key. Use the ID of your enabled business number or platform if Rasel’s number is available.
- Create the template using POST /api/v2/templates with the selected officialSenderId, name, language, message body and sample variables. For media, follow the upload fields in the create reference.
- Use GET /api/v2/templates with officialSenderId and limit to find an existing template, or GET /api/v2/templates/platform for Rasel’s number. Check GET /api/v2/templates/{id} for its status. Wait for approval if pending and address the reason if rejected.
- Once approved, POST /api/v2/messages/send with channel=official_whatsapp, the same officialSenderId and the recipient in to. Supply template.id or template.key and fill variablesIndexed in placeholder order. Include the approved button or header fields when the template requires them.
cURL
curl --request POST 'https://raselsms.com/api/v2/messages/send' \ -H "X-API-Key: $RASEL_API_KEY" \ -H 'Content-Type: application/json' \ --data-binary @- <<'RASEL_JSON'{ "to": "+963911111111", "messageType": "utility", "channel": "official_whatsapp", "template": { "key": "order_ready_notice", "variablesIndexed": [ "أحمد", "A-1042", "25000" ], "buttonVariables": [ { "index": 0, "subType": "url", "text": "A-1042" } ], "headerMediaUrl": "https://cdn.example.com/order-ready.jpg", "headerMediaType": "image" }, "officialSenderId": "platform"}RASEL_JSONTest locally with a mock response first. Confirm the recipient and cost before sending a live request.