Decodes one BLE packet that your scanner captured from the tape identified by mac_id and returns the tape's QR code with the decoded readings (battery, temperature, excursions, firmware version).
Headers. Everything goes in the path and in headers; send no request body. customer_id and authorized_groups (plural) are required and identify the account the tape belongs to. ble_packet is required. scan_time, product_id and correlation_id are optional.
How the request is processed (each step runs only if the previous one passed):
customer_idorauthorized_groupsmissing →400.ble_packetmissing →400.- The packet is decoded. Its first 4 hex characters select the packet family:
5258,5224,4442or0202. Any other prefix, or a packet that is too short for its family, →400 Invalid BLE packet. …. Because decoding comes first, a bad packet returns400even when the MAC is unknown. - The tape is looked up by
mac_id. A MAC that is not a registered Trackonomy tape →404 Invalid tape mac address. - The tape must be labelled under the
customer_id/authorized_groupsyou sent, in any of that account's applications. If it is not →404 Tape not associated under the current customer, unless automatic registration of unlabelled tapes is enabled for your environment; then the tape is registered under that account (and theproduct_idapplication) and the call returns200. 200with the decoded values.
Two response shapes, chosen by packet length only:
- exactly 26 hex characters: a connectable heartbeat. When characters 17–20 are
FFACorFFB2, the MAC inside the packet (characters 5–16) must equalmac_id, compared case-insensitively; otherwise400. A heartbeat also updates the firmware version Trackonomy stores for the tape. - any other length: a full packet.
Error messages (these endpoints return a message, not an error_code):
| Status | message | What to do |
|---|---|---|
| 400 | Missing required headers: customer_id or authorized_groups | Send both headers (note the plural authorized_groups). |
| 400 | Missing required BLE packet | Send the packet in the ble_packet header. |
| 400 | Invalid BLE packet. Unknown scantype <XXXX> | The packet does not start with 5258, 5224, 4442 or 0202. Check what your scanner captured. |
| 400 | Invalid BLE packet. <reason> | The packet could not be decoded (truncated packet, or a heartbeat whose embedded MAC differs from mac_id). Do not retry the same packet. |
| 404 | Invalid tape mac address | mac_id is not a Trackonomy tape. Check the MAC (12 hex characters, no separators). |
| 404 | Tape not associated under the current customer | The tape is not labelled under this customer_id / authorized_groups. Label it first, or check the headers. |
A temporary server fault while looking the tape up is also reported as one of these two 404s. If a tape you know is labelled under this account returns 404, retry once with backoff before treating the result as permanent.
Retries. Retrying a call returns the same decoded values (apart from cts, the decode time). If your integration records decoded packets as tape readings, a retry records the packet again, so retry only on network errors, 5xx, or the unexpected 404 described above.
The raw BLE payload as a hex string (upper or lower case). The first 4 characters must be 5258, 5224, 4442 or 0202. Exactly 26 characters is a connectable heartbeat; full tape packets are normally 48 characters.
Optional application ID. Not used to find the tape (the tape is found under any application of the account). Used only when automatic registration of unlabelled tapes is enabled for your environment, as the application to register the tape under.
- Mock serverhttps://docs.trackonomy.com/_mock/external-api/trackonomy-external-api/external/v1/devices/{mac_id}/decode
- Productionhttps://api.trackonomy.com/external/v1/devices/{mac_id}/decode
- PPE (integration testing)https://ppe.api.trackonomy.com/external/v1/devices/{mac_id}/decode
curl --request POST \
--url 'https://ppe.api.trackonomy.com/external/v1/devices/D4F5A1B2C3E8/decode' \
--header 'Authorization: Bearer <access_token>' \
--header 'customer_id: acme' \
--header 'authorized_groups: acme-logistics' \
--header 'ble_packet: 525801172D0000012C0C0300000096000000012C00FFAC1E' \
--header 'scan_time: 1791245700' \
--header 'product_id: 7b1e4c2a-9f3d-4e8a-b6c1-2d5f8a9e0c31' \
--header 'correlation_id: 5f0c2b8e-6a51-4f7e-9d0e-1c2b3a4d5e6f'Packet decoded. A 26-hex-character packet returns the heartbeat shape; any other length returns the full-packet shape. Fields described as absent are omitted from the JSON.
Returned for any packet that is not exactly 26 hex characters. Fields described as absent are omitted.
Time Trackonomy decoded the packet, in Unix epoch seconds (not a device time). null for 4442 and 0202 packets.
The scan_time you sent, as an integer. null when it was missing or not numeric.
Current temperature in °C. A number for most packets; a string (e.g. "25.0") for FFF9 packets. Absent when the packet carries no temperature.
Recorded over-temperature excursion, in °C. Present only when the packet reports one.
Estimated time of the over-temperature excursion, in Unix epoch seconds, worked out from scan_time. Present with over_temp; null when scan_time was not sent.
Maximum shock magnitude in raw device units, as a numeric string. Present only when the packet reports a shock.
Estimated time of the shock, in Unix epoch seconds, worked out from scan_time. Present with shock; null when scan_time was not sent.
Battery state of charge (0–100), from the tape's battery type and the decoded voltage and temperature. null when it cannot be worked out.
The packet reports an over-temperature and a shock event, so every full-packet field is present.
{ "qr_code": "TRK8F3A21C7", "cts": 1791245815, "ts": 1791245700, "bat": 3, "temp": 23, "over_temp": 45, "over_temp_ts": 1791245100, "shock": "12", "shock_ts": 1791245400, "bat_percent": 100, "fw_ver": "1.1" }