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.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
{
  "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"
      ]
    }
  ]
}
Body Params
json
Responses

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

422

Unprocessable Entity

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json