# REST API

The Vehicle Data API lets you work with car data on any platform using a REST API. This tutorial will help you get started and show you how to work with it. By following the steps you will be receiving odometer data from the car simulator.

{% hint style="info" %}
**ENDPOINT URL**

Note that the REST API base URL is <https://sandbox.api.high-mobility.com/v1> when working with the sandbox vehicles and <https://api.high-mobility.com/v1> for live vehicle data.

When you use the configuration snippets from the platform as shown in this tutorial, you will always be using the right URL automatically.
{% endhint %}

### 1. Create an application

Visit the [Console](http://console.high-mobility.com/), create an application and select the data which are intrested in.

### 2. Create a simulator&#x20;

In the "Simulation studio" you are able to create vehicles to link with your app and to test with the simulators. Go to the simulation studio and click the big plus (+) button.

### 3. Link Vehicle and Retrieve Access Token

Now to use the REST API you will need to create an Access Token. Follow the [Fleet Clearance](https://docs.high-mobility.com/docs/getting-started/fleet-clearance) guide  for fleet vehicles.&#x20;

### 4. Send a Request

Once the simulator is open, fire away a request. For example to get the diagnostics state of the vehicle.

If you see that the app lacks permissions, you will need to revisit step two of the "[Create an application](#id-1.-create-an-application)" section of this document and select the appropriate permissions for your telematics command.

```javascript
const request = require('request')

request.get({
  url: 'https://sandbox.api.high-mobility.com/v1/vehicle-data/autoapi-13/{vin}',
  headers: {
    Authorization: 'Bearer ' + accessToken
  }
}, (error, response, body) => {
  console.log('error:', error)
  console.log('statusCode:', response && response.statusCode)
  console.log('body:', body)
})

```

<br>

{% hint style="info" %}
**AUTO API**

Check out the [Data API OpenAPI Specification](https://app.gitbook.com/s/GqovsBFw7seb5vTEwucj/data/vehicle-data) for all details
{% endhint %}
