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

# Quickstart

> Obtain a JWT and call your first External API route in minutes.

## Prerequisites — Create an API Key

Before making any API calls, you'll need an API key. Head to the **Telemax Webhooks and API Key** section in the Telemax dashboard to create your own key.

<Note>
  Navigate to **Telemax Dashboard → Webhooks and API Key** to generate a new API key. Copy the key and keep it secure — you'll use it in the step below.
</Note>

## Step 1 — Get an access token

Interactive reference: [API key token](/v1/api-reference/post-authentication-token-api-key) · [Dashboard user token](/v1/api-reference/post-authentication-token-user).

<CodeGroup>
  ```bash cURL theme={null}
  curl -s -X POST "https://api.telemax.com.au/api/Authentication/token/api-key" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    --data-urlencode "apiKey=a3f1c2b4-5d6e-7890-abcd-ef1234567890"
  ```

  ```javascript JavaScript theme={null}
  const r = await fetch(
    "https://api.telemax.com.au/api/Authentication/token/api-key",
    {
      method: "POST",
      headers: { "Content-Type": "application/x-www-form-urlencoded" },
      body: new URLSearchParams({
        apiKey: "a3f1c2b4-5d6e-7890-abcd-ef1234567890",
      }),
    },
  );
  console.log(await r.json());
  ```

  ```python Python theme={null}
  import requests
  r = requests.post(
      'https://api.telemax.com.au/api/Authentication/token/api-key',
      data={'apiKey': 'a3f1c2b4-5d6e-7890-abcd-ef1234567890'},
  )
  print(r.json())
  ```
</CodeGroup>

**200 OK** response shape:

```json theme={null}
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer",
  "expires_in": 86399.0
}
```

## Step 2 — Call an authenticated endpoint

Almost all routes use **POST** with parameters in the **query string** (not JSON body) — see the [architecture note](/v1/introduction#post-first-design) for details. The only `GET` endpoints are `GetDeviceId` and `devices/{deviceId}/dtc-codes`. Example: [GetLastPositionData](/v1/api-reference/post-get-last-position-data) for legacy vehicle `88421`:

```bash theme={null}
curl -s -X POST "https://api.telemax.com.au/api/GetLastPositionData?id=88421" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
```

**200 OK** returns a `PositionDto` JSON object (see [Request & response](/v1/request-response)) with fields such as `Lat`, `Lng`, `UtcTime`, `DeviceId` (legacy id), `IMEI`, etc.

## Common first errors

| Symptom                   | Cause                                     | Fix                                                                                                      |
| ------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `401` with no body        | Missing or invalid `Authorization` header | Obtain a fresh token; prefix with `Bearer `                                                              |
| `401` from token endpoint | Wrong password or unknown API key         | Verify credentials; GUID keys must exist in `ApiKeys` non-deleted                                        |
| `400` from token endpoint | API key invalid for legacy path           | Legacy keys must resolve via the configured legacy API service                                           |
| `404` on data route       | Vehicle legacy id unknown                 | Confirm vehicle exists; use [GetDeviceId](/v1/api-reference/get-device-id-by-imei) if you only have IMEI |
| Empty `access_token`      | Parsing error                             | Ensure `Content-Type` is form-urlencoded, not JSON                                                       |
