Executes the specified instruction against given input objects

Params

Param name Description
instruction_applicability
required

Whether to execute an instruction on:

2: things belonging to specified thing_template
3: specified things

Value: Must be Integer.
instruction_applicability_value
required

thing_template or a thing_key or an array of thing keys depending on the value of instruction_applicability


Value: Must be an array of any type
json_map
optional

Map of configurable parameters


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
is_oem
optional

Execute an instruction in child account by oem user if is_oem flag is true.


Value: Must be a Boolean
child_organisation_key
optional

Organisation key of child account where oem user wants to execute instruction. Required field if is_oem is present.


Value: Must be a String

Examples

Request - execute an instruction against all sensors of type 'Energy Meter'
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:olezAZXGQn9MutnfNerKDQ" -d '{"instruction_applicability":"2","instruction_applicability_value":"Energy Meter"}' https://api.datonis.io/api/v3/instructions/a5ad49t441/execute

Response (list of sensor alert keys describing execution status of the instruction against each sensor)
{
  "status": [
    "af1b856c7t",
    "e5688474t6",
    "bf72966t3b"
  ]
}
Request - execute an instruction against specified sensors
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:olezAZXGQn9MutnfNerKDQ" -d '{"instruction_applicability":"3","instruction_applicability_value":["4dc7t6fe93","t6fd4btb5e"]}' https://api.datonis.io/api/v3/instructions/767dte9eeb/execute

Response (list of sensor alert keys describing execution status of the instruction against each sensor)
{
  "status": [
    "af1b856c7t",
    "e5688474t6",
    "bf72966t3b"
  ]
}