Creating a trigger is simple. In the developer portal, select an app, then click on Triggers to see all the triggers for your app. To create a new trigger, click the Add Trigger button and type in a name of the trigger. A generated trigger looks like this:
:token- random alphanumeric string generated by ContextHub tying the events for the trigger directly to your app
:event_name- name of the event which will match the context rule during rule processing
So the full URL for a trigger linked to your app that would post the
arduino_event would be:
To use a trigger, you need to generate an HTTP POST request with the appropriate token and event name, along with posting the JSON body that represents the data for your event. The web request should have the
Content-Type header set to
application/json so the body is parsed correctly. A web tool like Hurl.it is a great way to test that your triggers are working correctly and you are passing the correct data to a context rule.