Crate smartcar

Source
Expand description

§smartcar - the Rust SDK for Smartcar API

smartcar is a client library for sending requests to Smartcar API. Smartcar API lets you read vehicle data and send commands to vehicles using HTTP requests.

To make requests to a vehicle from a web or mobile application, the end user must connect their vehicle using Smartcar Connect. This flow follows the OAuth spec and will return a code which can be used to obtain an access token from Smartcar.

The Smartcar Rust SDK provides methods to:

  1. Generate the link to redirect to Connect.
  2. Make a request to Smartcar with the code obtained from Connect to obtain an access and refresh token
  3. Make requests to the Smartcar API to read vehicle data and send commands to vehicles using the access token obtained in step 2.

Before integrating with Smartcar’s SDK, you’ll need to register an application in the Smartcar Developer portal. If you do not have access to the dashboard, please request access.

Modules§

auth_client
Everything needed for Smartcar Connect and getting tokens
error
Classifies all potential errors of this SDK, including the Smartcar API V2 Error response.
request
response
These structs are representations of the response body after sending a request to Smartcar API
vehicle
This module includes the the Vehicle struct, which is responsible for getting data from and sending comands to a vehicle.
webhooks
Helpers for integrating webhooks with your application

Structs§

CompatibilityOptions
Options for Compatibility API
DeleteConnectionsFilters
GetConnectionsFilters
Options for get_connections
GetConnectionsPaging
Paging options for get_connections
ScopeBuilder
Builder of a list of permissions

Enums§

Permission
A permission that your application is requesting access to during SmartcarConnect

Functions§

delete_connections
Deletes all vehicle connections associated with a Smartcar user ID or a specific vehicle.
get_compatibility
Given a VIN, country, and a list of permissions, determine:
get_connections
Returns a paged list of all vehicles that are connected to the application associated with the management API token used, sorted in descending order by connection date.
get_user
Return the id of the vehicle owner who granted access to your application.
get_vehicles
Return a list of the user’s vehicle ids