Skip to main content
This page documents an earlier version of the API client. For the latest version, see Retrieve a rule.
Required ACL: settings To find the objectID for rules, use the searchRules method.

Examples

Rule rule = index.GetRule("ruleID");

// Asynchronous
Rule rule = await index.GetRuleAsync("");

Parameters

objectID
string
required
The ID of the rule to retrieve.

Response

condition
list
Condition of the rule.
consequence
list
Consequence of the rule.
objectID
string
objectID of the Rule.

Response as JSON

This section shows the JSON response returned by the API. Each API client wraps this response in language-specific objects, so the structure may vary. To view the response, use the getLogs method. Don’t rely on the order of properties—JSON objects don’t preserve key order.
JSON
{
  "objectID": "a-rule-id",
  "conditions": [{
    "pattern": "smartphone",
    "anchoring": "contains"
  }],
  "consequence": {
    "params": {
      "filters": "category = 1"
    }
  }
}
I