Skip to main content

Downlink — clear send queue

Withdraws all frames of a device that are waiting in the queue to be sent. Withdrawn frames are not deleted: they stay in the history with status 6 (Canceled).

Request and response: downlink_purge_req → downlink_purge_resp.
Access: high access level token only. With a low access level token the server responds with error 1.

Tip

cancel_downlink_req is better suited for withdrawing frames. It works with a token of any level, also withdraws frames with realTime, intercepts a frame the server is already preparing for transmission, and reports why a frame could not be withdrawn.

Request​

Fields not marked as required may be omitted.

FieldTypeDescription
cmdstringdownlink_purge_req
operation_idstringAny string; the server returns it in the response to match the request and the response
devEuistringdevEui or devAddr is required. Device DevEUI, 16 hex characters
devAddrstringdevEui or devAddr is required. Device DevAddr, 8 hex characters
{
"cmd": "downlink_purge_req",
"operation_id": "xyz",
"devEui": "6F1E570FFE14DBFC"
}

Response​

FieldTypeDescription
cmdstringdownlink_purge_resp
operation_idstringValue from the request
statusuint81 — success, 2 — error
devEui, devAddrstringThe device whose queue was cleared
dataInQueuePurgeuint32Number of withdrawn frames
error_code, error_textuint8, stringOnly on error, see below
{
"cmd": "downlink_purge_resp",
"operation_id": "xyz",
"status": 1,
"devEui": "6F1E570FFE14DBFC",
"devAddr": "78130AE1",
"dataInQueuePurge": 2
}

Errors​

error_codeerror_textWhat happened
1Unauthorized accessThe request came with a low access level token
3Data is filled in with an errordevEui or devAddr has an invalid format
7Downlink queue emptyThere are no waiting frames in the queue
8Device does not existsThe device is not found
0—Internal server error — retry later

Good to know​

  • Only frames with status 0 (Scheduled) from the last month are withdrawn. Frames with realTime (status 4, Realtime Scheduled) stay in the queue.
  • Clearing the queue may not stop a frame that the server has already picked up for transmission after the device's uplink. To stop such a frame too, use cancel_downlink_req.

See also​