1
1. Launch Smartcar Connect
Direct your user to the Smartcar Connect URL. The user will:
- Select their vehicle brand
- Log in with their connected services account
- Approve the requested permissions
redirect_uri
with an authorization code
as a query parameter.2
2. Handle the Redirect and Extract the Code
Your application should listen for requests to the
redirect_uri
. When Smartcar redirects the user, extract the code
parameter from the query string.
Example redirect:3
3. Exchange the Code for an Access Token
Use the authorization code to request an access token and refresh token from Smartcar’s OAuth token endpoint.Here is an example using the Smartcar Node.js SDK:The response will include an
access_token
, an expires_in
field, and a refresh_token
. Store these securely in your backend database.
The access_token
expires after two hours, and the refresh_token
expires after 60 days.