For the complete documentation index, see llms.txt. This page is also available as Markdown.

Route with Google

Build a driving route with the Google Directions API, and read back Google's own failure codes.

This is route/get with the provider pinned to the Google Directions API. Use it when the route must come from Google regardless of the account's default provider.

What differs from the generic operation is the failure detail. Google's own status strings arrive in an errors array alongside the Navixy platform error code, so a caller can tell a quota problem from an unroutable request.

API actions

API base path: /route/google.


Get route with Google

post
/route/google/get

Return a route calculated by the Google Directions API. Identical to route/get with provider_type pinned to google; a provider_type sent here is ignored.

Google allows at most 8 waypoints besides the origin and destination, or 23 for Maps API for Business customers. Exceeding that is reported as error 218 with MAX_WAYPOINTS_EXCEEDED.

Requires the routing tariff feature on every tracker on the account. Without it the call returns error 236.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
point_limitinteger · min: 2Optional

Optional. Simplify the returned route to at most this many points.

Responses
200

The route

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
distanceintegerOptional

Total length in metres.

timeintegerOptional

Total duration in seconds.

post/route/google/get
POST /v2/route/google/get HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "start": {
    "lat": 1,
    "lng": 1
  },
  "end": {
    "lat": 1,
    "lng": 1
  },
  "waypoints": [
    {
      "lat": 1,
      "lng": 1
    }
  ],
  "point_limit": 1
}
{
  "success": true,
  "distance": 1,
  "time": 1,
  "list": [
    {
      "lat": 1,
      "lng": 1
    }
  ],
  "key_points": [
    {
      "id": 1,
      "lat": 1,
      "lng": 1,
      "distance": 1,
      "time": 1
    }
  ]
}

Errors

These errors come in addition to the general error codes:

  • 215 - External service error. The errors array holds one of OVER_QUERY_LIMIT, when the service has received too many requests from the application within the allowed time period, REQUEST_DENIED, when the service denied the application use of the directions service, or UNKNOWN_ERROR, a server error that may succeed on retry.

  • 218 - Malformed external service parameters. The errors array holds one of NOT_FOUND, when at least one of the origin, destination, or waypoint locations could not be geocoded, ZERO_RESULTS, when no route could be found, MAX_WAYPOINTS_EXCEEDED, when the request carries too many waypoints, at most 8 plus the origin and destination, or 23 for Google Maps API for Business customers, or INVALID_REQUEST, for an invalid parameter or parameter value.

  • 236 - Feature unavailable due to tariff restrictions, when at least one tracker in the request has no routing tariff feature.

An error response looks like this:

Last updated

Was this helpful?