Create rules in bulk

This API creates new rules in bulk. Devices specified in the rule must exist. The caller must own, or have rights to, the device.

Parameter description:

  • name: Rule name.(mandatory)
  • description: User given description of this rule.
  • expression: Expression of a logical statement about relationship between the entities. This field must contain an expression conforming to Ayla Rule Expression Syntax. Expressions always evaluate to true or false. If they evaluate to true, the rule performs the associated action(s).(mandatory)
    Example expressions:
    • "DATAPOINT(dsn1,prop1) < 60"
    • "CONNECTION(DSN0000000120,online) || CONNECTION(DSN0000000120,offline) || CONNECTION(DSN0000000120,all)"
    • "ACTIVATION(DSN0000000120,activated) || ACTIVATION(DSN0000000120,deactivated)"
  • action_ids: List of action UUID(s) for the action(s) to be associated with a rule.
{
  "rules":[
    {
      "name":"rule 1",
      "expression":"CONNECTION(DSN0000000001,online)",
      "action_ids":[
        "4312e001-0001-11e8-b3c4-29146421699e"
      ]
    },
    {
      "name":"rule 2",
      "expression":"CONNECTION(DSN0000000002,online)",
      "action_ids":[
        "43120002-0002-11e8-b3c4-29146421699e"
      ]
    },
    {
      "name":"rule 3",
      "expression":"CONNECTION(DSN0000000003,online)",
      "action_ids":[
        "43120003-0003-11e8-b3c4-29146421699e"
      ]
    }
  ]
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!