Sending Message Template Authentication
Last updated
Last updated
Whatsapp telah merelease fitur baru yaitu template Authentication With One Time Password Buttons, fitur ini dikhususkan untuk pengiriman pesan yang digunakan untuk keperluan autentikasi dan verifikasi menggunakan kode OTP, berikut beberapa hal terkait kapabilitas template Authentication.
Template Authentication sudah memiliki kalimat pesan default dari Meta, dimana user tidak dapat melakukan perubahan kalimat pesan, untuk contoh kalimat pesan Bahasa Indonesia akan seperti di bawah ini:
“123456 adalah kode verifikasi anda. Demi keamanan, jangan bagikan kode ini.”
Kalimat pesan akan menyesuaian dengan Bahasa yang dipilih.
Template Authentication menyediakan “Copy Button” yang akan memudahkan penerima untuk melakukan copy kode otp untuk dimasukkan ke website atau applikasi pada saat proses verifikasi.
Tidak diperbolehkan menggunakan media pada pesan template Authentication
Konten dinamis hanya boleh berisi number, text dan tidak boleh menggunakan symbol ataupun karakter
Untuk dapat menggunakan whatsapp template Authentication terdapat beberapa hal yang harus dilakukan oleh user, berikut Langkah-langkah dan penjelasannya
Request Whatsapp template Authentication
User dapat melakukan request template melalui dashboard developer api, silahkan kunjungin website di https://developer.ocaindonesia.co.id
, lalu klik menu Whatsapp Template dan klik tombol Add Template, lalu akan muncul pop up dialog, silahkan untuk mengisi language dan memilih template Authentication lalu klik tombol Continue.
Silahkan masukkan wording berikut “[kode] adalah kode verifikasi anda. Demi keamanan, jangan bagikan kode ini.”. Perlu diingat secara default whatsapp sudah menetapkan wording untuk setiap Bahasa yang dipilih, dalam step ini pemberian wording digunakan untuk pencatatan di system OCA saja.
Silahkan tunggu proses pengajuan sampai status pengajuan berubah menjadi Approved.
Selanjutnya untuk penggunaan API dapat menggunakan payload request seperti ini:
API URL: /whatsapp/v2/send/message
METHOD: POST
AUTHENTICATION: Bearer {{jwt_token}}
Lihat Auhtorization untuk detail authentication
Payload Body
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