{
"message": string,
"result": object | Array<object> , (optional)
"pagination": Object<string> (optional)
}
The request succeeded
{
"message": "success get data",
“result”: [
{
“id”: 1,
“name”: “Iwon”,
“age”: 20
},
{
“id”: 2,
“name”: “Kukuh”,
“age”: 30
}
],
"pagination":{
"total_data":200,
"total_pages":20,
}
}
The request succeeded but empty data
{
"message": "data is empty",
“result”: []
}
The request succeeded for detail and anything other than a list
{
"message": "success get data",
“result”: {
“id”: 1,
“name”: “Rifky”,
“age”: 20
}
}
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request body, param or query).
{
"message": "number not found in database",
“errors”: [
“62845367890 (Jono) unregistered on row 3”,
“62847367990 (Joni) unregistered on row 4”
]
}
{
"message": "Incorrect bearer token"
}
The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server.
{
"message": "your account not getting access for this request"
}
The server cannot find the requested resource. In the browser, this means the URL is not recognized.
{
"message": "page not found"
}
The server has encountered a situation it does not know how to handle.
{
"message": "Internal server error"
}
- Successful responses (200 – 299)
- Client error responses (400 – 499)
- Server error responses (500 – 599)
200 (OK)
method: GET, PUT, POST, DELETE
201 (Created)
method: POST
Client Errors:
400 (Bad Request)
Errors:
- Incorrect payload/body
- Incorrect param
- Incorrect query
401 (Unauthorized)
Errors:
- Incorrect token
- Incorrect api key
403 (Forbidden)
Errors:
- Account role not gaining access
404 (Not Found)
Errors:
- Incorrect endpoint/url
Server Errors:
500 (Internal Server Error)
Errors:
- All errors that come from the server and are unknown