Sections

  • Basics
  • API reference
  • Release notes
  • Deprecations
  • Examples
Sign in / Sign up
    • System
    • Day
    • Night
  • Sign in / Sign up
Mutate to update a navigation session
Mutate to finish navigation

Recalculate the route

Besides the updateNavigation mutation, there is another way to alter the route in a navigation session. By using the recalculateNavigation mutation a new route calculation can be enforced.

Mutation

To recalculate a route a navigation id and current_location need to be provided. Optionally, via points, a state_of_charge, and telemetry data can be included to optimize the new route. If the mutation executed succesfully, OK will be returned on the data object. The updates itself will be reflected on the navigationUpdatedById subscription or the navigation query. When using a query, please be aware that changes can take a little while to process.

To illustrate when this mutation should be used, two scenario's are described below.

1. Deviate from the route

In case a vehicle deviates from the calculated route (e.g. the driver takes a wrong exit), most navigation SDKs will detect this. It is recommended to hook into the event and send the location from the off route callback. Since recalculating a route can take a little while, make sure to not send multiple requests but wait until the navigationUpdatedById returns a new route.

2. Changing the via points

The second use case for using this operation is to change the manually added via points. This allows the driver to change the order of the via points, to add new ones or to delete them. Note that via points that were already reached are eliminated automatically.

Arguments

input • NavigationRecalculateInput

• Required

Navigation recalculate input

id • ID

ID of the navigation session

state_of_charge • StateOfChargeInput

State of charge at origin

value • Float

Value of the state of charge of the vehicle

type • StateOfChargeUnit

Type of the state of charge of the vehicle

Show StateOfChargeUnit enum values

kilometer

Return the state of charge in kilometers

mile

Return the state of charge in miles

kilowatt_hour

Return the state of charge in kilowatt hours

percentage

Return the state of charge as a percentage

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

current_location • PointInput

Origin location of a new route

type • PointType

Point type

Show PointType enum values

Point

coordinates • Float

Coordinates [longitude, latitude]

via • FeaturePointInput

Via points of a new route. If this field is not sent, the original via points will be used

id • String

The feature ID

type • FeatureType

Feature type

Show FeatureType enum values

Feature

geometry • PointInput

Geometry of the feature

type • PointType

Point type

Show PointType enum values

Point

coordinates • Float

Coordinates [longitude, latitude]

properties • JSON

Optional object where you can store custom data you need in your application. This extends the current functionalities we offer

telemetry • TelemetryInput

Telemetry data input

auxiliary_consumption • AuxiliaryConsumptionInput

Average auxiliary power consumption

value • Float

Value of the auxiliary power consumption of the vehicle

type • AuxiliaryConsumptionUnit

Type of auxiliary power consumption of the vehicle

Show AuxiliaryConsumptionUnit enum values

kilowatt_hour

Return the auxiliary consumption in kilowatt hours

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

battery_current • Float

Battery current in ampere

battery_temperature • BatteryTemperatureInput

Battery temperature

value • Float

Value of the temperature of the battery

type • TemperatureUnit

Type of temperature of the battery

Show TemperatureUnit enum values

Celsius

Return the temperature in Celsius

Fahrenheit

Return the temperature in Fahrenheit

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

battery_voltage • Float

Battery voltage in volts

is_charging • Boolean

Is the vehicle currently charging

charge_speed • ChargeSpeedInput

Rate of charge

value • Float

Value of the charge speed of the battery

type • ChargeSpeedUnit

Type of the charge speed of the battery

Show ChargeSpeedUnit enum values

kilowatt_hour

Return the charge speed in kilowatt hours

kilometers_per_hour

Return the charge speed in kilometers per hour

miles_per_hour

Return the charge speed in miles per hour

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

charge_total • ChargeTotalInput

Amount charged

value • Float

Value of the temperature of the battery

type • StateOfChargeUnit

Type of total charge amount

Show StateOfChargeUnit enum values

kilometer

Return the state of charge in kilometers

mile

Return the state of charge in miles

kilowatt_hour

Return the state of charge in kilowatt hours

percentage

Return the state of charge as a percentage

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

total_occupant_weight • TotalOccupantWeightInput

Cumulated weight of the occupants

value • Float

Value of the current weight of the occupants

type • WeightUnit

Type of the current weight of the occupants

Show WeightUnit enum values

kilogram

Return the weight in kilograms

pound

Return the weight in pounds

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

total_cargo_weight • TotalCargoWeightInput

Weight of the cargo

value • Float

Value of the current weight of the cargo

type • WeightUnit

Type of the current weight of the cargo

Show WeightUnit enum values

kilogram

Return the weight in kilograms

pound

Return the weight in pounds

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

elevation • ElevationInput

Current elevation

value • Float

Value of the elevation

type • DistanceUnit

Type of the value of elevation

Show DistanceUnit enum values

meter

Return the distance in meters

foot

Return the distance in feet

kilometer

Return the distance in kilometers

mile

Return the distance in miles

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

