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

# Connect telematics accounts

> This guide shows the steps for connecting your Telematics account to PathStack so you can access unified device data.

<Steps>
  <Step title="Get an integration link">
    To connect providers, you will need to obtain a connection link. To obtain a connection link, call the `/tenant`
    endpoint.

    ```python Python theme={null}
    import requests

    url = "https://api.pathstack.io/tenant"
    headers = {"Authorization": "Bearer <access-token>"}

    response = requests.request("GET", url, headers=headers)

    connection_url = response.json()["data"]["connection_url"]
    print(connection_url)
    # example: https://portal.dev.pathstack.io/connect?code=83pbN8feZDK8F4L3rJH2fX-EsJS0MDEDKE0
    ```

    Replace `<access-token>` with an access token. You can find out how to get an access token [here](/content/authentication).

    This connection link is used to integrate with our partnered telematics providers. See a full list of supported
    providers [here](/in-depth/providers).

    This link is used to connect your telematics accounts to PathStack. You can do this yourself, or send this link to
    your clients. To connect an integration, select the telematics company in the list.

    <Frame>
      <img className="block dark:hidden" src="https://mintcdn.com/nuonic-39/IvvWU3allt6PGoB1/images/integration-page-1.png?fit=max&auto=format&n=IvvWU3allt6PGoB1&q=85&s=2a0cab756b76e1dce2839da6efda057c" width="638" height="843" data-path="images/integration-page-1.png" />

      <img className="hidden dark:block" src="https://mintcdn.com/nuonic-39/IvvWU3allt6PGoB1/images/integration-page-1-dark.png?fit=max&auto=format&n=IvvWU3allt6PGoB1&q=85&s=b51b4556c3275539f78f7bb2900a793b" width="638" height="833" data-path="images/integration-page-1-dark.png" />
    </Frame>
  </Step>

  <Step title="Connect your integration to PathStack">
    Now that you (or your client) have selected the integration, enter the details for the connection.

    The fields for **Business Name** and **ABN** are for identifying the telematics connection. The other fields are
    specific to each integration. In this example, you would need to provide the Verizon Connect App ID, and the
    username and password for accessing the API.

    <Note>All credentials are securely stored in PathStack once a telematics integration has been connected.</Note>

    <Frame>
      <img className="block dark:hidden" src="https://mintcdn.com/nuonic-39/IvvWU3allt6PGoB1/images/integration-page-2.png?fit=max&auto=format&n=IvvWU3allt6PGoB1&q=85&s=70f78d0a9f92a599cef96c8f059e2ff0" width="638" height="746" data-path="images/integration-page-2.png" />

      <img className="hidden dark:block" src="https://mintcdn.com/nuonic-39/IvvWU3allt6PGoB1/images/integration-page-2-dark.png?fit=max&auto=format&n=IvvWU3allt6PGoB1&q=85&s=13f2e39927c0d8a3242d3c0a78e8db3c" width="638" height="746" data-path="images/integration-page-2-dark.png" />
    </Frame>
  </Step>

  <Step title="You're connected!">
    Once you submit the form, PathStack will connect to the telematics provider you have selected and start pulling data
    in to PathStack. You can find the new connection by calling the `/connection` endpoint.

    <CodeGroup>
      ```python Python theme={null}
      import requests

      url = "https://api.pathstack.io/connection"

      querystring = {"telematics_provider":"verizon_connect"}

      headers = {"Authorization": "Bearer <access-token>"}

      response = requests.request("GET", url, headers=headers, params=querystring)

      print(response.json())
      ```

      ```javascript JavaScript theme={null}
      const options = {method: 'GET', headers: {Authorization: 'Bearer <access-token>'}};

      fetch('https://api.pathstack.io/connection?telematics_provider=verizon_connect', options)
        .then(response => response.json())
        .then(response => console.log(response))
        .catch(err => console.error(err));
      ```

      ```java Java theme={null}
      import java.net.HttpURLConnection;
      import java.net.URL;
      import java.util.Scanner;
      import org.json.JSONObject;

      public class ConnectionRequest {
          public static void main(String[] args) {
              String url = "https://api.pathstack.io/connection";
              String telematicsProvider = "verizon_connect";

              String fullUrl = url + "?telematics_provider=" + telematicsProvider;

              HttpURLConnection connection = (HttpURLConnection) new URL(fullUrl).openConnection();
              connection.setRequestMethod("GET");
              connection.setRequestProperty("Authorization", "Bearer <access-token>");

              try (Scanner scanner = new Scanner(connection.getInputStream())) {
                  String responseBody = scanner.useDelimiter("\\A").next();
                  JSONObject jsonResponse = new JSONObject(responseBody);

                  // Access and use the parsed JSON data as needed
                  // Example: String value = jsonResponse.getString("key");

                  System.out.println(jsonResponse);
              }

              connection.disconnect();
          }
      }
      ```

      ```dotnet .NET theme={null}
      using System;
      using System.IO;
      using System.Net;
      using Newtonsoft.Json.Linq;

      class ConnectionRequest
      {
          static void Main()
          {
              string url = "https://api.pathstack.io/connection";
              string telematicsProvider = "verizon_connect";

              string fullUrl = $"{url}?telematics_provider={telematicsProvider}";

              HttpWebRequest request = (HttpWebRequest)WebRequest.Create(fullUrl);
              request.Method = "GET";
              request.Headers.Add("Authorization", "Bearer <access-token>");

              using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
              using (Stream responseStream = response.GetResponseStream())
              using (StreamReader reader = new StreamReader(responseStream))
              {
                  string responseBody = reader.ReadToEnd();
                  JObject jsonResponse = JObject.Parse(responseBody);

                  // Access and use the parsed JSON data as needed
                  // Example: string value = jsonResponse["key"].ToString();

                  Console.WriteLine(jsonResponse);
              }
          }
      }
      ```

      ```bash cURL theme={null}
      curl --request GET \
        --url 'https://api.pathstack.io/connection?telematics_provider=verizon_connect' \
        --header 'Authorization: Bearer <access-token>'
      ```
    </CodeGroup>

    This will return a response that looks something like this:

    ```json JSON theme={null}
    {
      "data": [
        {
          "integration_name": "verizon_connect",
          "business_name": "Bob's Trucking",
          "abn": "123456789",
          "email": "owner@bobstrucking.com.au",
          "active": true,
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "tenant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
        },
        ...
      ]
    },
    ```

    Now that you have a connection, you can start [requesting data](/content/request-data)!

    <Note>It can take up to 30 minutes for data to flow from the telematics provider to PathStack</Note>
  </Step>
</Steps>
