Easiest way to trigger Rule through JSON call?

I have a number of rules setup that have no trigger. I run them when I need to do a series of things. I would like to be able to run these rules externally through a JSON call. So far the only way I have figured out how to do this is to create a virtual device and then make that the trigger of the rule. This is a bit messy as I am creating a number of virtual devices to do this. Is this the only way? Thanks.

This may help

3 Likes

I have been playing around repeatedly with this and cannot get it to work. Regular calls to the API for devices etc are working fine. But each time I try to call a rule I get the following:

{"error":true,"type":"AppException","message":"Not Found"}

and using the cloud:

{"message":"Missing Authentication Token"}

I don't see anyway in maker to authorize the running of rules - the same way that you authorize devices so I am not sure what is going on here?

Here is the format of my commands:

http://192.168.2.108/apps/api/3752/trigger/runRuleAct=4281?access_token=TOKEN

https://cloud.hubitat.com/api/48d9c2da-d96b-4673-b853-2ebabe5bc570/trigger/runRuleAct=4281?access_token=TOKEN

and even the get rule list does not work

http://192.168.2.108/apps/api/3752/trigger/getRuleList?access_token=TOKEN]

What am I doing wrong here? Thanks.

@support_team

bump @support_team

Have you tried using 'local endpoint' as a trigger for the rule? That will create a URL, separate from Maker API, that will trigger the rule.

Or 'cloud endpoint' if you need external access.

1 Like

Is the App ID and token you are using in the URLs you posted for a Rule in RM, or are you trying to use Maker API? You won't use Maker API for these. If I'm right, @bertabcd1234 explains some of the issues you may be experiencing in the post below. You need to setup a rule with an endpoint and use the App ID for that rule in your Rule List URL. Even If you are trying to call an RM Rule in those URL's, there may be something else in Robert's post that could spark a solution for you.

Thanks that helped.

1 Like