Sort Parameter

The sort query parameter is used to sort items in a resource collection 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>:1280/api/v3/<endpoint>?sort=[{"property":"<property>","direction":"<direction>","collation":"<collation>"}]

where:

  • endpoint is a resource collection endpoint.
  • property is the searched property name.

Sort Parameter Note:

To sort a resource collection based on a property of a resource subschema, use the "<subschema>.<property>" format to specify the resource property name where <subschema> is the subschema name.

  • direction is a direction specifier. The following values are available:
  • ascending
  • descending
  • collation is the type of rules that determine how sorted values are compared to each other. The following types are available:
  • ordinal — compare strings symbol-by-symbol
  • ignorecase — compare strings symbol-by-symbol ignoring character case
  • lexicographic — compare words with words and numbers with numbers

The default value is ordinal.

Examples

To sort company cloud backup resources by used storage quota, send the following request:

GET https://vspc:1280/api/v3/organizations/companies/sites/backupResources/usage?sort=[{"property":"usedStorageQuota","direction":"descending","collation":"lexicographic"}]

To sort subscription plans by name type and currency, send the following request:

GET https://vspc:1280/api/v3/subscriptionPlans?sort=[{"property":"type","direction":"ascending"},{"property":"currency","direction":"ascending"}]