Document History#
| Version | Release | Description |
|---|
| 1.0.0 | - | Initialize API |
Server#
General Request Field#
There are several fields that should be set in every endpoint request API.x-language#
| Request on | Mandatory | Default |
|---|
| Header | No | id |
The language used in the messages received in the API response will be based in the value of x-language.| value | Description |
|---|
| id | Bahasa Indonesia |
| en | English |
x-request-id#
| Request on | Mandatory | Default |
|---|
| Header | Yes | |
As the identity of each API request. The value should be unique.x-client-key#
| Request on | Mandatory | Default |
|---|
| Header | Yes | |
The key received by the client to access the APIx-version#
| Request on | Mandatory | Default |
|---|
| Header | Yes | |
Identified the version API used by the client to request the API endpoint.x-token#
| Request on | Mandatory | Default |
|---|
| Header | Conditional | |
The x-token field will become mandatory if the API endpoint being requested is specific to user.the x-token will be obtained if the user successfully logs in.x-signature#
| Request on | Mandatory | Default |
|---|
| Header | Yes | |
For verify the request received by trusted client or not, we need to check the signature. Use the private key that received from the admin to create signature.
The encrypted using RSA 2048 & SHA256.Data structure for signature :{
"endpoint": "/user/login?id=3425234245",
"method": "GET",
"headers": {
"x-client-key": "CK00001"
"x-token": "abcde12345"
"x-request-id": "ABCEDFGHIJK",
"x-version": "1.0.0"
},
"body": {}
}
1. endpoint#
The endpoint used in the request. You can check the endpoint in each the request API info2. method#
The http method used in request.In the headers part, only allowed the method, x-request-id, x-client-key, etc field.4. body#
If there are the body data in send request body. Put the request body info. but, if there is no the body data, fill it with empty object : {}Step by step to create Signature#
1.
Prepare data according to the structure above
2.
Data has been prepared, then convert the data to be string.
3.
Encrypt the data string with RSA 2048 & SHA256 use private key that has been received.
4.
Encode encrypted data using base64 encode.
5.
Then set the data encoded with base64 encode to the "X-Signature" field in the header
General Response#
Success#
You will be received the http status 2XX if the request API is success, and you can see the data need in the responseFailed#
There are 2 types failed response.
5XX : error in the server side
4XX : error in the client sideEvery you get error response, you will be see the response schema like this :Modified at 2025-04-11 13:38:37