What is Postman?
Postman is a great software development tool that enables you to test APIs. Instead of writing code snippets, Postman allows you to format your API requests in a GUI and view the responses.
How can I configure Postman to test Smartcar's API?
You’ll need a few things to start making API calls with Smartcar:
You can download Postman here, then install it to your system.
Smartcar's Postman Collection
Smartcar offers a pre-configured set of all of our endpoints for Postman. You can download this set here.
Once downloaded, import the collection to Postman:
If you haven’t already signed up for a Smartcar account, you can do so from this signup link.
Grab your Client ID and Client Secret tokens when you sign in, and copy them to someplace secure. You’ll need those tokens a little later in this setup.
Vehicle Authorization Token
To connect a test (or live) vehicle to Smartcar, follow these steps:
Click the 3 dots on the Smartcar Collection you imported, then click Edit Collection.
Select OAuth 2.0 and press "Get New Access Token."
Add your Callback URL to your Smartcar Dashboard and fill out the rest of the parameters.
- Callback URL: http://localhost:8000/callback (Make sure that this is saved as a Redirect URI in your Smartcar Dashboard)
- Auth URL: https://connect.smartcar.com/oauth/authorize?approval_prompt=force
- Access Token URL: https://connect.smartcar.com/oauth/token
- Client ID/Secret: Retrieve these from your Smartcar Dashboard
- Scope: Enter the list of permissions you want to request from your car. A complete list can be found here.
After filling out the parameters above, click "Request Token" to be taken through the Smartcar Connect flow to register a car. Click "Use Token" when the flow completes.
That’s it! Select Vehicle List from your Smartcar API collection and hit send, and you’ll receive a Vehicle ID for the car you just connected. You’ll be able to use that ID to request information from the rest of the endpoints in the set.