Results of consuming REST API only returns 20 records for arrays

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
AndySK
Posts: 6
Joined: Fri Jun 04, 2021 12:27 am

Results of consuming REST API only returns 20 records for arrays

Post by AndySK »

Greetings.

Please can someone point me in the right direction for a problem I have with collecting data from a webservice.

I'm consuming a REST API which returns data in multiple hierarchies, the layout for which I have emulated with my BOs and how they interlink. As part of this hierarchy, I have one business object called "WORKLOG" which has a one to many relationship with another BO called WORKLOGS. This BO contains the worklog entries relating to the parent BO record WORKLOG. This is all great, however the WORKLOGS table never gets any more than 20 records, even though the parent record 'startAt' is 0 and the 'total' is 35 for example, I only ever get 20 records back. I did note that there is also a field called 'maxResults' which is set to 20, but I have no say onve the value of this field as it is build on the fly. Bear in mind that all of this data is collected with one call the the webservice.

Something somewhere is defining a maximum of 20 records to be returned. Any ideas anyone please?

Thanks for your help in advance.

Kind regards
Andy
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Results of consuming REST API only returns 20 records for arrays

Post by Jaymer »

well, to debug
you can see exactly what is being sent and received in the server log.
double-click on the line and a popup should appear where you can copy the full line and inspect it in an editor.
I don't think anything on Aware's side is related to the 20 recs.

I don't know about authentication for this app and if its a get/put, etc., but
Using postman, curl, browser... whatever will work, if you can send that same string to their endpoint, you'll prolly see the same 20 recs returned.
If you see more, then yes, maybe an issue with aware, but if the same 20 were in the editor, then the host is maybe sending paged results.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
AndySK
Posts: 6
Joined: Fri Jun 04, 2021 12:27 am

Re: Results of consuming REST API only returns 20 records for arrays

Post by AndySK »

Thanks Jaymer. I'm a newbie at anything to do with REST APIs but will use POSTMAN to see if I can get some clues as you suggest. Thanks again!
Post Reply