Sending messages
Send template
Send an approved template with variables, header media and a link button.
Templates are the only message type that can start a conversation or be sent after the 24-hour window. The template must be approved in your account.
GET
/send-templateParameters
LicenseNumberstringrequired | Your license number, shown on the Developer API page. |
|---|---|
APIKeystringrequired | Your API key, shown on the Developer API page. |
Contactstringrequired | Recipient number with country code, digits only. |
Templatestringrequired | Exact name of the approved template. |
Paramstring | Body variables in order, separated by commas: Rahul,ORD-1001,Tomorrow. |
Fileurlstring | Public URL of the header image, video or document. |
HeadURLstring | Same as Fileurl; either name works. |
HeadParamstring | Value for a text header variable. |
URLParamstring | The changing part of a dynamic URL button. |
PDFNamestring | File name shown for a document header. |
Namestring | Contact name, used if the contact is created. |
Example request
curl -G "https://console.tendigit.in/api/v1/ext/send-template" \
--data-urlencode "LicenseNumber=YOUR_LICENSE" \
--data-urlencode "APIKey=YOUR_API_KEY" \
--data-urlencode "Contact=919876543210" \
--data-urlencode "Template=order_update" \
--data-urlencode "Param=Rahul,ORD-1001,Tomorrow"Response
json
{
"success": true,
"messageId": "cmt8z1abc0003xyz",
"status": "QUEUED",
"template": "order_update"
}Cost
Template messages are charged to your wallet at your plan's rate, so keep your balance topped up.
TEMPLATE_NOT_FOUND(404): the name does not match an approved templateVALIDATION(400):ContactorTemplateis missing