📂Template Messages
Ease repeating messages, and also initiate conversation sessions with customers.
Template List
GET /templates/:appId
Retrieve the list of available template messages.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Query Params
limit
Data size per page. Default: 10. Max: 50.
before
Prohibited if after is filled.
after
Prohibited if before is filled.
Path Variables
:appId
Application ID
Response
{
"statusCode": 200,
"code": "OK",
"message": "The request has been successfully processed.",
"data": [
{
"id": "1519350671883350",
"name": "otp_code",
"language": "id",
"category": "AUTHENTICATION",
"status": "APPROVED"
},
// ...
],
"meta": {
"cursors": {
"before": "MAZDZD",
"after": "OQZDZD"
}
}
}{
"statusCode": 400,
"code": "BAD_REQUEST",
"message": "The request body does not contain valid data."
}{
"statusCode": 403,
"code": "FORBIDDEN",
"message": "You do not have access to this resource."
}{
"statusCode": 404,
"code": "NOT_FOUND",
"message": "The endpoint you are looking for seems to be not found."
}Template Details
GET /templates/:appId/:templateId
Retrieve specific detailed template messages.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Path Variables
:appId
Application ID
:templateId
Template message ID
Response
{
"statusCode": 200,
"code": "OK",
"message": "The request has been successfully processed.",
"data": {
"id": "1519350671883350",
"name": "otp_code",
"language": "id",
"category": "AUTHENTICATION",
"status": "APPROVED",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "{{1}}",
"example": {
"header_text": [
"Unswer"
]
}
},
{
"type": "BODY",
"text": "Kode OTP Anda adalah : *{{1}}*\n\nJaga kerahasiaan kode OTP tersebut, jangan berikan kepada siapapun.",
"example": {
"body_text": [
[
"123456"
]
]
}
}
],
"$extras": {
"cta_url_link_tracking_opted_out": false,
"quality_score": {
"score": "UNKNOWN",
"date": 1715671267
},
"rejected_reason": "NONE"
}
}
}{
"statusCode": 403,
"code": "FORBIDDEN",
"message": "You do not have access to this resource."
}{
"statusCode": 404,
"code": "NOT_FOUND",
"message": "The endpoint you are looking for seems to be not found."
}Create Template
POST /templates/:appId
Create template messages programmatically.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Path Variables
:appId
Application ID
Body Raw
name
Template name in snake_case format.
category
Template category. Supported: UTILITY, MARKETING, AUTHENTICATION.
sub_category
Sub category of the template. Supported: ORDER_DETAILS, ORDER_STATUS.
language
Template location and locale code.
ttl
Time to live for message template sent. If users are offline for more than TTL duration after message template is sent, message will be dropped from message queue and will not be delivered.
Only allowed for AUTHENTICATION message templates.
components[]
.type
Component type. Supported: GREETING, HEADER, BODY, FOOTER, BUTTONS, CAROUSEL, LIMITED_TIME_OFFER.
components[]
.format
Component format. Supported: TEXT, IMAGE, DOCUMENT, VIDEO, LOCATION.
components[]
.text
Component text. Required when the type is HEADER, BODY or FOOTER.
components[]
.buttons[]
.type
Button type. Supported: QUICK_REPLY, URL, PHONE_NUMBER, OTP, MPM, CATALOG, FLOW, VOICE_CALL.
components[]
.buttons[]
.text
Button text.
components[]
.buttons[]
.url
Button URL. Required when the type is URL.
components[]
.buttons[]
.phone_number
Button phone number in string format. Required when the type is PHONE_NUMBER.
components[]
.buttons[]
.example[]
Button text or URL segment example. Note: array of string.
components[]
.buttons[]
.flow_id
Button flow ID. Required when the type is FLOW.
components[]
.example
.header_text[]
Placeholder examples. Required when the type is HEADER. Templates will not be approved without examples.
components[]
.example
.body_text[][]
Placeholder examples. This relates to the text column in the related component. Templates will not be approved without examples.
components[]
.example
.header_handle[]
Placeholder examples. Required if the type is HEADER and the format is other than TEXT. Templates will not be approved without examples.
Example Body Raw
{
"name": "greeting_message",
"category": "UTILITY",
"language": "id",
"components": [
{
"type": "BODY",
"text": "Halo {{1}}, selamat datang di {{2}}.",
"example": {
"body_text": [
["John Doe", "Unswer"]
]
}
}
]
}Response
{
"statusCode": 202,
"code": "OK",
"message": "The request has been successfully received and is being processed.",
"data": {
"id": "954710036062606",
"status": "PENDING",
"category": "UTILITY"
}
}{
"statusCode": 403,
"code": "FORBIDDEN",
"message": "You do not have access to this resource."
}{
"statusCode": 404,
"code": "NOT_FOUND",
"message": "The endpoint you are looking for seems to be not found."
}{
"statusCode": 422,
"code": "UNPROCESSABLE_ENTITY",
"message": "Data cannot be processed as it is invalid.",
"errors": {
"components.0.buttons.0.phone_number": "Nomor telepon harus ber-tipe data number",
// ...
}
}Delete Template Message
DELETE /templates/:appId/:templateId
Delete template messages from your application.
Danger! This deletion is permanent and cannot be undone.
Headers
Content-Type
application/json
Authorization
Bearer <token>
Path Variables
:appId
Application ID
:templateId
Template message ID
Response
{
"statusCode": 200,
"code": "OK",
"message": "Data has been successfully deleted."
}{
"statusCode": 400,
"code": "BAD_REQUEST",
"message": "Template contoh tidak bisa diedit atau dihapus."
}{
"statusCode": 403,
"code": "FORBIDDEN",
"message": "You do not have access to this resource."
}{
"statusCode": 404,
"code": "NOT_FOUND",
"message": "The endpoint you are looking for seems to be not found."
}Last updated