Sections

  • Basics

  • API reference

  • Release notes

  • Deprecations

Sign in / Sign up
    • System

    • Day

    • Night

  • Sign in / Sign up
Query navigation session
Mutate to recalculate navigation

Updating a navigation session

Once you have created a navigation session and set up a subscription, you can provide more data to update the navigation session. Based on the locations and telemetry data, the Chargetrip algorithms optimize the route.

Mutation

In order to update a navigation session you need to provide the id and an array of locations_data. The other fields, heading and telemetry are optional but including them will result in better consumption predictions and more accurate routing.

Locations data heartbeat

You need to send at least one location in locations_data array. If you are using Mapbox as a data provider you will periodically receive updates that can be stored in a local cache. Alternatively, you could store a location every 5 or 10 seconds depending on the vehicle speed.

We recommend you to send the vehicle location at least every 5 minutes.

Telemetry data

Besides location data our API accepts telemetry data. This is real-time data coming directely from the vehicle. You can read more about connected vehicle data here. This data may includes the state_of_charge of the vehicle. This would allow you to send us a new SoC value after charging at a station. Or you could send us intermittend SoC values to confirm our rolling prediction.

Besides the state_of_charge, you can provide us with other telemetry data like the average tire_pressure of all wheels or whether or not the vehicle is charging via the is_charging boolean. There are many more accepted telemetry fields depending on the make and model of the vehicle. You can find an overview of accepted/recommended telemetry fields here. Chargetrip can easily add additional custom telemetry inputs; heat pump, active weight, refrigeration, PV etc. Please contact your account manager or contact sales@chargetrip.com.

Arguments

input • non_null • NavigationUpdateInput

Required

Navigation update input

id • non_null • ID

Required

ID of the navigation session

heading • scalar • Float

Heading of a vehicle, in degrees

location_data • list • NavigationUpdateLocationsInput

A list of locations that were collected since the last update

geometry • non_null • PointInput

Required

GPS location

type • non_null • PointType

Required

Point type

Point

coordinates • list • Float

Coordinates [longitude, latitude]

properties • non_null • NavigationUpdateLocationPropertiesInput

Required

Extra information about the location

route_leg • non_null • Int

Required

Current route leg index corresponding to a location

speed • non_null • Float

Required

Speed at a location, in km/h

timestamp • non_null • Int

Required

UNIX timestamp at location, in seconds

altitude • scalar • Int

Altitude information, in meters. This is optional

telemetry • input_object • NavigationTelemetryUpdateInput

Telemetry data input

state_of_charge • scalar • Float

State of charge at the last known location, in kwh

is_charging • scalar • Boolean

Indicates if a vehicle is charging

tire_pressure • scalar • Float

Average tire pressure, in bars. This information should come from telemetry

Response

If successful, the HTTP status code in the response header is 200 and the response body contains the attributes you requested.

If unsuccessful, the header status code is an error code and the response body contains an error response object. The error response object can be any of the ones below.

Errors and warnings

Error

NAVIGATION_HEADING_INVALID

Heading should be a value between 0 and 360

Error

NAVIGATION_LOCATION_INVALID

One or more locations sent are invalid

Error

NAVIGATION_LOCATIONS_MINIMUM_LENGTH

You should send us at least one location

Error

NAVIGATION_TELEMETRY_INVALID

Field $TELEMETRYTYPE cannot be negative

Request

  • 01
  • 02
  • 03
  • 04
  • 05
  • 06
  • 07
  • 08
  • 09
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
          mutation updateNavigation {  updateNavigation(    input: {      id: "624fed3789403385e0eca8d2"      heading: 174.5      locations_data: [        {          geometry: { type: Point, coordinates: [9.9936818, 53.5510846] }          properties: {            route_leg: 0            speed: 48.3            timestamp: 1649322266            altitude: 23          }        }        {          geometry: { type: Point, coordinates: [9.9936822, 53.5510866] }          properties: {            route_leg: 0            speed: 51.3            timestamp: 1649322266            altitude: 23          }        }      ]      telemetry: {        state_of_charge: 42.40        is_charging: false        tire_pressure: 2.7      }    }  )}
        
Playground

Response

  • 01
  • 02
  • 03
  • 04
  • 05
          {  "data": {    "updateNavigation": null  }}
        
  • Basics

    API Basics

    GraphQL Basics

    EV basics

  • API reference

    API

    Cars

    Stations

    Routes

    Navigation

    Vehicle connectivity

    Tile service

    Isolines

  • Products

    Website

    Dashboard

    Help center

    SDKs

  • Tooling

    Playground

    Voyager

    Examples

    API Status

  • Legal

    Terms & Conditions

    Privacy Policy

    Cookie Policy

    SLA

    Security

Mission Statement

State of charge

Try Chargetrip Go

© Chargetrip 2022

Build with love in

Amsterdam ❤️

API reference

  • API

  • Cars

  • Stations

  • Routes

  • Navigation

  • Vehicle connectivity

  • Tile service

  • Isolines

Sections

  • Quick setup guide

  • Pagination

  • Introduction

  • Query cars

  • Query car details

  • Query premium car details

  • Introduction

  • Query stations

  • Query station details

  • Query stations around a GeoJSON point

  • Query station reviews

  • Mutate to create a station review

  • Query station operators

  • Query station operator details

  • Query station tariffs

  • Query station tariff details

  • Query station amenities

  • Query station statistics

  • Introduction

  • Mutate to create a new route

  • Subscribe to route updates

  • Query route details

  • Query route path

  • Introduction

  • Mutate to start a new navigation session

  • Subscribe to navigation updates

  • Query navigation session

  • Mutate to update a navigation session

  • Mutate to recalculate navigation

  • Mutate to finish navigation

  • Introduction

  • Telemetry

  • Introduction

  • Properties

  • Filters

  • Integration

  • Introduction

  • Mutation to create an isoline

  • Subscribe to isoline details

  • Query isoline details