When Navitia is unable to give an answer, you'll receive a 4XX http code response. For 400 and 404 errors, an error object containing a unique error id is given for better understanding.
#request
$ curl 'https://api.navitia.io/v1/coverage/sandbox/stop_areas/wrong-one' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0'
#response
HTTP/1.1 404 OK
{
"error": {
"id": "bad_filter",
"message": "ptref : Filters: Unable to find object"
}
}
There are six possible 4xx http codes.
Error id | Description |
---|---|
bad_filter | When you use a custom filter |
unable_to_parse | When you use a mal-formed custom filter |
unknown_api | When you request an inexistant endpoint |
bad_format | When you provide ill-formated parameter (coord for example) |
config_exception | When you try to configure an external service (street network back-end or autocomplete) with wrong parameters |
When no token is provided/found in the request.
When the token is not allowed to request the coverage.
Error id | Description | Services |
---|---|---|
date_out_of_bounds | When the given date is out of bounds of the production dates of the region | All services |
no_departure_this_day | Some vehicles stop at this point, but none today (for example, it's sunday) | /departures /arrivals /stop_schedules /terminus_schedules /route_schedules |
no_active_circulation_this_day | No more vehicles stop for today (for example, it's too late) | /departures /arrivals /stop_schedules /terminus_schedules /route_schedules |
terminus | There will never be departures, you're at the terminus of the line | /departures /arrivals /stop_schedules /terminus_schedules /route_schedules |
partial_terminus | Same as terminus, but be careful, some vehicles are departing from the stop some other days | /departures /arrivals /stop_schedules /terminus_schedules /route_schedules |
active_disruption | No departure, due to a disruption | /departures /arrivals /stop_schedules /terminus_schedules /route_schedules |
no_origin | Couldn't find an origin | /journeys |
no_destination | Couldn't find a destination | /journeys |
no_origin_nor_destination | Couldn't find neither origin nor destination | /journeys |
unknown_object | Couldn't find one of the request parameters. It can be the region, the API or a PT object | All services |
no_solution | From data, there is no solution available given the request | /journeys |
When the response generated by the request exceeds 10 MB (few APIs are not yet concerned by this limitation but this may change in the future).
Tips to work around this error:
- paginate
- reduce the value of the parameter
depth
- on large
journeys
, reduce thetimeframe_duration
,max_duration
andmin_nb_journeys
values
When you request too many times the API during one second according to your token.
Tips to work around this error:
- rerun your request after an exponential backoff
- give up your request
- contact us for a quotation
Ouch. Technical issue :/
Error id | Description |
---|---|
internal_error | Something bad and unexpected has happened internally |
service_unavailable | Navitia isn't responding |
dead_socket | The requested region (coverage) isn't responding |
technical_error | An internal service (street network back-end or autocomplete) isn't responding |