Get Command

📘

Use the hub_url received in the registration response as your base URL.

📘

This API requires the device to authenticate, see Device Authentication.

Get a command to be executed from the server.

If the response received from the Send Telemetry API has the command field set to true, the device must call this API to get details on the command to be executed from the server.

Multiple commands might be queued. The device requests one command at a time, calling this API again as needed after each command is completed. Upon completion of each command, it notifies the server by calling the Update Command API.

Return Data

NameTypeDescriptionModel API Version
idintegerID of command to be executed1.0.1+
device_idstringDevice ID1.0.7+
statusstringCurrent command status:
_ pending
_ in_progress
1.0.1+
namestringCommand name1.0.1+
parametersobjectParameters for the command1.0.1+
namestring / number / boolean / objectCustom parameters for each command1.0.1+

Return Sample

{
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
    "device_id": "fbe103c8-...",
    "status": "pending",
    "name": "update_firmware",
    "parameters": {
        "url": "https://s3.amazonaws.com/xxxx.zip",
        "version": "1.3.4"
    }
}

NOTE: The command id should be saved locally; it is needed to update the server when the device has successfully executed the command.

Optional Commands to Support
The following standard commands can be enabled automatically when a model is created on the Xyte platform. In this case, all devices of that model type will need to implement these commands:

NameDescription
rebootReboot device
dumpCreate dump report
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!