Sending Message Template
Membuat Template Pesan:
Sebelum menggunakan fitur ini, Anda perlu membuat template pesan terlebih dahulu.
Silahkan baca Panduan OCA API untuk membuat template.
Data Dinamis dalam Template:
Template pesan dapat mencakup placeholder untuk data dinamis. Misalnya,
{{name}}
placeholder yang akan diganti dengan nama pelanggan ketika pesan dikirim.Hal ini membuat pesan menjadi lebih personal dan relevan bagi penerima.
Menggunakan Template:
Setelah template dibuat dan disetujui, Anda bisa menggunakan endpoint API
POST /api/v2/push/message
untuk mengirimkan pesan kepada pelanggan.Anda akan mengirimkan template ID bersama dengan data yang diperlukan.
URL:
Header:
Body:
Response:
The main Object
phone_number
String
Yes
Destination of phone number Values : country code + phone number (+6281381475159, 6281381475159)
message
Object
Yes
Contain all message information body
The message Object
type
String
Yes
The type of your message
Values : template
template
Object
Yes
Contain template information
The template Object
template_code_id
String
Yes
The registered template message, you will be given the template code id for your requested template Values : template code id
payload
Array of Object
Yes
Contain array of information for specific template
The payload Array of Component Object
position
String
Yes, if template use this component
Describe the position type Values : header | body | button
parameters
Array of Object
Yes, if template use this component
Array containing the content of each position type
The Parameters Body Component Type Position
type
String
Yes
Describe the type for parameters Values : text
text
String
Yes
Contain value of text
The Parameters Header Component Type Position
type
String
Yes
Describe the type value Values : text | image | video | document
text
String
Yes, when “type” : “text”
Contain value of text
image
Object
Yes, when “type” : “image”
Media object containing image
video
Object
Yes, when “type” : “video”
Media object containing video
document
Object
Yes, when “type” : “document”
Media object containing document
The image, video & document Object
url
String
Yes
The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs.
The Parameters Button Components Type Position
sub_types
String
Yes
Describe the sub_type value Values : quick_reply | url_dynamic
index
Number
Yes
Contains the sequence number of the button use. The sequence number start from 0
parameters
Object
Yes
Contains an array of information for a specific sub_type
The Parameters sub_type Type Position
type
String
Yes
The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs.
payload
String
Yes, when “type” : “payload”
Contain text for the recepient to use to do a quick reply
text
String
Yes, when “type” : “text”
Containt text that will be used for dynamic_url
Last updated