Create a new connected vehicle

To connect to a vehicle, a new connected vehicle needs to be created. A connected vehicle is tied to a Chargetrip vehicle profile by id. Each vehicle exposes the connect providers available for that particular vehicle. The vehicleList filter capabilities can be used to find all vehicles that can be connected through a specific provider.

If you are looking for other providers or missing features, please contact sales@chargetrip.com.

Note

Connected vehicles are tied to an authenticated user. In order to use the vehicle connectivity operations provide a valid Authorization header. Your customer support manager can provide more information on how to integrate user authentication.

Mutation

To create a new connected vehicle provide the vehicle_id, provider and options input arguments. Optionally a label argument can be provided to give the connected vehicle a unique name.

To find out which vehicles are supported by the provider configured on your project query the vehicle list with the connect.provider field or use the filter argument.

Based upon the provider specific steps are required which are described below.

Enode

After executing the mutation a new connected vehicle with a status pending will be returned. The authorization_url field provides you with a custom link to set up the connection with the vehicle. Open the url in a web browser and go through the Enode flow before continuing with the authorizeConnectedVehicle mutation.

After finishing the flow a redirect will be triggered towards the options.redirect_uri.

Arguments

input CreateConnectedVehicleInput

Frequently used fields

id ID

Unique ID of the connected vehicle

status ConnectedVehicleStatus

Status of the connected vehicle

Show ConnectedVehicleStatus enum values

authorization_url String

URL to connect the vehicle to the connectivity provider

Other fields

vehicle_id ID

Unique ID of the vehicle

provider CarConnectivityProvider

Connectivity provider

Show CarConnectivityProvider enum values

scope ConnectScope

Scope for accessing the vehicle

Show ConnectScope enum values

label String

Custom label for a connected vehicle that can be assigned by a user

vin String

Vehicle identification number, unique identifier for a vehicle

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.