We’ve been trying to update some device parameters (name, applicationID, description, tags, variables) in bulk using the PUT devices request on the API. For context this will be very helpful for us as we need to update the tags and variables of almost 1000 devices.
What we have found is that if some of the device parameters were configured already but are missing on the PUT request JSON, these are deleted. For example:
Device created:
{
“device”: {
"applicationID": “3”,
“description”: “this is a description”,
“devEUI”: “5566b2330cf30bd7”,
“deviceProfileID”: “0d9882e9-c593-4ad1-a7a9-7cf70a43785b”,
“isDisabled”: true,
“name”: “this_is_just_a_test”,
“referenceAltitude”: 1000,
“skipFCntCheck”: true,
“tags”: {“first”: “this is a first tag”, “second”: “this is a second tag”},
“variables”: {“first”: “this is a first var”, “second”: “this is a second var”}
}
}
JSON on the put request:
{
“device”: {
“devEUI”: “5566b2330cf30bd7”,
“deviceProfileID”: “0d9882e9-c593-4ad1-a7a9-7cf70a43785b”,
"applicationID": "4"
}
}
After using the PUT request, this is what can be seen on ChirpStack:
The name and description have been removed, as well as the tags and variables.
Is this expected behavior? Of course this can fixed using first a GET devices request to get the full device JSON, work on top of it and then use the PUT request to update that device, but this can be time consuming.
Thanks in advance for any help