writing a query in plain text  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Re: writing a query in plain text

Postby JuiceyBrucey » Wed Mar 10, 2021 1:02 pm

Thank you for the info. Sorry did not realise that.
I have attached the XML file.
Please let me know if I have done this correctly.
Cheers
Attachments
Plugin REST API get inventory, limit fields, specify start and finish.xml
(24.65 KiB) Downloaded 49 times
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

Re: writing a query in plain text

Postby Mike.Sheen » Wed Mar 10, 2021 4:19 pm

I got a 404, too after importing the plugin and restarting my REST API Service.

Then I looked at the plugin and saw why - Your plugin is not enabled. Enable it, save and restart your service.
EnablePlugin.png
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: writing a query in plain text  Topic is solved

Postby Mike.Sheen » Wed Mar 10, 2021 4:42 pm

I've mentioned this before, but you might want to consider using AutoQuery.

Out of the box, we have a route which lets the consumer get the same data as your custom route - for example:

https://api.jiwa.com.au/Queries/IN_Main ... 10&Take=20

This is getting just the same fields as your custom route, in the same order, filtering on Status (I used Status of 0 because the 2 you want has no data in our demo database), and it paginates the result (note the Include=Total will return the total number of rows as metadata in the response so the client can make good decisions on paging).

Don't get put off by the HTML representation of the above - if your request doesn't have HTML as the accept content type like a web browser does, you'll just get json back (compressed if the request has gzip or deflate in the accept headers).

If you want to see it as json inside a browser just append &format=json at the end of the URL to override the content type requested - like this https://api.jiwa.com.au/Queries/IN_Main ... ormat=json
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: writing a query in plain text

Postby JuiceyBrucey » Wed Mar 10, 2021 5:22 pm

Thank you. Yes that works perfectly.
Sorry went to find info about autoquery days ago, but ended up on servicestack autoquery somehow and lost the plot I think.
Cheers
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

Previous

Return to REST API

Who is online

Users browsing this forum: No registered users and 1 guest