Editing an item via REST API without item id. Can we specify a WHERE attribute?
Hi community,
I want to edit a custom item in Innovator via REST API. Typically the command looks like this:
PATCH {base url}/Part(’16AA95A80DEB4B56BD8BA9BC509EAF0C’)
My 2nd software that shall do the REST call doesn´t know the target item id. I only have the serial number (item_number) of the target item in Innovator.
For regular AML queries we can use the WHERE attribute to perform these kinds of edit operations.
Is something similar available in the REST API?
An alternative solution would be to do a regular GET request first to get the ID. Or maybe a custom Method that does the edit with a standard AML query.
Any ideas? What would you recommend?
Thanks!
Angela
Thanks Bryan and Daan for your feedback! Are you really sure this approach works when performing an edit? Yes, of course, using a filter sounds absolutely reasonable - but here´s the reality….😄
I get the same error when using PUT. I don´t have a collection. It´s a blank database with exactly one CAD item.
GET works fine.My current workaround is a custom Method. In general I started to prefer custom Methods for REST call. They allow much more control and validation.
And it´s maybe a good thing that PATCH behaves this way. This way people only can destroy one item at a time. That´s a big plus! :)