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:
- Generate the link to redirect to Connect.
- Make a request to Smartcar with the
code
obtained from Connect to obtain an access and refresh token - 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§
- Compatibility
Options - Options for Compatibility API
- Delete
Connections Filters - GetConnections
Filters - Options for get_connections
- GetConnections
Paging - Paging options for get_connections
- Scope
Builder - 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