search icon
Overview
Developer Tools
Travel Time Matrix API
Isochrone API
Distance Map API
Routes API
Geocoding API
Additional API Reference
Error Handling
ArcGIS plugin
QGIS plugin
Alteryx plugin
TravelTime.comchevronDocs

Error Response

Error Structure

The json body returned upon error contains the following attributes:

  • http_status - The http status returned with the error.
  • error_code - API error code, they are documented in the page Error Codes.
  • description - Summary of the error.
  • documentation_link - Link to this documentation.
  • additional_info - Additional information about the error. This only has data for error codes 2, 3, 13, 15, 16, 17 and 19, examples for such errors are provided bellow.

Examples

Error on Invalid JSON Content

{
  "http_status": 422,
  "error_code": 2,
  "description": "Invalid request json",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "obj.searches[0].transportation.type": [
      "Invalid value, possible values - [cycling, driving, driving+train, public_transport, walking, coach, bus, train]"
    ]
  }
}

Error on Invalid JSON Syntax

{
  "http_status": 400,
  "error_code": 3,
  "description": "Failed to parse json - syntax error",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "syntax_errors": [
      "Unexpected character ('f' (code 102)): was expecting comma to separate OBJECT entries"
    ]
  }
}

Error when fare data is unavailable

additional_info.search_id contains a single search id that caused the error.

{
  "http_status": 422,
  "error_code": 13,
  "description": "We do not have the fare data for this region. Fares are only supported in Great Britain",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "search_id": [
      "my search id"
    ]
  }
}

Error when public transport data is not available.

additional_info.search_id contains a single search id that caused the error.

{
  "http_status": 422,
  "error_code": 15,
  "description": "We do not have public transport data for the region at the time you have specified, try a more recent date",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "search_id": [
      "my search id"
    ]
  }
}

Error when attempting a search in an unsupported area

additional_info.search_id contains a single search id that caused the error.

{
  "http_status": 422,
  "error_code": 16,
  "description": "We do not support searches in the given area. Make sure that all points for a search are in the same country.",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "search_id": [
      "my search id"
    ]
  }
}

Error when we couldn’t start the search at the given point.

additional_info.search_id contains a single search id that caused the error.

{
  "http_status": 422,
  "error_code": 17,
  "description": "We couldn't start the search at the given point. Please make sure the start of the search is near a road or a path e.g. you are not attempting to start a search from a lake, river or a desolate area",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "search_id": [
      "my search id"
    ]
  }
}

Error on invalid Accepts header

{
  "http_status": 406,
  "error_code": 19,
  "description": "Unsupported content type was specified in the Accept header",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "supported_content_types": [
      "application/json",
      "application/vnd.wkt+json",
      "application/vnd.wkt-no-holes+json",
      "application/vnd.bounding-boxes+json"
    ]
  }
}