younifyd
Menu

Create or replace sort options

Create or replace sort options

PUT/v1/sort_options

Use it in a workflow

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

Request

Query parameters

sectionstring

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

cstring

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

Request body

Enter the body as JSON in the step's Body field.

sort_optionsarray<object>required

Array of sort options you want to create or replace.

display_namestring

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
{
  "sort_options": [
    {
      "path_in_metadata": "string",
      "sort_by": "string",
      "sort_order": null,
      "display_name": "string",
      "position": 0,
      "hidden": false
    }
  ]
}

Response

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

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
{
  "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.