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

Name

Type

Description

Model API Version

id

integer

ID of command to be executed

1.0.1+

device_id

string

Device ID

1.0.7+

status

string

Current command status:

  • pending
  • in_progress

1.0.1+

name

string

Command name

1.0.1+

parameters

object

Parameters for the command

1.0.1+

name

string / number / boolean / object

Custom parameters for each command

1.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",
      	"checksum": "0x33221134344",
      	"signature": "5511Azz5t"
    }
}

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!