API DocsRESTRule service

BatchGetRules

Retrieves multiple rules.

POST
/api/v1/rules:batchGet

Request Body

application/jsonRequired

BatchGetRulesRequest is used to retrieve rules by rule_ids or client_keys. If both are provided, both will be used to retrieve rules.

ruleIdsarray<string>

clientKeysarray<string>

curl -X POST "<API_URL>/api/v1/rules:batchGet" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "ruleIds": [
      "string"
    ],
    "clientKeys": [
      "string"
    ]
  }'

A successful response.

{
  "rules": [
    {
      "ruleId": "string",
      "assetId": "string",
      "name": "string",
      "description": "string",
      "isEnabled": true,
      "createdDate": "2019-08-24T14:15:22Z",
      "modifiedDate": "2019-08-24T14:15:22Z",
      "createdByUserId": "string",
      "modifiedByUserId": "string",
      "organizationId": "string",
      "conditions": [
        {
          "ruleConditionId": "string",
          "ruleId": "string",
          "expression": {
            "singleChannelComparison": {
              "channelComponent": "string",
              "channelName": "string",
              "comparator": "CONDITION_COMPARATOR_UNSPECIFIED",
              "double": 0.1,
              "string": "string",
              "lastValue": {}
            },
            "calculatedChannel": {
              "channelReferences": {
                "property1": {
                  "name": "string",
                  "component": "string"
                },
                "property2": {
                  "name": "string",
                  "component": "string"
                }
              },
              "expression": "string"
            }
          },
          "createdDate": "2019-08-24T14:15:22Z",
          "modifiedDate": "2019-08-24T14:15:22Z",
          "createdByUserId": "string",
          "modifiedByUserId": "string",
          "actions": [
            {
              "ruleActionId": "string",
              "ruleConditionId": "string",
              "actionType": "ACTION_KIND_UNSPECIFIED",
              "configuration": {
                "notification": {
                  "recipientUserIds": [
                    "string"
                  ]
                },
                "annotation": {
                  "tagIds": [
                    "string"
                  ],
                  "annotationType": "ANNOTATION_TYPE_UNSPECIFIED",
                  "assignedToUserId": "string"
                }
              },
              "createdDate": "2019-08-24T14:15:22Z",
              "modifiedDate": "2019-08-24T14:15:22Z",
              "createdByUserId": "string",
              "modifiedByUserId": "string",
              "ruleActionVersionId": "string"
            }
          ],
          "ruleConditionVersionId": "string"
        }
      ],
      "ruleVersion": {
        "ruleId": "string",
        "ruleVersionId": "string",
        "version": "string",
        "createdDate": "2019-08-24T14:15:22Z",
        "createdByUserId": "string",
        "versionNotes": "string",
        "generatedChangeMessage": "string",
        "deletedDate": "2019-08-24T14:15:22Z"
      },
      "clientKey": "string",
      "assetConfiguration": {
        "assetIds": [
          "string"
        ],
        "tagIds": [
          "string"
        ]
      },
      "contextualChannels": {
        "channels": [
          {
            "name": "string",
            "component": "string"
          }
        ]
      },
      "deletedDate": "2019-08-24T14:15:22Z"
    }
  ]
}