RTFM (Italics are mine):
Using Rule Machine from HTTP requests
It is also possible to cause Rule Machine to perform these same actions from an HTTP request. To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point. The endpoint URL given by Rule Machine has this form:
http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db
To run rule actions this URL must be modified to include the list of rules and the action. The modification takes this form:
/action=rule1&rule2&rule3
Where action is the action from the list above and rule1&rule2&rule3
are the appIds of the rules to run separated by ampersands.
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:
http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&956&10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db
This example would do the same thing as the code example above, where 943&956&10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.
The appIds are the values selected by the input described above, for example theseRules
. The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:
[http://192.168.0.36/installedapp/configure/10249/mainPage
](http://192.168.0.36/installedapp/configure/10249/mainPage`)
The appId for that rule is 10249.
Get Rule List
To get the list of rules as is returned from getRuleList()
use this insert for the URL:
/getRuleList
for full URL like this:
http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db
This returns a JSON object with appId and rule name pairs. The other requests return a JSON object with a human readable description of what was done.
Set Global Variable
A Global Variable can be set by an endpoint trigger. The format for the parameter is this:
/setGlobalVariable=varName:varString
The varString
portion is assumed to be URL encoded, and is URL decoded before being stored into the varName
global variable.