Author Topic: Rename Device XML vs JSON  (Read 579 times)

Offline DeltaMikeCharlie

  • Full Member
  • ***
  • Posts: 57
    • View Profile
Rename Device XML vs JSON
« on: March 23, 2018, 12:00:40 PM »
When I make the following XML request, it is successful:

Code: [Select]
<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:

Code: [Select]
{
"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.


Share via facebook Share via twitter