younifyd
Menu

Retrieve sort options

Retrieve sort options

GET/v1/sort_options

Use it in a workflow

  1. Add a step and choose the Constructor connector.
  2. Pick the Retrieve sort options action (under Sort Options).
  3. Fill in the fields below, then reference the result from later steps as {{retrieveSortOptions.response.data}}.

Request

Query parameters

sectionstring

The section of the index to use. Defaults to `Products`.

num_results_per_pageinteger

The number of results per page to return.

Default 200

pageinteger

The page of results to return.

offsetinteger

The number of results to skip from the beginning. Cannot be used together with `page`.

sort_bystring

`sort_by` field of the sort options that you'd like to retrieve

cstring

The ID of the client and version that the request is coming from, such as `cio-js-2.90`.

Response

Returns 200 with an object. Read it in later steps with {{retrieveSortOptions.response.data.<field>}}.

total_countinteger
sort_optionsarray<object>
display_namestringrequired

The name of the sort option as it is displayed to end users.

path_in_metadatastringrequired

The path in the item's metadata to the field that results will be sorted according to.

positioninteger

The position of the sort option, used to provide sort options in a specific order.

hiddenboolean

Indicates if a sort option is hidden. This can be marked at `sort_by` level. A hidden sort option will be ignored in response by default.

Default false

sort_bystringrequired

The name of the sort option.

sort_orderanyrequired

The order the results will be sorted in

json
{
  "total_count": 0,
  "sort_options": [
    {
      "display_name": "string",
      "path_in_metadata": "string",
      "sort_by": "string",
      "sort_order": null,
      "position": 0,
      "hidden": false
    }
  ]
}

Need more? See the Constructor guide for connection setup and behaviour shared by every action.