Vehicle State
When a vehicle is first subscribed to a webhook, Smartcar will send an initial payload that attempts to get all the signals you’re subscribed to for that vehicle with aVEHICLE_STATE
type. Subsequent events will contain a payload with the same event type but only the relevant signals based on your webhook configuration. (i.e, when a signal changes, on a schedule, etc.)
Vehicle state payloads will contain the following object types for the triggers
array:
SIGNAL_UPDATED
: indicates that a signal value has changed since the last payload was sent. Thesignal
object will contain thecode
of the signal that was updated.FIRST_DELIVERY
: indicates that this is the first payload sent for this vehicle. This trigger will only be present in the initial payload sent when a vehicle is first subscribed to a webhook, unsubscribed and then resubscribed to your webhook, or if your application is not responding with a 200 status code, we will attempt to deliver this webhook again.
VEHICLE_STATE
payload, but the signal will contain an error object instead of data as shown in the example below.
meta
object that contains the following fields:
retrievedAt
: The timestamp (in milliseconds since epoch) of when the data was retrieved from the vehicle by Smartcar.oemUpdatedAt
: The timestamp (in milliseconds since epoch) of when the data was last recorder by the vehicle.
code
with the unique signal code that can be used to retrieve that signal from the API by calling the GET
Signal endpoint.
The name
and group
fields correspond to the signal’s name and group respectively as defined in the Signal Schema.
Vehicle connection or compatibility issues
There may be times when Smartcar is unable to get vehicle data because there is an issue with our connection to the vehicle that requires vehicle owner interaction, or because the subscribed vehicle does not support some of the signals you have configured. Smartcar will allow you to subscribe any vehicle to your webhook. When processing the initial payload, we will report compatibility issues to your error callback URI. For example, if a vehicle is not capable of thenickname
signal we would
send data for other signals as normal, but send the following payload for the nickname
signal instead.
When either of these happens, we’ll send a VEHICLE_ERROR
payload to your vehicle error callback URI. If you don’t specify a callback URI for errors, Smartcar will send them to the same vehicle data callback URI.
For a list of possible errors, please refer to the API Errors section.
state
set to RESOLVED
. If you don’t specify a callback URI for errors, Smartcar will send them to the same vehicle data callback URI.