younifyd
Menu

Get Rulesets

List campaign rulesets

GET/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets

Use it in a workflow

  1. Add a step and choose the Talon.One connector.
  2. Pick the Get Rulesets action (under management).
  3. Fill in the fields below, then reference the result from later steps as {{getRulesets.response.data}}.

Request

Path parameters

applicationIdinteger (int64)required

The ID of the Application. It is displayed in your Talon.One deployment URL.

campaignIdinteger (int64)required

The ID of the campaign. It is displayed in your Talon.One deployment URL.

Query parameters

pageSizeinteger (int64)

The number of items in the response.

Default 1000

skipinteger (int64)

The number of items to skip when paging through large result sets.

sortstring

The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations.

Response

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

totalResultSizeinteger (int64)
dataarray<object>
idinteger (int64)required

The internal ID of this entity.

createdstring (date-time)required

The time this entity was created.

userIdinteger (int64)required

The ID of the user associated with this entity.

rulesarray<object>required7 fields

Set of rules to apply.

strikethroughRulesarray<object>7 fields

Set of rules to apply for strikethrough.

bindingsarray<object>required8 fields

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

rbVersionstring

The version of the rulebuilder used to create this ruleset.

activateboolean

Indicates whether this created ruleset should be activated for the campaign that owns it.

campaignIdinteger (int64)

The ID of the campaign that owns this entity.

templateIdinteger (int64)

The ID of the campaign template that owns this entity.

activatedAtstring (date-time)

Timestamp indicating when this Ruleset was activated.

json
{
  "totalResultSize": 1,
  "data": [
    {
      "rbVersion": "v2",
      "created": {},
      "campaignId": 320,
      "bindings": [],
      "activatedAt": {},
      "activate": true,
      "rules": [
        {
          "condition": [
            "and",
            [
              "couponValid"
            ]
          ],
          "effects": [
            "catch",
            [
              "noop"
            ],
            [
              "setDiscount",
              "10% off",
              [
                "*",
                [
                  ".",
                  "Session",
                  "Total"
                ],
                [
                  "/",
                  10,
                  100
                ]
              ]
            ]
          ],
          "bindings": [
            {
              "attributeId": 100,
              "minValue": 0,
              "expression": [
                "string1",
                "string2"
              ],
              "maxValue": 19.9,
              "valueType": "string",
              "name": "my property",
              "description": "This is a template parameter of type `number`.",
              "type": "templateParameter"
            },
            {
              "attributeId": 100,
              "minValue": 0,
              "expression": [
                "string1",
                "string2"
              ],
              "maxValue": 19.9,
              "valueType": "string",
              "name": "my property",
              "description": "This is a template parameter of type `number`.",
              "type": "templateParameter"
            }
          ],
          "description": "Creates a discount when a coupon is valid",
          "id": "7fa800a8-ac8d-4792-85dc-c4650dcc8f23",
          "title": "Give discount via coupon",
          "parentId": "7fa800a8-ac8d-4792-85dc-c4650dcc8f23"
        },
        {
          "condition": [
            "and",
            [
              "couponValid"
            ]
          ],
          "effects": [
            "catch",
            [
              "noop"
            ],
            [
              "setDiscount",
              "10% off",
              [
                "*",
                [
                  ".",
                  "Session",
                  "Total"
                ],
                [
                  "/",
                  10,
                  100
                ]
              ]
            ]
          ],
          "bindings": [
            {
              "attributeId": 100,
              "minValue": 0,
              "expression": [
                "string1",
                "string2"
              ],
              "maxValue": 19.9,
              "valueType": "string",
              "name": "my property",
              "description": "This is a template parameter of type `number`.",
              "type": "templateParameter"
            },
            {
              "attributeId": 100,
              "minValue": 0,
              "expression": [
                "string1",
                "string2"
              ],
              "maxValue": 19.9,
              "valueType": "string",
              "name": "my property",
              "description": "This is a template parameter of type `number`.",
              "type": "templateParameter"
            }
          ],
          "description": "Creates a discount when a coupon is valid",
          "id": "7fa800a8-ac8d-4792-85dc-c4650dcc8f23",
          "title": "Give discount via coupon",
          "parentId": "7fa800a8-ac8d-4792-85dc-c4650dcc8f23"
        }
      ],
      "id": 6,
      "strikethroughRules": [
        {
          "condition": [
            "and",
            [
              "couponValid"
            ]
          ],
          "effects": [
            "catch",
            [
              "noop"
            ],
            [
              "setDiscount",
              "10% off",
              [
                "*",
                [
                  ".",
                  "Session",
                  "Total"
                ],
                [
                  "/",
                  10,
                  100
                ]
              ]
            ]
          ],
          "bindings": [
            {
              "attributeId": 100,
              "minValue": 0,
              "expression": [
                "string1",
                "string2"
              ],
              "maxValue": 19.9,
              "valueType": "string",
              "name": "my property",
              "description": "This is a template parameter of type `number`.",
              "type": "templateParameter"
            },
            {
              "attributeId": 100,
              "minValue": 0,
              "expression": [
                "string1",
                "string2"
              ],
              "maxValue": 19.9,
              "valueType": "string",
              "name": "my property",
              "description": "This is a template parameter of type `number`.",
              "type": "templateParameter"
            }
          ],
          "description": "Creates a discount when a coupon is valid",
          "id": "7fa800a8-ac8d-4792-85dc-c4650dcc8f23",
          "title": "Give discount via coupon",
          "parentId": "7fa800a8-ac8d-4792-85dc-c4650dcc8f23"
        },
        {
          "condition": [
            "and",
            [
              "couponValid"
            ]
          ],
          "effects": [
            "catch",
            [
              "noop"
            ],
            [
              "setDiscount",
              "10% off",
              [
                "*",
                [
                  ".",
                  "Session",
                  "Total"
                ],
                [
                  "/",
                  10,
                  100
                ]
              ]
            ]
          ],
          "bindings": [
            {
              "attributeId": 100,
              "minValue": 0,
              "expression": [
                "string1",
                "string2"
              ],
              "maxValue": 19.9,
              "valueType": "string",
              "name": "my property",
              "description": "This is a template parameter of type `number`.",
              "type": "templateParameter"
            },
            {
              "attributeId": 100,
              "minValue": 0,
              "expression": [
                "string1",
                "string2"
              ],
              "maxValue": 19.9,
              "valueType": "string",
              "name": "my property",
              "description": "This is a template parameter of type `number`.",
              "type": "templateParameter"
            }
          ],
          "description": "Creates a discount when a coupon is valid",
          "id": "7fa800a8-ac8d-4792-85dc-c4650dcc8f23",
          "title": "Give discount via coupon",
          "parentId": "7fa800a8-ac8d-4792-85dc-c4650dcc8f23"
        }
      ],
      "templateId": 3,
      "userId": 388
    }
  ]
}

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

Was this page helpful?