Response
Response Handling for Pivot's API
HTTP Status
Pivot uses standard and conventional HTTP Status Codes for each API Response given in a single API Request. In brief, the HTTP Status code 2xx
indicates that the request is accepted and successfully processed by Pivot, 4xx
indicating that the failure is caused by the information provided. (E.g., missing some required parameters, credentials are not valid). 5xx
indicates that the error is on the Pivot side.
HTTP Status List used in Pivot API
200 OK
The request was successful
400 Bad Request
The request could not be understood or was missing required parameters
401 Unauthorized
Authentication failed or user doesn't have permissions for requested operation
404 Not Found
Resource was not found
405 Method Not Allowed
Requested method is not supported for the resource
500 Internal Server Error
The server encountered and unexpected condition that prevented it from fulfilling the request
Timeout
Pivot sets a default API timeout of 60 seconds., If the request takes longer than 60 seconds, then Pivot will return an HTTP code 408 for a timeout response.
Response Format
Response Format Example
{
"code": "00",
"message": "OK",
"error": {
// error object
},
"data": {
// resource object
},
"pagination": {
"page": 2,
"perPage": 20,
"totalItems": 400,
"totalPages": 20
}
}
Pivot API returns a uniform response format, which helps you traverse the response easily. The payload contains the following information:
code
String
M
A code that represents the success or failure of your request. The List of response codes can be found in each section of API Services
message
String
M
A human-readable format that explains the response
data
Object
Conditional
Contains the response data related with the accessed resources
pagination
Object
Conditional
Contains pagination information such as page number, how many records shows in page, total records, and total pages available
Last updated