Learn how to obtain your first Smartcar API access token by exchanging an authorization code.
1. Launch Smartcar Connect
redirect_uri
with an authorization code
as a query parameter.2. Handle the Redirect and Extract the Code
redirect_uri
. When Smartcar redirects the user, extract the code
parameter from the query string.
Example redirect:3. Exchange the Code for an Access Token
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.