Cant update Asset over API - 422 Error Unprocessable Entity

  • 15 November 2018
  • 4 replies


so I've been trying to change some fields over your API, but it seems no matter what I send as a body I always get '422 Error: Unprocessable Entity'. Other API calls seems to work fine (at least these that I've tested). Any way to work this out? Or am I doing something wrong? I've been doing this according to 

Please help :(

I'm using Basic Auth (using admin token - blurred on screenshots) - is there a chance that this token is good for viewing assets but not for modifying them? Or I'd get some other response like 401: Unauthorised?)

Im attaching screenshots from created requests in Postman (GET that works and PUT that should update asset but doesn't). I'll provide cURL command if needed.


This topic has been closed for comments

4 replies

Also, I've seen you started rolling out API v2, but seems like v2 doesn't provide Update method yet :(

I also faced the same issue in Postman, clearing cookies will resolve the issue.

The below curl command works, please check if you miss anything 

curl -u user_name:password -H "Content-Type: application/json" -d '{"cmdb_config_item": {"asset_tag": "xyz", "name" : "mandatory"}}' -X PUT<asset display_id>.json

For some reason this actually solved the problem 😃 thanks! 

Now I see that when updating asset `name` field is mandatory in request body. Is there a reason for this? I wanted to update asset based on `display_id`, instead now I need to GET asset using `display_id` to fetch current `name` and then PUT to actually update this asset. Seems weird and feels like traffic waste :/ 

Any reason behind that?



Looks like an issue in how the asset is updated when using the API. We'll check this and get back to you. Btw, API V2 for all asset operations is being worked upon. More details here: