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

# Geotab (MyGeotab API) REST API

> Client-mode REST API connector for Geotab MyGeotab JSON-RPC (GetFeed, Device, TextMessage)

Technical Preview

## Overview

Client-mode REST API connector for Geotab MyGeotab JSON-RPC (GetFeed, Device, TextMessage). `BASE_ADDRESS` defaults to `https://my.geotab.com`. Auth: **Session via Authenticate (JSON-RPC); then credentials.sessionId**. Pass secrets only at runtime via MQTT JSON placeholders or Hub `GET SECRET` — never commit real credentials.

## Auth

Session via Authenticate (JSON-RPC); then credentials.sessionId. Prefer Hub secrets / `GET SECRET`. Never hard-code tokens into the `.lot`.

## Basic Syntax

```lot wrap theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}

DEFINE ROUTE GeotabRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://my.geotab.com"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
        # Optional: WITH USERNAME "YOUR_USER" / WITH PASSWORD GET SECRET "APP_PASSWORD"
    ADD EVENT Authenticate
        WITH SOURCE_TOPIC "integrations/geotab/request/Authenticate"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Authenticate"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Get
        WITH SOURCE_TOPIC "integrations/geotab/request/Get"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Get"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Getfeed
        WITH SOURCE_TOPIC "integrations/geotab/request/Getfeed"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Getfeed"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Add
        WITH SOURCE_TOPIC "integrations/geotab/request/Add"
    # ... additional EVENTs in package .lot ...
```

## MQTT topics

Request topics under `integrations/geotab/request/...`; responses on `integrations/geotab/response/...`.

## Template reference

Generated from the shipped broker template `geotab` (`-routeCode GEOTAB`). It lists every event the template defines.

### Auth

Session via Authenticate (JSON-RPC); then credentials.sessionId

### Template parameters

| Placeholder | Type | Description | Required |
| - | - | - | - |
| `RouteName` | string | Name of the Geotab connector | no |
| `BaseUrl` | string | Geotab base URL without trailing slash (e.g. [https://my.geotab.com](https://my.geotab.com)) | yes |

`BASE_ADDRESS` default: `https://my.geotab.com`.

### Events

| Event | Method | Endpoint | Request topic | Response topic | Payload fields |
| - | - | - | - | - | - |
| `Authenticate` | POST | `/apiv1` | `integrations/geotab/request/Authenticate` | `integrations/geotab/response/Authenticate` | none |
| `Get` | POST | `/apiv1` | `integrations/geotab/request/Get` | `integrations/geotab/response/Get` | none |
| `Getfeed` | POST | `/apiv1` | `integrations/geotab/request/Getfeed` | `integrations/geotab/response/Getfeed` | none |
| `Add` | POST | `/apiv1` | `integrations/geotab/request/Add` | `integrations/geotab/response/Add` | none |
| `Set` | POST | `/apiv1` | `integrations/geotab/request/Set` | `integrations/geotab/response/Set` | none |
| `Remove` | POST | `/apiv1` | `integrations/geotab/request/Remove` | `integrations/geotab/response/Remove` | none |
| `Getcountof` | POST | `/apiv1` | `integrations/geotab/request/Getcountof` | `integrations/geotab/response/Getcountof` | none |
| `Executemulticall` | POST | `/apiv1` | `integrations/geotab/request/Executemulticall` | `integrations/geotab/response/Executemulticall` | none |

### Deploy

Get the template card (JSON with `template` and `metadata`) from the broker, then deploy the connector:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_pub -t '$SYS/Coreflux/Command' -m "-routeCode GEOTAB"
```

The deployable connector from the REST API app, with `BASE_ADDRESS` already filled in:

```lot theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
DEFINE ROUTE GeotabRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://my.geotab.com"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT Authenticate
        WITH SOURCE_TOPIC "integrations/geotab/request/Authenticate"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Authenticate"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Get
        WITH SOURCE_TOPIC "integrations/geotab/request/Get"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Get"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Getfeed
        WITH SOURCE_TOPIC "integrations/geotab/request/Getfeed"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Getfeed"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Add
        WITH SOURCE_TOPIC "integrations/geotab/request/Add"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Add"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Set
        WITH SOURCE_TOPIC "integrations/geotab/request/Set"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Set"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Remove
        WITH SOURCE_TOPIC "integrations/geotab/request/Remove"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Remove"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Getcountof
        WITH SOURCE_TOPIC "integrations/geotab/request/Getcountof"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Getcountof"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Executemulticall
        WITH SOURCE_TOPIC "integrations/geotab/request/Executemulticall"
        WITH DESTINATION_TOPIC "integrations/geotab/response/Executemulticall"
        WITH METHOD "POST"
        WITH ENDPOINT "/apiv1"
        WITH HEADERS
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
```

Deploy it with `-addRoute` (do not include `ADD METADATA`).

### Usage example

Call `Authenticate` by publishing a JSON payload to its request topic, and read the reply on the response topic:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_sub -t 'integrations/geotab/response/Authenticate' &
mosquitto_pub -t 'integrations/geotab/request/Authenticate' -m '{}'
```

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [REST API apps index](/latest/lot-language/routes/rest-api-apps)


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