Sending commands through REST API

Asset Tracker Template

tags
Asset Tracker Template

Send device commands using the nRF Cloud REST API:

curl -X PATCH "https://api.nrfcloud.com/v1/devices/$DEVICE_ID/state" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"desired": {"command": [1, 1]}}'

Command format: "command": [type, id]

  • type: Command type (1=Provision)
    • Valid range: 1 to 1
  • ID: Unique identifier (increment for successive commands)
    • Valid range: 1 to 4294967294 (excludes 0 and UINT32_MAX)

For shadow structure details, see Asset-Tracker-Template/app/src/cbor/device_shadow.cddl.