API throwing error: "Expected a list of items but got type \"dict\"." #8879
-
Trying to update device properties using /api/dcim/devices/, getting "API throwing error: "Expected a list of items but got type "dict"." My JSON data:
Any guidance into where my issue is here? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Is "/api/dcim/devices/" the complete URL that you are using? If so, that's the batch update API and works differently. I've never had a need for it so I can't talk much about how it's used. To update a specific device, you need to PUT/PATCH to "/api/dcim/devices//" where "" is the ID number of the device to be updated. |
Beta Was this translation helpful? Give feedback.
-
I am getting the same error when I try to update an interface on a device curl -X PATCH "https://netbox.my.com/api/dcim/interfaces/" -H "accept: application/json" -H "Content-Type: application/json" -H "X-CSRFToken: token blah" -d "{ "device": 21, "name": "Ethernet12", "type": ["1000base-t"], "description": "this is a switch "}" |
Beta Was this translation helpful? Give feedback.
Is "/api/dcim/devices/" the complete URL that you are using? If so, that's the batch update API and works differently. I've never had a need for it so I can't talk much about how it's used. To update a specific device, you need to PUT/PATCH to "/api/dcim/devices//" where "" is the ID number of the device to be updated.