API keys and webhooks
Connect extraGPS to your own software: read positions with an API key, receive events by webhook.
For companies that want positions and events in their own software (ERP, dispatch, a spreadsheet robot). The full reference, with code examples, is at extragps.com/public/v1/docs.
API keys
- Open the organisation settings and go to API keys. Only owners and admins can.
- Create a key and give it a name (for example "ERP").
- Choose only the scopes you need:
trackers:read: the trackers;positions:read: last positions, history and trips;events:read: alert events;geofences:read: geofences;drivers:read: drivers (name, licence status, current vehicle);maintenance:read: service and document deadlines;shipments:read: Transports shipments and their events;commands:write: send commands to Teltonika trackers.
- Optionally set an expiry date (up to 2 years).
- Copy the key now. It looks like
bld_live_…and is shown only once. - Call
https://extragps.com/public/v1/with the headerAuthorization: Bearer <key>.
Good to know:
- Treat the key like a password. If it leaks, revoke it and make a new one.
- Create keys, webhooks and connected apps as the owner or as an admin with a lasting role. If the person who made one leaves or is restricted or demoted, it is revoked (or switched off) automatically, because they may know the secret, and the integration stops until an owner or an admin who sees every vehicle claims it: Integrations shows it under "Integrations without an owner" with Claim (a new secret is made and shown once) or Revoke. A connected app cannot be claimed: connect it again with your own account. Revoke them then.
- Up to 20 active keys per organisation. Each key allows 120 requests per minute. An answer with HTTP 429 means: wait the number of seconds in
Retry-After.
Webhooks
A webhook sends events to your address within about a minute.
- In the same settings, add a webhook URL. Only HTTPS; addresses on private networks are refused.
- Pick what to receive:
- alert events: all of them with
event.*, or single ones such asevent.sos,event.geofence_enter,event.overspeed,event.ignition_on; tracker.status: online, offline, no GPS fix;position: new positions, batched: one call per minute with all trackers that moved.- Transports events (with the add-on):
tms.*for all, or single ones such asshipment.started,stop.arrived,eta.changed,shipment.delivered. They carry the event and a summary of the shipment, never your customers' contacts.
- alert events: all of them with
- Copy the secret (
whsec_…). It is shown only once. - Use Test to send a sample call.
Check each call
Each call carries the headers ExtraGPS-Webhook-Signature (v1=<hex>), ExtraGPS-Webhook-Timestamp (Unix seconds) and ExtraGPS-Webhook-Id.
- The signature is HMAC-SHA256 with your secret over
<timestamp>.<raw body>. - Reject calls whose timestamp is more than 5 minutes off.
- Use
ExtraGPS-Webhook-Idto ignore duplicates.
Answer with HTTP 2xx within 10 seconds. Failed calls are retried: events for about 2 days (8 tries), positions for about 1 hour (after that, read them from the history API).
Managing webhooks
- The delivery log shows the calls of the last 14 days.
- Rotate secret makes a new secret; the old one keeps working for 24 hours.
- A webhook that fails for 3 days, or answers 410, is switched off. Switch it on again in the settings.
- Up to 10 webhooks per organisation.
Need help with an integration? Contact us.