This changelog contains all major updates and feature additions to version 2.0 of Smartcar’s APIs.

v2.0 SDK methods

If you are using one of our SDKs, please add the following code block to specify that all requests should be made to v2.0 of the Smartcar API.

Note: It’s best to invoke the method from a “central” part of your codebase, as the helper method only needs to be invoked once rather than before every API request.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
const smartcar = require('smartcar');

smartcar.setApiVersion('2.0');

If you are not using any of our SDKs, simply replace /v1.0/ with /v2.0/ in the URLs that you construct.

Errors

We updated the errors returned by Smartcar’s API and webhooks to include a lot more detail. We also introduced new error types and codes to let developers more easily investigate Smartcar errors.

Smartcar errors now contain the following properties:

PropertyDescription
typeA unique identifier that groups codes into broad categories of errors. This property roughly maps to the “error” property in version 1.0, but we have renamed the types and introduced new ones.
codeA short, descriptive identifier for the error that occurred. This property roughly maps to the “code” property in version 1.0, but we have renamed the codes and introduced new ones.
descriptionA short description of the code that provides additional information about the error. This property maps to the “message” property in version 1.0.
docURLA link to Smartcar’s doc center guide for the given type and code
statusCodeThe HTTP status code
requestIdSmartcar’s request ID
resolutionAn enumerated type that specifies which action can be taken to resolve this error

Migration steps

  1. Reference body.type instead of body.error.
  2. Reference body.description instead of body.message.
  3. Make use of the new values of type and code rather than the old values by referencing the mapping in the table below. Note that some version 1.0 errors map to multiple version 2.0 errors, as version 2.0 contains more detailed errors.
The above steps correspond to the minimal amount of work that you’ll need to do in order to start using version 2.0 of the Smartcar API. In addition to those steps, we recommend that you read the new error guides and make use of all new codes and properties.
error (1.0)code (1.0)type (2.0)code (2.0)
validation_errorN/AVALIDATIONnull
vehicle_owner_action_requiredVOA_000CONNECTED_SERVICES_ACCOUNTAUTHENTICATION_FAILED
vehicle_owner_errorVOA_001CONNECTED_SERVICES_ACCOUNTSUBSCRIPTION
vehicle_owner_errorVOA_002CONNECTED_SERVICES_ACCOUNTNO_VEHICLES
vehicle_owner_errorVOA_002CONNECTED_SERVICES_ACCOUNTVEHICLE_MISSING
vehicle_owner_errorVOA_003CONNECTED_SERVICES_ACCOUNTACCOUNT_ISSUE
authentication_errorN/AAUTHENTICATIONnull
permission_errorN/APERMISSIONnull
resource_not_found_errorN/ARESOURCE_NOT_FOUNDPATH
version_not_found_errorN/ARESOURCE_NOT_FOUNDVERSION
vehicle_state_errorVS_000VEHICLE_STATEUNKNOWN
vehicle_state_errorVS_001VEHICLE_STATEDOOR_OPEN
vehicle_state_errorVS_002VEHICLE_STATETRUNK_OPEN
vehicle_state_errorVS_003VEHICLE_STATEHOOD_OPEN
vehicle_state_errorVS_004VEHICLE_STATECHARGING_PLUG_NOT_CONNECTED
vehicle_state_errorVS_005VEHICLE_STATEFULLY_CHARGED
vehicle_state_errorVS_006VEHICLE_STATEASLEEP
vehicle_state_errorVS_007VEHICLE_STATEUNREACHABLE
vehicle_state_errorVS_008VEHICLE_STATEIGNITION_ON
vehicle_state_errorVS_009VEHICLE_STATEIN_MOTION
vehicle_state_errorVS_010VEHICLE_STATEREMOTE_ACCESS_DISABLED
vehicle_state_errorVS_011VEHICLE_STATECHARGING_IN_PROGRESS
rate_limiting_errorN/ARATE_LIMITSMARTCAR_API
monthly_limit_exceededN/ABILLINGVEHICLE_LIMIT
monthly_limit_exceededN/ABILLINGVEHICLE_REQUEST_LIMIT
server_errorN/ASERVERINTERNAL
server_errorN/AUPSTREAMNO_RESPONSE
server_errorN/AUPSTREAMINVALID_DATA
server_errorN/AUPSTREAMKNOWN_ISSUE
server_errorN/AUPSTREAMUNKNOWN_ISSUE
vehicle_not_capable_errorN/ACOMPATIBILITYSMARTCAR_NOT_CAPABLE
vehicle_not_capable_errorN/ACOMPATIBILITYVEHICLE_NOT_CAPABLE

Webhook verification

The verification payload now includes the ID of the requested webhook. It also includes an eventName property that lets you distinguish verify events from other webhook events. For verify events, the eventName property will be set to “verify”. The challenge property is now nested under a payload property.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
{
  "version": "2.0",
  "webhookId": "uuid",
  "eventName": "verify",
  "payload": {
    "challenge": "string"
  }
}

Migration steps

  1. Reference body.payload.challenge instead of body.challenge.
  2. (Optional:) Use body.eventName to detect a webhook verification request rather than checking for the presence of the challege property.

Webhook event payloads

The vehicles property is now nested under a payload property.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
{
  "version": "2.0",
  "webhookId": "uuid",
  "eventName": "schedule",
  "mode": "test|live",
  "payload": {
    "vehicles": []
  }
}

Migration steps

  1. Reference body.payload.vehicles instead of body.vehicles.