Replies: 1 comment
-
|
I'm still working on this issue. An attempt to do it using PartLots doesn't work either. A curl -X 'PATCH' 'https://partdb.myhost.de/api/part_lots/7'
So how do you reduce or increase the inventory of a component using the API? A great project, and many possibilities with the API, but such simple things aren't possible? Best regards, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a simple frontend for Part-DB.
Unfortunately, I'm struggling to reduce parts from a lot.
The API documentation contains the endpoint /api/parts/{id}, which represents access to a part.
To decrease the part with ID 137, I use, for example, a
PATCH to /api/parts/137 with the JSON body
{ "partLots": [ { "@id": "/api/part_lots/122", "@type": "PartLot", "amount": 4, "id": 122 } ] }Unfortunately, that doesn't work. The result is
{ "@id": "/api/errors/400", "@type": "hydra:Error", "title": "An error occurred", "detail": "Nested documents for attribute \"partLots\" are not allowed. Use IRIs instead.", "status": 400, "type": "/errors/400", "description": "Nested documents for attribute \"partLots\" are not allowed. Use IRIs instead.", "hydra:description": "Nested documents for attribute \"partLots\" are not allowed. Use IRIs instead.", "hydra:title": "An error occurred" }So, how do I decrease or increase a part in a lot using the API?
Best regards,
Michael
Beta Was this translation helpful? Give feedback.
All reactions