heading • Float

Current heading in degrees

motor_rpm • Int

RPM of the motor

occupants • Int

Number of occupants in the vehicle

odometer • OdometerInput

Mileage or odometer reading

value • Float

Value of the vehicle's odometer

type • DistanceUnit

Type of the value of the vehicle's odometer

Show DistanceUnit enum values

meter

Return the distance in meters

foot

Return the distance in feet

kilometer

Return the distance in kilometers

mile

Return the distance in miles

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

outside_temperature • OutsideTempInput

Outside temperature

value • Float

Value of the outside temperature

type • TemperatureUnit

Type of the value of the outside temperature

Show TemperatureUnit enum values

Celsius

Return the temperature in Celsius

Fahrenheit

Return the temperature in Fahrenheit

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

is_parked • Boolean

Vehicle is in park, neutral or turned off

power • PowerInput

Vehicle power

value • Float

Value of the positive or negative power. When negative the vehicle is charging

type • PowerUnit

Type of the value of the power

Show PowerUnit enum values

kilowatt

Return the power in kilowatts

horsepower

Return the power in horsepower

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

state_of_charge • StateOfChargeInput

Battery state of charge

value • Float

Value of the state of charge of the vehicle

type • StateOfChargeUnit

Type of the state of charge of the vehicle

Show StateOfChargeUnit enum values

kilometer

Return the state of charge in kilometers

mile

Return the state of charge in miles

kilowatt_hour

Return the state of charge in kilowatt hours

percentage

Return the state of charge as a percentage

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

tire_pressure • TirePressureInput

Average tire pressures of all wheels, starting from the front side right to left and to the rear

value • Float

Values for the tire pressure, starting from the front side right to left and to the rear

type • PressureUnit

Type of the value of pressure

Show PressureUnit enum values

bar

Return the pressure in bar

pounds_per_square_inch

Return the pressure in pounds per square inch

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

timestamp • Int

UNIX timestamp in seconds

vehicle_speed • VehicleSpeedInput

Vehicle speed

value • Float

Value of the vehicle speed

type • SpeedUnit

Type of the vehicle speed

Show SpeedUnit enum values

kilometers_per_hour

Return the speed in kilometers per hour

miles_per_hour

Return the speed in miles per hour

source • TelemetryInputSource

Source of inputted data, defaults to 'manual'

Default • manual

Show TelemetryInputSource enum values

manual

Manually inputted value

telemetry

Value from the vehicle's telemetry

custom • JSON

Custom input fields can be added based on telemetry architecture

Response

A response can either contain a data or an errors object. The response header will always return 200 as a status code.

Data object

When successful, a data object will be returned with the requested fields. If there are no fields present the data object will return the operation name with the appropriate return type. If the operation was a query, this output will be an object of the schema’s query root type; if the operation was a mutation, this output will be an object of the schema’s mutation root type.

Error object

If unsuccessful, an errors object will be returned with more details in the extensions object. The error object can contain any of the following objects.

Error

EMPTY_ARRAY_NOT_ALLOWED

Array $NAME should have at least one value

Error

INVALID_COORDINATES

Coordinates provided for $LOCATION are not valid.

Error

INVALID_UNIT

Provided unit type $TYPE for $LOCATION is not valid.

Error

INVALID_VALUE

Provided value $VALUE for $LOCATION is not valid. Expected value of type $EXPECTEDTYPE.

Error

NAVIGATION_TELEMETRY_INVALID

Field $TELEMETRYTYPE cannot be negative

Error

NEGATIVE_VALUE_NOT_ALLOWED

Negative value for $LOCATION is not allowed.

Error

OCCUPANTS_BELOW_ALLOWED

Provided number of occupants for $LOCATION is not valid. The value must be at least 1.

Error

TIRE_PRESSURE_BELOW_ALLOWED

Provided tire pressure is not valid. The value must be at least 1.

Error

ZERO_OR_NEGATIVE_VALUE_NOT_ALLOWED

Zero or negative value for $LOCATION is not allowed.

  • Basics

    API Basics GraphQL Basics EV basics
  • API reference

    API Vehicles 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 StatementState of chargeTry Chargetrip Go

© Chargetrip 2023

Build with love in

Amsterdam ❤️

API reference

  • API
  • Vehicles
  • Stations
  • Routes
  • Navigation
  • Vehicle connectivity
  • Tile service
  • Isolines

Sections

  • Quick setup guide
  • Pagination
  • Introduction
  • Query vehicles
  • Query vehicle details
  • Query premium vehicle 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
  • Mutate to create a new connected vehicle
  • Subscribe to a connected vehicle
  • Mutate to authorize a connected vehicle
  • Query connected vehicle list
  • Query data from vehicle
  • Query connected vehicle
  • Mutate to update a connected vehicle
  • Mutate to remove a connected vehicle
  • Introduction
  • Properties
  • Filters
  • Integration
  • Introduction
  • Mutation to create an isoline
  • Subscribe to isoline details
  • Query isoline details