NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Setting Result Set and Page Size for REST-like API

All caDSR APIs are generated using the caCORE SDK. For REST-like APIs, the SDK provides the ability to determine the number of total results returned from a query, along with the ability to determine how many results are shown on each page.

The caDSR REST-like API allows for the use of the resultCounter parameter. By default, the result set is limited to 1000 records, with 10 CDE records appearing per page. Since the caDSR API does not request a login, these paging settings are global and cannot be configured or retained per user. Instead, use the result set and pagination parameters described here to configure your API calls.

...

For a caDSR RESTlike API:

  • You can expand or limit the result set using the resultCounter parameter. By default, the result set for a RESTlike call is limited to 1,000 records, with the set number of records appearing per page, either as the default or as a specified page size.
  • To change the maximum number of results returned for a query, add the resultCounter=## parameter to the call.  For details and an example, see Setting Result Set and Page Size for REST-like API on the caDSR API REST-like Examples page of this wiki.
  • If your total results are less than the page size, the first page of results contain all the returned items.
  • The resultCounter and pageSize capabilities are available for use in RESTlike API calls.
  • For REST-like (XML-HTTPS) calls, page size information is cached, so that if you make a call that identifies a particular page size, subsequent calls will also use that same page size, even without the parameter.
  • To change the number of results appearing on each page, include a different pageSize parameter in a call, or clear the cache to return to the default.

For example:

http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=gov.nih.nci.cadsr.domain.Form&gov.nih.nci.cadsr.domain.Form[@workflowStatusName=RELEASED]&startIndex=0&pageSize=30&resultCounter=300

...