Whatsapp Media 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 Media 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 Text Template to Motict team before sending the message.
Name Example
5f0b5191-7093-45b4-962f-f2943adec77b
Content Example
Dear Customer {{1}}, Thank you for contact us, please let us know how we can assist you. Visit our official website for more detail of our Product & Services {{2}}.
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": "5f0b5191-7093-45b4-962f-f2943adec77b",
"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": "https://www.motict.com"
}
]
}
]
}
}'
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: header |
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. Available types:
|
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. |
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": "d4e59349-9ec7-4ade-87d5-752d355f4262"
}
}
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 |