> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withterminal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Here's a step-by-step guide to get started integrating telematics data with Terminal.

<Info>
  **Prerequisites** You must have a valid sandbox secret and publishable key to
  follow this guide. Existing Terminal customers can get them from [API
  keys](https://dashboard.withterminal.com/api-keys) with the environment set to
  Sandbox. If you're not a Terminal customer yet, you can [connect with us
  here](https://calendly.com/d/csmh-278-pqz/discovery-call).
</Info>

## Overview

Getting data flowing takes three parts: a customer authenticates through Terminal Link, you exchange the token Link returns for a connection token, then you pull that connection's data once its first sync finishes. The steps below run all three against the Sandbox provider, so you can test without a real telematics account.

## Instructions

1. Download our [Postman collection](https://github.com/terminal-api/postman) and import it into Postman.

2. Make a test connection.
   1. Launch Link to create a new connection.

      Replace `{PUBLISHABLE_KEY}` with your sandbox publishable key and open the Link URL below.

      ```
      https://link.sandbox.withterminal.com/?key={PUBLISHABLE_KEY}&backfill_days=2&redirect_url=https%3A%2F%2Fpostman-echo.com%2Fget
      ```

   2. Select the Sandbox provider.

   3. Enter any value as the API Key to create a connection.

      <Tip>
        Any value works here, since this is a test connection in the sandbox
        environment and Link doesn't check the API Key against a real telematics
        account. Enter `invalid` or `permissions` instead if you want to
        simulate a failed connection. See the [Sandbox Environment
        guide](/guides/sandbox-environment) for details.
      </Tip>

   4. Wait to be redirected to the `redirect_url` with a `token` appended to the URL.

3. Pull the connection's data.
   1. Copy the public `token` from the redirected page.

   2. Exchange the public token for a long lived connection token.

      Call [`POST /public-token/exchange`](/api-reference/authentication/public-token-exchange):

      ```bash theme={null} theme={null}
      curl --request POST \
        --url 'https://api.sandbox.withterminal.com/tsp/v1/public-token/exchange' \
        --header 'Authorization: Bearer your_sandbox_secret_key' \
        --header 'Content-Type: application/json' \
        --data '{"publicToken": "your_public_token"}'
      ```

      Save the `token` from the response. It's your connection token, and every request you make for this connection needs it in a `Connection-Token` header.

   3. Poll until the initial sync completes.

      Call [`GET /connections/current`](/api-reference/connections/get-current-connection) and check `lastSync.status`:

      ```bash theme={null} theme={null}
      curl --request GET \
        --url 'https://api.sandbox.withterminal.com/tsp/v1/connections/current' \
        --header 'Authorization: Bearer your_sandbox_secret_key' \
        --header 'Connection-Token: your_connection_token'
      ```

      <Tip>
        Polling works fine for a quickstart, but for production traffic
        subscribe to `sync.completed` (and `connection.created`)
        [webhooks](/guides/webhooks) instead so you're not left waiting on a
        request.
      </Tip>

   4. List the synced vehicles.

      Call [`GET /vehicles`](/api-reference/vehicles/list-vehicles):

      ```bash theme={null} theme={null}
      curl --request GET \
        --url 'https://api.sandbox.withterminal.com/tsp/v1/vehicles' \
        --header 'Authorization: Bearer your_sandbox_secret_key' \
        --header 'Connection-Token: your_connection_token'
      ```

Congrats, you've completed the quickstart! You have a working connection in Sandbox and pulled its data.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.