Note: Template messages must be created and approved before they can be sent to customers.
curl --location 'https://rest.qikberry.ai/v1/whatsapp/messages' \
--header 'x-phone-number: <WA_ID>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"to": "+91XXXXXXXXXX",
"type": "template",
"template": {
"name": "invoice_offer_template",
"language": "en",
"components": [
{
"type": "header",
"parameters": [
{
"type": "document",
"document": {
"link": "https://example.com/documents/invoice.pdf",
"filename": "Invoice_12345.pdf"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Guru"
},
{
"type": "text",
"text": "#INV12345"
},
{
"type": "text",
"text": "₹2,499"
}
]
},
{
"type": "button",
"sub_type": "url",
"index": "0",
"parameters": [
{
"type": "text",
"text": "INV12345"
}
]
},
{
"type": "button",
"sub_type": "copy_code",
"index": "1",
"parameters": [
{
"type": "coupon_code",
"coupon_code": "SAVE20"
}
]
}
]
}
}'{
"message": "1 numbers accepted",
"data": [
{
"messageId": "<MESSAGE_ID>",
"mobile": "<USER_PHONE_NUMBER>"
}
]
}