Details of Responses
Our new version of APIs(v2) is callback-based APIs, So if you have not set up a callback URL till now, Please set it from brick dashboard.
Success Response
Sync Response
{
"status": 202,
data:{
"message": "We are processing your request and will send the data in the callback URL."
“job_id”:”XXXX-XXXX-XXXX-XXXX”
},
metadata:{
"source": {{API/Widget/Dashboard/SDK/Portal}},
"entity": {{Data/Insight/Verification/Payment}}
},
error: null,
}
Explantion of every field
status - HTTP/HTTPS status code
message- Text message
job_id - Unique transaction_id, It will help to map Async response
source - It defines from where APIs request is coming, It can be either one from API, Widget, Dashabord, SDK or Portal.
entity - It defines which product the APIs request is coming from, It can be either one from Data, Insight, Verification, or Payments.
error- Incase of success, Error will be null
Async Response
{
"status": 200,
"data": {
"message": “We are successfully able to fetch data”,
"example-1":"XXXX-XXXX-XXXX",
"count":{{Number of objects}},
"example-2"{[
"array1":1,
"example-3":"xx-xx-xx"
],[
"array2":1,
"example-4":"xx-xx-xx"
]}
},
metadata:{
"source": {{API/Widget/Dashboard/SDK/Portal}},
"entity": {{Data/Insight/VErification/Payment}}
},
error: null
}
Explantion of every field
status - HTTP/HTTPS status code
message- Text message
data- Response data
source - It defines from where APIs request is coming, It can be either one from API, Widget, Dashabord, SDK or Portal.
entity - It defines which product the APIs request is coming from, It can be either one from Data, Insight, Verification, or Payments.
error - Incase of success, Error will be null
Error Response
Below is a structure of Unsuccessful responses.
{
"status" : XXX,
“error”:{
"code": {{brick_unique_error_code}},
"message": {{description_of_error}},
"action": {{further_action}},
"reason": {{Actual_reason_for_error}}
},
“metadata”:{
"source": {{API/Widget/Dashboard/SDK/Portal}},
"entity": {{Auth/Insight/Verification/Payment}}
},
data:null
}
Explanation for every field
status - HTTP/HTTPS status code
code - Brick customized status code
message - Error message for showing to end-users
action- Further action to prevent this error
reason- Actual reason of the error
source - It defines from where APIs request is coming, It can be either one from API, Widget, Dashabord, SDK or Portal.
entity - It defines which product the APIs request is coming from, It can be either one from Data, Insight, Verification, or Payments.
Below is a list of possible "code" that can be returned, along with a description and action.
Client Side Errors
Type | Reason | Status code | Code |
---|---|---|---|
Unauthorised/Unauthticate | Username & password in not correct(in Auth API) | 401 | missing_parameters_in_headers |
Unauthorised/Unauthticate | Public token is invalid | 401 | invalid_parameters_in_headers |
Unauthorised/Unauthticate | Public token is missing | 401 | missing_parameters_in_headers |
Unauthorised/Unauthticate | Public token is expire | 401 | expired_parameters_in_headers |
Unauthorised/Unauthticate | User access token is invalid | 401 | invalid_parameters_in_headers |
Unauthorised/Unauthticate | User access token is missing | 401 | missing_parameters_in_headers |
Unauthorised/Unauthticate | User access token is expire | 401 | expired_parameters_in_headers |
Unauthorised/Unauthticate | Unauthorised access to transaction | 401 | unauthorized_access |
Forbidden | User access token is not mapped with Public access token(Client) | 403 | client_not_authorized |
Bad Request(Parameters is missing or Invalid) | Parameter is missing in request(Either one or more parameters) | 400 | missing_parameters_in_request |
Bad Request(Parameters is missing or Invalid) | Parameters are not incorrect(If value is not correct) | 400 | wrong_parameters_in_request |
Bad Request(Parameters is missing or Invalid) | Parameters are not incorrect (If value is not valid) | 400 | invalid_parameters_in_request |
Bad Request(Parameters is missing or Invalid) | Parameters are not in correct format | 400 | incorrect_format_of_parameters_in_request |
Bad Request(Parameters is missing or Invalid) | Parameter are not in correct type(Wrong type of parameters) in request | 400 | incorrect_type_of_parameters_in_request |
Bad Request(Parameters is missing or Invalid) | Callback is not available | 400 | missing_callback_url |
Bad Request(Parameters is missing or Invalid) | Parameters is expired | 400 | expired_parameters_in_request |
Unprocessable request | Dormant user | 422 | inactive_user |
Unprocessable request | Concurrent user/ Session is available is other device | 400 | session_available_in_other_device |
Resource not available | Not authorised to complete the request | 404 | feature_not_available |
Source is not authorised | Request is not from whitelisted IP | 401 | ip_not_whitelisted |
Rate limit exceeded | More number of request than rate limit | 401 | rate_limit_exceeded |
Method not allowed | Wrong method | 405 | method_not_allowed |
Server Side Errors
Type | Reason | Status Code | Code |
---|---|---|---|
Service unavailable | Service unavailable (Brick) | 500 | service_unavailable |
Service unavailable | Service unavailable (Institution level) | 500 | institution_not_available |
Unexpected behaviour | Data can not retrieved | 500 | unexpected_behaviour |
Unexpected behaviour | Internal crash | 500 | unexpected_behaviour |
Server unavailable | Server unavailable | 500 | server_unavailable |
Updated 8 months ago