In this tutorial, we will go over how to integrate Connect into your application and make requests to a vehicle using our backend SDKs.
REDIRECT_URI
. The Application Server, which is listening
at the REDIRECT_URI
, will retrieve the authorization code from query parameters sent to the REDIRECT_URI
.code
along with
the Application’s CLIENT_ID
and CLIENT_SECRET
.ACCESS_TOKEN
and a REFRESH_TOKEN
.ACCESS_TOKEN
, the Application can now send requests to the Smartcar API. It can access protected resources and send commands
to and from the user’s vehicle via the backend service.CLIENT_ID
and CLIENT_SECRET
from the Configuration section on the Dashboard.REDIRECT_URI
to your application configuration: http://localhost:8000/exchange
SMARTCAR_REDIRECT_URI
environment variable to the URI you used for that application.Smartcar
object in the constructor of the App component.
mode
to simulated
or live
where you instantiate your Smartcar
object to
connect to a simulated or real vehicle.AUTHORIZATION_URL
function in our Smartcar object and redirect the user to the URL to launch the Connect flow.
REDIRECT_URI
with an authorization code
as a query parameter. In the previous section, we had set our REDIRECT_URI
as localhost:8000/exchange
.
Now, our server can be set up as follows to receive the authorization code
.
http://localhost:8000/login
test
mode by default.
In test
mode, any username
and password
is valid for each brand.read_vehicle_info
in this case.
Once you have logged in and accepted the permissions, you should see your authorization code
printed to your console.
code
. The application must exchange the code for an ACCESS_TOKEN
to make a request.
After receiving the ACCESS_TOKEN, the user can be redirected to the /vehicle
route.
ACCESS_TOKEN
, it can send requests to a vehicle using the Smartcar API.
First we’ll need to fetch the vehicle_id
s associated with the ACCESS_TOKEN
, then fetch vehicle attributes for one of them. After
receiving the vehicle_attributes
object, we can render it in a simple table on the page.
http://localhost:8000/login
to go through Connect and make your first API request!