It's all about the answers!

Ask a question

How to increase number of records returned by REST API call?


Timur Markunin (6495165145) | asked Apr 10 '13, 7:43 a.m.
 Hello,

I'm trying to get all users allocation XML using REST API. I've tried https://kvhoclm3.delta.internal:9443/ccm/rpt/repository/apt?fields=apt%2FworkResourceDetails%2F%28contributor%2FuserId|assignment|startDate|endDate%29 and it returns only 100 records.

I've tried https://kvhoclm3.delta.internal:9443/ccm/rpt/repository/apt?fields=apt%2FworkResourceDetails%2F%28contributor%2FuserId|assignment|startDate|endDate%29&size=1000

and again only 100 records.

Any ideas on how I could retrieve all records?

-thanks in advance

Comments
Sandy Grewal commented Apr 10 '13, 9:55 a.m.
JAZZ DEVELOPER

Hi,
At the end of the URL on first line do you see "&size=1000&pos=1000" ?


Timur Markunin commented Apr 10 '13, 10:09 a.m.

Hi Sandy! Yes, I see it. 

One answer



permanent link
Kot T. (1.5k11219) | answered Apr 10 '13, 8:39 a.m.
JAZZ DEVELOPER
The URL should return all the records, but only display 100 element per page. You can use the URL at the top of the page to navigate to the following pages.

<apt Version="1.0.0" rel="next" href="https://kvhoclm3.delta.internal:9443/ccm/rpt/repository/apt?fields=apt%2FworkResourceDetails%2F%28contributor%2FuserId%7Cassignment%7CstartDate%7CendDate%29&id=<id>&size=100&pos=100"/>

Comments
Timur Markunin commented Apr 10 '13, 10:13 a.m.

Hi Kot!

Could you please clarify how it works?
I guess 'size' means size of XML chunk?

What about 'pos'?

I'm asking because I've tried your proposal and empty XML was returned:

<apt Version="1.0.0"/>

I could see in RTC UI that particular person has more assignments than in returned XML.

-thanks in advance?


Kot T. commented Apr 10 '13, 4:45 p.m.
JAZZ DEVELOPER

Hi Timur,

You are right. Size is the # of elements returned per page. pos is the starting element to be loaded.
For example, assuming you have 50 elements returned from the above URL and you set the size to return 10 elements per page. pos will be 10 when you want to go to the second page, and 20 when you want to go to the 3rd page.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.