Page 1 of 1

How to set DocumentType for inventory Document

PostPosted: Tue Aug 23, 2022 12:54 pm
by mls
I'm appending documents to inventory items via this API endpoint:

Code: Select all
POST /Inventory/{InventoryID}/Documents


and can't figure out how to set the DocumentType via the query parameters.

I have tried two different values for DocumentType, but neither of them work:

1. a complete DocumentType object as returned from the API: GET /Inventory/DocumentTypes/{DocumentTypeID}. This saves the document in Jiwa but sets its type to "Default Type"

2. an existing DocumentTypeID. This results in an error: 400 Bad Request

Would appreciate any ideas on how to solve this problem.

Re: How to set DocumentType for inventory Document

PostPosted: Tue Aug 23, 2022 4:56 pm
by SBarnes
Can you provide the body of the post

Re: How to set DocumentType for inventory Document  Topic is solved

PostPosted: Tue Aug 23, 2022 4:59 pm
by Mike.Sheen
mls wrote:can't figure out how to set the DocumentType via the query parameters.


You don't. As Stuart has hinted at, you need to provide a DTO in the body, and in that you can set the DocumentType.

Re: How to set DocumentType for inventory Document

PostPosted: Tue Aug 23, 2022 5:36 pm
by mls
Thanks for the replies Stuart and Mike.

After further testing, I can see my problem is somehow related to the way the request data is being encoded in PHP...anyway, I've now got a working cURL command to work off, so all good

Cheers,
Michael