Skip to content

Other languages

The API is plain JSON over HTTPS with a bearer token, so any HTTP client works. Every page of these docs shows the requests, and the API reference has examples in Python, JavaScript, Go, Java, PHP, Ruby and more for every operation.

import os, requests
api = requests.Session()
api.headers["Authorization"] = f"Bearer {os.environ['OHR_TOKEN']}"
for d in api.get("https://api.ohrtech.net/v1/devices", params={"online": "true"}).json():
print(d["deviceId"], d.get("serial"), d.get("fleetName"), d.get("batteryLevel"))
const res = await fetch("https://api.ohrtech.net/v1/devices?online=true", {
headers: { Authorization: `Bearer ${process.env.OHR_TOKEN}` },
});
for (const d of await res.json()) console.log(d.deviceId, d.serial, d.fleetName, d.batteryLevel);

Call the API from your server, never from a browser: a token in a web page is a token anyone can copy. To show remote control in a browser, embed it.

The OpenAPI document describes every operation and type. Any OpenAPI 3 generator turns it into a typed client, for example:

Terminal window
npx @openapitools/openapi-generator-cli generate \
-i https://raw.githubusercontent.com/OhrTech/management-api/main/openapi.json \
-g python -o ohrtech-management

Official SDKs for more languages will be listed here as they are published.