IP Devices
UpdateDeviceState
Modify the device's state as stored in its shadow. You do not have to pass the entire shadow. You can update a specific portion by setting the correct JSON field path:
export DEVICE_VERSION=$(curl $API_HOST/v1/devices/$DEVICE_ID -H "Authorization: Bearer $API_KEY" | jq -r '.["$meta"].version')
curl -X PATCH $API_HOST/v1/devices/$DEVICE_ID/state -d '{ "reported": { "device": { "serviceInfo": { "fota_v1": ["BOOT"] } } } }' -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -H "If-Match: $DEVICE_VERSION"
patch/devices/{deviceId}/state
Request
- Base URLhttps://api.nrfcloud.com/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
deviceIdstring required
This is the canonical device id used in the device certificate, and as the MQTT client id.
Example:nrf-1234567890123456789000
Request body
Example request
{
"reported": {
"device": {
"serviceInfo": {
"fota_v1": [
"APP",
"MODEM"
]
}
}
},
"desired": {
"someField1": {
"someField2": "someValue2"
}
}
}Changes
No recorded changes to this operation across all 7 revisions of this API.