It's all about the answers!

Ask a question

DNG REST API pagination


M K (25227) | asked Sep 05, 10:31 a.m.

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?


Comments
Suad Kajtazovic commented Sep 05, 11:04 a.m.

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


One answer



permanent link
Davyd Norris (2.6k217) | answered Sep 05, 7:42 p.m.
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.

Comments
M K commented Sep 06, 3:15 a.m.

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?


Ralph Schoon commented Sep 06, 6:59 a.m. | edited Sep 06, 7:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 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.