Pricing

Docs

Guides

Scope

When your application wants to access functionalities of a user's vehicle, the user needs to grant your application access to a scope of permissions through Connect. However, not all vehicles possess the same functionalities (e.g. an ICE vehicle will not possess the GET /battery functionality). Therefore, it is important to define exactly which permissions are required, and which ones are optional for your use case.

Optional permissions

All permissions requested through Connect are optional by default. Therefore, when a vehicle gets authorized through Connect, it might or might not possess the functionalities that your application requested access to. After a vehicle is authorized, you can check whether it possesses the requested functionalities. In order to do so, use the /vehicles/{vehicle_id}/permissions endpoint or use either the hasPermissions (Node.js, Java) or the has_permissions (Python) function on the Smartcar API SDKs.

Here's an example of how to construct a redirect URI with optional permissions:

  • 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 client = new smartcar.AuthClient({
  clientId: 'SMARTCAR_CLIENT_ID',
  clientSecret: 'SMARTCAR_CLIENT_SECRET',
  redirectUri: 'YOUR_CALLBACK_URI',
  scope: ['read_vehicle_info'],
});

Required permissions

You can specify which permissions are required by adding the required: prefix to each required permission. When a vehicle gets authorized through Connect, you can be certain that it is compatible with all required permissions.

Use required permissions only when they are needed for your application's basic functionality. We recommend that you use required permissions sparingly, as they might decrease the number of vehicles that are compatible with your application.

Here's an example of how to construct a redirect URI with required permissions:

  • 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 client = new smartcar.AuthClient({
  clientId: 'SMARTCAR_CLIENT_ID',
  clientSecret: 'SMARTCAR_CLIENT_SECRET',
  redirectUri: 'YOUR_CALLBACK_URI',
  scope: ['required:read_vehicle_info'],
});

Next steps