Skip to content

Decode a packet from one device

Request

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):

  1. customer_id or authorized_groups missing → 400. ble_packet missing → 400.
  2. The packet is decoded. Its first 4 hex characters select the packet family: 5258, 5224, 4442 or 0202. Any other prefix, or a packet that is too short for its family, → 400 Invalid BLE packet. …. Because decoding comes first, a bad packet returns 400 even when the MAC is unknown.
  3. The tape is looked up by mac_id. A MAC that is not a registered Trackonomy tape → 404 Invalid tape mac address.
  4. The tape must be labelled under the customer_id / authorized_groups you 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 the product_id application) and the call returns 200.
  5. 200 with the decoded values.

Two response shapes, chosen by packet length only:

  • exactly 26 hex characters: a connectable heartbeat. When characters 17–20 are FFAC or FFB2, the MAC inside the packet (characters 5–16) must equal mac_id, compared case-insensitively; otherwise 400. 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):

StatusmessageWhat to do
400Missing required headers: customer_id or authorized_groupsSend both headers (note the plural authorized_groups).
400Missing required BLE packetSend the packet in the ble_packet header.
400Invalid BLE packet. Unknown scantype <XXXX>The packet does not start with 5258, 5224, 4442 or 0202. Check what your scanner captured.
400Invalid 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.
404Invalid tape mac addressmac_id is not a Trackonomy tape. Check the MAC (12 hex characters, no separators).
404Tape not associated under the current customerThe 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.

Security
bearerAuth
Path
mac_idstringrequired

The tape's MAC address: 12 hex characters, no colons or other separators (e.g. D4F5A1B2C3E8). For a heartbeat packet whose characters 17–20 are FFAC or FFB2, it must equal the MAC inside the packet (case-insensitive).

Example:D4F5A1B2C3E8
Headers
customer_idstringrequired

Customer ID of the account the tape is labelled under. Required; missing or empty → 400. Matched exactly (case-sensitive).

Example:acme
authorized_groupsstringrequired

Authorized group of the account the tape is labelled under. Required; missing or empty → 400. Note the plural header name: the singular authorized_group is not read here. Matched exactly (case-sensitive).

Example:acme-logistics
ble_packetstringrequired

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.

Examples:
Full packet of 48 hex characters
525801172D0000012C0C0300000096000000012C00FFAC1E
Connectable heartbeat of 26 hex characters containing the MAC address
5258D4F5A1B2C3E8FFAC1E010C
scan_timestring

When your scanner captured the packet, in Unix epoch seconds (whole seconds). Optional. When it is missing or not numeric, ts, over_temp_ts and shock_ts are null.

Example:1791245700
product_idstring

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.

Example:7b1e4c2a-9f3d-4e8a-b6c1-2d5f8a9e0c31
correlation_idstring

Optional request ID. Trackonomy records it with the request so support can trace a call you report.

Example:5f0c2b8e-6a51-4f7e-9d0e-1c2b3a4d5e6f
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'

Responses

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.

Bodyapplication/json
Any of:

Returned for any packet that is not exactly 26 hex characters. Fields described as absent are omitted.

qr_codestringrequired

The tape's QR code.

Example:"TRK8F3A21C7"
ctsinteger or nullrequired

Time Trackonomy decoded the packet, in Unix epoch seconds (not a device time). null for 4442 and 0202 packets.

Example:1791245815
tsinteger or nullrequired

The scan_time you sent, as an integer. null when it was missing or not numeric.

Example:1791245700
batnumber or nullrequired

Tape battery voltage, in volts. null for 4442 and 0202 packets.

Example:3
tempnumber or string
Example:23
One of:

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.

number
over_tempnumber

Recorded over-temperature excursion, in °C. Present only when the packet reports one.

Example:45
over_temp_tsinteger or null

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.

Example:1791245100
shockstring

Maximum shock magnitude in raw device units, as a numeric string. Present only when the packet reports a shock.

Example:"12"
shock_tsinteger or null

Estimated time of the shock, in Unix epoch seconds, worked out from scan_time. Present with shock; null when scan_time was not sent.

Example:1791245400
bat_percentnumber or nullrequired

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.

Example:100
fw_verstring or number
Example:"1.1"
One of:

Firmware version Trackonomy has for the tape. Usually a string (e.g. "1.1"); a number (e.g. 1.2) once the tape has reported its firmware in a heartbeat. Absent when no version is known.

string
Response

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" }