Whatsapp Interactive Template
Reach users globally on the world's most popular messaging platform to send messages in any format as you need. You can send Whatsapp Interactive Template messsage to the users as a notification, the user no need to initiate the chat.
On this page
Template
You need to request a Whatsapp Interactive Template to Motict team before sending the message. There are two types of predefined buttons offered:
- Call-to-Action — Allows your customer to call a phone number and visit a website
- Quick Reply — Allows your customer to return a simple text message
Quick Reply
Name Example
7db1c26b-af05-423b-91be-9119ba23baa6
Content Example
Upcoming Test {{1}} This is a reminder for your upcoming {{2}} on {{3}} at {{4}}. We would like to confirm it you can make it.
Format
Name | Description |
---|---|
Template Name | Identifier of your template. After you requested the template and it approved you will get this template name. |
Content Format | You can apply any message formats such as Italic, Bold, Strikethrough and Monospace based on this page. |
Parameter Placeholder | Use Curly Bracket. Format: {{number}}. |
Request
The request contains form data with target phone number and message in text format.
Curl Example
curl --location --request POST 'https://api.motict.com/v1/wa/message' \
--header 'Authorization: api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
"from": "+628123456789",
"to": "+628123456781",
"type": "template",
"template": {
"name": "7db1c26b-af05-423b-91be-9119ba23baa6",
"language": {
"policy": "deterministic",
"code": "id"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "01/04"
},
{
"type": "text",
"text": "Production Test"
},
{
"type": "text",
"text": "Thursday, 6 Jan 2022"
},
{
"type": "text",
"text": "Monas, Jakarta"
}
]
},
{
"type": "button",
"sub_type": "quick_reply",
"index": "0",
"parameters": [
{
"type": "payload",
"payload": "Yes-Button-Payload"
}
]
},
{
"type": "button",
"sub_type": "quick_reply",
"index": "1",
"parameters": [
{
"type": "payload",
"payload": "No-Button-Payload"
}
]
},
{
"type": "button",
"sub_type": "quick_reply",
"index": "2",
"parameters": [
{
"type": "payload",
"payload": "Later-Button-Payload"
}
]
}
]
}
}'
Parameters
Name | Type | Required | Description |
---|---|---|---|
api_key | String | Yes | API key credential will be provided by Motict team. |
from | String | Yes |
Your Whatsapp business phone number. Phone numbers are in E.164 format (e.g., +6285123456790) |
to | String | Yes |
Target phone number. Phone numbers are in E.164 format (e.g., +6285123456790) |
type | String | Yes | Type of message |
template.name | String | Yes | Your template name. |
template.language.policy | String | Yes | Default: deterministic |
template.language.code | String | Yes | Default: id |
template.components.type | String | Yes | Default: body |
template.components.parameters | String | Yes | Your value placeholder. It is in array format and the order based on the number on your template paramater placeholder. Type default text. |
template.components.type | String | Yes | Default: button |
template.components.sub_type | String | Yes | Default: quick_reply. |
template.components.index | String | Yes | Position index of the button. You can have up to 3 buttons using index values of 0-2. |
template.components.parameters | String | Yes | Your value placeholder. It is in array format and the order based on the number on your template paramater placeholder. Type default payload. |
Call to Action
Name Example
e113175f-c522-44de-b68d-77f1c760d7fc
Content Example
Hi {{1}}, your order {{2}} has shipped! Your order is expexted to arrive by {{3}}.
Format
Name | Description |
---|---|
Template Name | Identifier of your template. After you requested the template and it approved you will get this template name. |
Content Format | You can apply any message formats such as Italic, Bold, Strikethrough and Monospace based on this page. |
Parameter Placeholder | Use Curly Bracket. Format: {{number}}. |
Request
The request contains form data with target phone number and message in text format.
Curl Example
curl --location --request POST 'https://api.motict.com/v1/wa/message' \
--header 'Authorization: api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
"from": "+6281234863337",
"to": "+6285641219264",
"type": "template",
"template": {
"name": "e113175f-c522-44de-b68d-77f1c760d7fc",
"language": {
"policy": "deterministic",
"code": "id"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "image",
"image": {
"link": "https://motict.com/logo.png"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "John Doe"
},
{
"type": "text",
"text": "order"
},
{
"type": "text",
"text": "Jan 31, 2022"
}
]
},
{
"type": "button",
"index": "0",
"sub_type": "url",
"parameters": [
{
"type": "text",
"text": "23fmf299dsd23dqw1"
}
]
}
]
}
}'
Parameters
Name | Type | Required | Description |
---|---|---|---|
api_key | String | Yes | API key credential will be provided by Motict team. |
from | String | Yes |
Your Whatsapp business phone number. Phone numbers are in E.164 format (e.g., +6285123456790) |
to | String | Yes |
Target phone number. Phone numbers are in E.164 format (e.g., +6285123456790) |
type | String | Yes | Type of message |
template.name | String | Yes | Your template name. |
template.language.policy | String | Yes | Default: deterministic |
template.language.code | String | Yes | Default: id |
template.components.type | String | Yes | Default: body |
template.components.parameters | String | Yes | Your value placeholder. It is in array format and the order based on the number on your template paramater placeholder. Type default text. |
template.components.type | String | Yes | Default: button |
template.components.sub_type | String | Yes | Default: url |
template.components.index | String | Yes | Position index of the button. Default: 0 |
template.components.parameters | String | Yes | Your value placeholder. It is in array format and the order based on the number on your template paramater placeholder. Type default payload. |
Response
The response contains JSON body with message status whether the request is success or error. And also the message id that has been sent to the user.
Body
{
"message": "success",
"data": {
"id": "320395df-d87a-4849-bc0b-155593706774"
}
}
Parameters
Name | Type | Description |
---|---|---|
id | String | Whatsaap Message ID will be used as call identifier for each request |
message | String | Success or error message. For error response, check Error section for mor details |