Authentication
Projects
LineItems
Pricing & Feasibility
Models
Events
Models
Invoicing
Reconciliation
Attributes
Categories
Countries & Languages
Supplier Sources
Models
Powered by Stoplight

Sorting

All GET endpoints which return an object list supports sorting. Sorting can be done by specifying sort in the query parameters along with the fields you want to sort. For the example in the right, sorting can be done for all first level fields: id, isoCode, countryName. Please note that sorting is not possible for fields deeper in the object JSON. In the example, fields of the object supportedLanguages does not support sorting

Sorting can be done for multiple fields in the same request, by separating the fields with a comma. Order is dependent on the order of how the fields were specified. In the example sorting would be first by countryName and then by isoCode.

Sorting Formats

Format Description
asc Sorts the object list in ascending order of the specified field
desc Sorts the object list in descending order of the specified field
Example Request
curl "https://api.researchnow.com/sample/v1/countries?sort=countryName:desc,isoCode:asc"
  -H "Authorization: Bearer <Access-Token>"
Example Response
{
  "data": [
    {
      "id": "US",
      "isoCode": "US",
      "countryName": "United States of America",
      "supportedLanguages": [
        {
          "id": "en_US",
          "isoCode": "en_US",
          "languageName": "English (US)"
        },
        {
          "id": "es_US",
          "isoCode": "es_US",
          "languageName": "Spanish (US)"
        }
      ]
    },
    {
      "id": "GB",
      "isoCode": "GB",
      "countryName": "United Kingdom",
      "supportedLanguages": [
        {
          "id": "en_GB",
          "isoCode": "en_GB",
          "languageName": "English (UK)"
        }
      ]
    }
  ]
}