Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
This error codes is additional information to explain what happened when some errors occured. The following table describe the code which may appear when working with OCA WA API Gateway. If an error is not listed in the table, going back to HTTP status codes above in order to determine the best way to address the issues.
5
low-balance
Indicating that your account has no enough
balance left
9
Too Many
Request Code
Due to the api rate limit, you have to wait until the currently window wxpires, the default api rate limit is in 25 request per seconds. You can check http headers reaponse in order to know the remaining limit of your request. - X-RateLimit-limit : the rate limit of endpoint - X-RateLmit-Remaining : the number of request left - X-RateLimit-Reset : the remaining window before the rate limit resets
13
Internal Error
Corresponds with HTTP 500. An unknown internal error occured
19
Missing Authorization Header
Corresponds with HTTP 406. It indicates Authorization header is not set properly
33
Data doesn’t
exist
Corresponds with HTTP 404. The certain data
is not found
39
[object]
Corresponds with HTTP 406. There are incorrects or missing parameter in request body, it is like the message_value is not same as the template message
43
Auth token is
not supplied
Corresponds with HTTP 401. It indicates
Authorization header is not set properly
45
Auth token is
not valid
Corresponds with HTTP 401. It indicates
Authorization token is not valid
59
Template
doesn't exist
Code
Corresponds with HTTP 406. Your message
template doesn’t exist
OCA WA API error messages are returned in JSON Format. Each HTTP Status Code will be accompanied by descriptive error text and code. For example, an error might occur.
You can use POST /api/v2/push/message endpoint to send message template to your customers. In order to use this feature, you need to create message template. You can request message template to our customer service.
Message template holds your text message and you can put dynamic data to get more personalize message, like Hi {{name}}, how are you today? Etc
Body
The OCA WA API Gateway attempts to return the appropriate HTTP Status Codes for every request
200
OK
Success
401
Unauthorized
Missing or Incorrect authentication details
404
Not Found
There is no data available, like user setting etc
406
Not Acceptable
Response when there is invalid format in request
429
Too Many
Requests
Returned when a request cannot be served due to the system's rate limit having been
exhausted for the resource.
500
Internal Server Error
Something is broken. This is usually a temporary error in server
A successful message will appear as a response value if the HTTP Status code returns 200
(OK). It has a format like the code below
The status of messages can be grabbed through this endpoint GET /api/v2/message/{{msgid}}/status
.
There are 4 types of status that you can get from this endpoint submitted, delivered, read, failed/rejected.
You can use POST /api/v2/push/message endpoint to send message template to your customers. In order to use this feature, you need to create message template. You can request message template to our customer service.
With this media message template, you can send media like image, video & document along with your message text.
Body:
The main Object
phone_number
Yes
Destination of phone number Values : country code + phone number (+6281381475159, 6281381475159)
message
Yes
Contain all message information body
The message Object
type
Yes
The type of your message
Values : template
template
Yes
Contain template information
The template Object
template_code_id
Yes
The registered template message, you will be given the template code id for your requested template Values : template code id
payload
Yes
Contain array of information for specific template
The payload Object
position
Yes
Describe the position type Values : header | body
parameters
Yes
Array containing the content of each position type
The body parameters Object
type
Yes
Describe the type for parameters Values : text
text
Yes
Contain value of text
The header parameters Object
type
Yes
Describe the type value Values : text | image | video | document
text
Yes, when “type” : “text”
Contain value of text
image
Yes, when “type” : “image”
Media object containing image
video
Yes, when “type” : “video”
Media object containing video
document
Yes, when “type” : “document”
Media object containing document
The image, video & document Object
url
Yes
The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs.
OCA WA API provides an authorization method for you to access our resources, which we primarily use Access Token JSON Web Token (JWT). We will provide you the JWT token.
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
This document provides information on how to use Whatsapp Bussiness API, in order to you send notification and messages to your customers.
OCA Endpoint URL : https://wa01.ocatelkom.co.id
Before you start
You will need :
Verified whatsapp business account
A username and password of Oca’s account
Registered message template (please contact our customer service to register your template
Postman: