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.
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
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.
Error
AUTH_TOKEN_EXPIRED
The token you provided is expired.
Error
AUTH_TOKEN_INVALID
The token you provided is invalid.
Error
CONNECT_PROVIDER_NOT_ALLOWED
The Connect provider $PROVIDER is not configured for your client id. Please contact customer support to enable it!
Error
CONNECTED_VEHICLE_PER_MAKE_LIMIT_REACHED
The maximum number of vehicles per make ($LIMIT) was reached.
Error
CONNECTED_VEHICLE_REMOVAL_NOT_ALLOWED
You cannot remove a vehicle with status $STATUS.
Error
ENODE_PROXY_EXCEPTION
Enode remote did throw an exception that could not be handled.
Error
NEW_CONNECTED_VEHICLE_INVALID_OPTIONS_ENODE
Provided options are invalid. Enode requires the following options: redirect_uri, scope.
Error
OPERATION_NOT_ALLOWED
You are not allowed to execute this operation. Enable it for the current application in the dashboard or reach out to customer support.
Error
VEHICLE_ALREADY_CONNECTED
This vehicle has already been connected to a provider for this user.