Error Handling
There are 3 types of errors in API.
- Internal Error
Internal errors can be occurred from back end application , server is not responding or suppliers communication is failed.
- Validation Error
The validation errors can be occurred when having invalid inputs or errors in the format expected of a field in the request. They contain a description of the issue in the response field message and require an adjustment to the request for it to succeed.
- Informational Error
Information errors can be occurred when Request in progress or no results found etc...
For further detail please refer Error detail
Error responses
Detailed information on what exactly went wrong will be included in the response body. Every error returned by the API includes:
Name | Description |
---|---|
title |
A quick and simple description of what went wrong |
message |
A more detailed human-readable description of what went wrong |
documentationUrl |
A URL pointing to a place in our documentation where you can read about the error |
type |
A machine-readable identifier for the general category of error |
code |
A machine-readable identifier for this specific error |
API will return Errors and Warnings in different sections as given below.
Authorization Error
If you don't provide an authorization header in your request or your session is expired then you'll receive an authentication_error as given below:
{
"meta": {
"success": false,
"statusCode": -2,
"statusMessage": "UNAUTHORIZED",
"actionType": "",
"conversationId": "fe22cb8d-67e9-4c29-92af-e44dffdcb9a9"
},
"errorDetails": {
"code": "VAL-002",
"type": "VALIDATION_ERROR",
"title": "Authentication failed",
"message": "Authentication failed. The sessionId is expired or Make sure you are using valid sessionId in header.",
"documentationUrl": "api-doc/docs/troubleshoot/api-error-codes/index.html",
"path": "/api/v1/flight/search",
"timestamp": 1684945506243
}
}
If client does not provide a required parameters, or some data you provided is invalid, User will receive a validation error, with a type of validation_error. Validation errors include an additional source property, pointing to the exact field in your request which was invalid. Here's an example of a validation error returned when a slice in an offer request does not have an origin:
{
"meta": {
"success": false,
"statusCode": -4,
"statusMessage": "BAD REQUEST",
"actionType": "",
"conversationId": "fe22cb8d-67e9-4c29-92af-e44dffdcb9a9"
},
"errorDetails": {
"code": "VAL-004",
"type": "VALIDATION_ERROR",
"title": "Invalid data in the request fields",
"message": "Invalid data found in the request parameters, Please correct them with proper values and try again.",
"documentationUrl": "api-doc/docs/troubleshoot/api-error-codes/index.html",
"source": {
"flightSegments[0].departureAirportCode": "This field is cannot be blank"
},
"path": "/api/v1/flight/search",
"timestamp": 1684933214630
},
"version": "1.0.0"
}
Warning
"warningDetails": [
{
"code": "UNSUPPORTED_FIELD",
"documentationUrl": "/api-doc/docs/troubleshoot/api-error-codes/index.html",
"message": "Field is not yet supported",
"value": "preference.flightPreference"
},
{
"code": "validation_required",
"documentationUrl": "api-doc/docs/troubleshoot/api-error-codes/index.html",
"message": "Departure Time changed",
"value": "Departure Time changed for EK7 2022-09-03 DXBLHR"
}
]
error
,warning
code
is a combination of followingmessage
is used for sending meaningful and user-friendly error message to the consumer (ex- display as a popup in GUI )value
is a multivalued String list containing further information of internal errors for the reference of Developers
Errors
Travlinq uses standard HTTP/Gateway response codes to indicate the success or failure of API requests.
For Errors more details to Refer Troubleshooting Page