Sort Parameter

In this article

    The sort query parameter is used to sort items in a resource collection to be returned in a response.

    The parameter accepts the array data type. To sort a resource collection use the sort query parameter in the following format:

    GET https://<hostname>:<port>/api/<version>/Endpoint?sort=[{"property":"<property>","direction":"<direction>"}]

    where:

    • <property> is a resource property name.
    • <direction> is a direction specifier.

    The VAO REST API accepts the following direction specifiers:

    Direction Specifier

    Description

    ASC

    Defines the ascending order of the resource collection representation.

    DESC

    Defines the descending order of the resource collection representation.

    Examples

    • To sort plans by their state, send the following request:

    GET https://uwin2012r2.n.local:9898/api/v4/Plans?sort=[{"property":"state","direction":"ASC"}]

    • To sort recovery locations by their type and name, send the following request:

    GET https://uwin2012r2.n.local:9898/api/v4/RecoveryLocations?sort=[{"property":"type","direction":"ASC"},{"property":"name","direction":"ASC"}]