Rename Device XML vs JSON

Started by DeltaMikeCharlie, March 23, 2018, 12:00:40 PM

Previous topic - Next topic

DeltaMikeCharlie

When I make the following XML request, it is successful:

<devices>
<device uid="aa:bb:cc:dd:ee:ff" label="NewName" type_id="33" />
</devices>


However, when I make what appears to be an equivalent JSON request, it returns a http status of 200, but the device is not modified:

{
"devices": [{
"uid": " aa:bb:cc:dd:ee:ff ",
"label": "NewName",
"type_id": "33"
}]
}


I have tried including the "types" object and/or the id property as per the sample documentation, but that makes no difference.

Even though the documentation says to use a POST, that always returns a "405 - Method not allowed" but a PUT returns a 200.  The XML version also needs a PUT, not a POST.

I was converting my app from XML to JSON, but I guess that I will keep this call using XML.