Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

DNG REST API pagination

Can someone explain how to request the next page when making a DNG REST API call for a project view that returns more than 100 results?

0 votes

Comments

Please explain in more details. which API, how does your API call look like, etc. 



One answer

Permanent link
Pagination is different for the Reportable REST API and the OSLC API. Both are documented in their respective API documents, for instance in:

you will see the discussion about paging, for instance, when retrieving artefacts:

"Results will be paginated with a page size of 100. The next page will be located in the href element which specifies the URI for next page. If the href element is not included in the response that means there are no more pages. To execute next page URI, client should replace & with & in next page URI to decode the xml encoding."

History is a bit different:

"Results will be paginated with a page size of 25. The next page will be located in the <history:nextPage> element which specifies the URI for next page. If <history:nextPage> is not included in the response that means there are no more pages."

The OSLC API is different again and you need to use the oslc.pageSize parameter to set the page size. Note that the server can choose to ignore this and return it's own number of results, for example:
https://<server>/rm/views&oslc.pageSize=100

If there are more records to retrieve then the response (specifically in the <oslc:ResponseInfo> section), you'll find an element called <oslc:nextPage> which contains an rdf:resource attribute that is the call to the next page of the data set. This URL has all ampersands encoded so you need to replace all &amp; with an actual & before you make the call.

0 votes

Comments

i don't see any history tags in the XML response, but in the ds:dataSource section i do see these:


appId="RRC"
rel="next"

so how do i form the URL to get the next page?

See a detailed example for the EWM Reportable REST API and the gotchas: https://rsjazz.wordpress.com/2022/03/02/ewm-reportable-rest-api/
Should be similar for the other reportable REST APIs.

The HREF is an URL Encoded URL for the next page.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936
× 478
× 116

Question asked: Sep 05, 10:31 a.m.

Question was seen: 438 times

Last updated: Sep 06, 7:01 a.m.

Confirmation Cancel Confirm