Filtering and Pagination

Overview

Moody's RMS APIs support query string parameters that provide you with better control over the data returned from a resource. Query string parameters are especially useful in top-level resources that return lists of exposure objects such as lists of accounts, profiles, or treaties.

A query string parameter is a type of REST API parameter that is appended to a resource endpoint. Where the endpoint defines the path to a resource, the query string parameter controls the scope or order of the data returned from that resource.

Use query string parameters to select an exposure data module to query; and to filter, sort, and paginate the data returned from that data source. The query string parameter is appended to the service endpoint using the ? character.

Synopsis

RMS Platform APIs support five basic query string parameters: datasource, filter, sort, limit, and offset.

GET /host/path

?

[ filter= attribute [ = | != | > | < | LIKE | NOT LIKE ] attribute-value ]

[ filter= attribute [ IN | NOT IN ] attribute-value-list ]

[ filter= expression [ AND | OR ] expression ]

[ sort= attribute= ASC | DESC ]

[ limit= number]

[ offset= number]

Every query string parameter is defined by a parameter keyword, a query string, and a comparison operator (=) that connects the parameter keyword to the query string. You can use the & operator to append multiple query string parameters to the endpoint.

Query String Parameters

RMS Platform APIs support five basic query string parameters: exposureId, filter, sort, limit, and offset.

ParameterDescription
exposureIdDefines a filter that specifies the EDM to query.
filterDefines an attribute value filter that selects the data returned from a resource. The filter keyword supports four filtering operations: comparison operations, logical operations, list operations and matching operations.
sortA sort query string parameter specifies an attribute on which to sort and the sort order (alphabetical or numerical) for the records returned from the service. One of ASC for ascending or DESC for descending.
limitA limit query string parameter specifies the number of records returned by the query. By default, 100.
offsetAn offset query string parameter specifies the number of records "offset" before the the first ecord returned. By default, 0.

Some Analysis resources enable you to filter and identify relevant analysis results using the exposureId, jobId, jobUUID, perspective, and treatyId query strings.