Kirim OTP
Kirim one-time password (OTP) ke pelanggan melalui WhatsApp.
Endpoint
POST /agent/otp
Request Headers
| Header | Value | Deskripsi |
|---|---|---|
| Authorization | Bearer token | Token autentikasi yang diperoleh dari Profile Anda setelah login ke CMS |
| Content-Type | application/json | Menentukan format body request |
Request Body
| Parameter | Type | Required | Deskripsi |
|---|---|---|---|
| deviceID | String | Ya | ID perangkat WhatsApp untuk mengirim dari (contoh: "62851851xxxxxx") |
| phoneNumber | String | Ya | Nomor telepon penerima dalam format internasional (contoh: "62896058xxxxx") |
| otpCode | String | Ya | Kode OTP yang akan dikirim (contoh: "541134") |
| message | String | Tidak | Template pesan kustom. Jika kosong, template default akan digunakan |
Contoh Request
{
"deviceID": "62851851xxxxxx",
"phoneNumber": "62896058xxxxx",
"otpCode": "541134",
"message": "Your verification code is {code}. Please enter this code to verify your account."
}
Response
Success Response
{
"status": true,
"message": "OTP sent successfully",
"data": {
"id": "12345678-abcd-1234-efgh-123456789012",
"timestamp": "2025-06-22T10:15:30.123Z"
}
}
Error Response
{
"status": false,
"message": "Error description",
"error": {
"code": "ERROR_CODE",
"details": "Additional error details"
}
}
Catatan Penggunaan
- Nomor telepon harus dalam format internasional tanpa tanda plus atau spasi
- Kode OTP biasanya 4-6 digit
- Jika tidak ada pesan kustom yang diberikan, template default akan digunakan