How to set DocumentType for inventory Document  Topic is solved

Discussions relating to the REST API of Jiwa 7.

How to set DocumentType for inventory Document

Postby mls » Tue Aug 23, 2022 12:54 pm

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.
mls
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Jul 05, 2022 5:50 am
Topics Solved: 1

Re: How to set DocumentType for inventory Document

Postby SBarnes » Tue Aug 23, 2022 4:56 pm

Can you provide the body of the post
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

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

Postby Mike.Sheen » Tue Aug 23, 2022 4:59 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: How to set DocumentType for inventory Document

Postby mls » Tue Aug 23, 2022 5:36 pm

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
mls
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Jul 05, 2022 5:50 am
Topics Solved: 1


Return to REST API

Who is online

Users browsing this forum: No registered users and 3 guests

cron