- Docs
- Techvia TMS overview
- Use cases
- Sync loads to your spreadsheet or n8n
Sync loads to your spreadsheet or n8n
Outcome: a CSV (or an n8n workflow) with your loads, refreshed whenever you run it, that you can open in Excel or Google Sheets or feed to Power BI.
- Make a read-only key in Settings > API keys with
loads.read. Addbilling.readonly if the sheet needsfinalRate. Store it asTMS_KEY. - Read one page.
GET /api/public/v1/loadsreturns up to 50 loads, newest first, as{ "items": [...], "page", "pageSize", "total", "hasMore" }. Narrow it with filters such asstatus,pickupFromandpickupTo(YYYY-MM-DD), orsearch. - Loop until
hasMoreisfalse, raisingpageby one. Keep the loop under the limit of 60 requests a minute per key. - Write the rows. Show people
pickupLocalanddeliveryLocal(the wall clock at the facility), not the UTCpickupDate. Skip loads withisSample: trueif the sheet should hold only your own.
import csv, os, requests
BASE = "https://tms-api.techvia.software/api/public/v1/loads"headers = {"Authorization": f"Bearer {os.environ['TMS_KEY']}"}columns = ["loadNumber", "workOrderNumber", "status", "customerName", "origin", "destination", "pickupLocal", "deliveryLocal"]
with open("loads.csv", "w", newline="", encoding="utf-8") as f: out = csv.DictWriter(f, fieldnames=columns, extrasaction="ignore") out.writeheader() page = 1 while True: res = requests.get(BASE, headers=headers, params={"page": page, "pageSize": 50, "pickupFrom": "2026-12-01"}) res.raise_for_status() body = res.json() out.writerows(l for l in body["items"] if not l["isSample"]) if not body["hasMore"]: break page += 1import { writeFileSync } from 'node:fs';
const base = 'https://tms-api.techvia.software/api/public/v1/loads';const headers = { Authorization: `Bearer ${process.env.TMS_KEY}` };const columns = ['loadNumber', 'workOrderNumber', 'status', 'customerName', 'origin', 'destination', 'pickupLocal', 'deliveryLocal'];const cell = (v) => `"${String(v ?? '').replaceAll('"', '""')}"`;
const rows = [columns.join(',')];for (let page = 1; ; page++) { const res = await fetch(`${base}?page=${page}&pageSize=50&pickupFrom=2026-12-01`, { headers }); if (!res.ok) throw new Error(await res.text()); const body = await res.json(); for (const l of body.items.filter((l) => !l.isSample)) rows.push(columns.map((c) => cell(l[c])).join(',')); if (!body.hasMore) break;}writeFileSync('loads.csv', rows.join('\n'));curl -H "Authorization: Bearer $TMS_KEY" \ "https://tms-api.techvia.software/api/public/v1/loads?page=1&pageSize=50&pickupFrom=2026-12-01"In n8n
Section titled “In n8n”- Add an HTTP Request node: method
GET, URLhttps://tms-api.techvia.software/api/public/v1/loads. - Authentication: Generic Credential Type > Header Auth, name
Authorization, valueBearer tms_YOUR_KEY. - Under Options > Pagination, step the
pagequery parameter by one and stop whenhasMoreisfalse. Put a Schedule Trigger in front and a Google Sheets or Spreadsheet File node after it.
Next steps
Section titled “Next steps”- All filters and fields: Loads guide and List loads.
- If a call returns
429, wait the seconds in theRetry-Afterheader: rate limits and quota. - Create loads from a sheet instead? Use Create a load with an
Idempotency-Keyper row.