RTI exposed the following API to create rules.
POST {baseUrl}/rule
{
"name": "Abnormal Power Usage",
"description": "Abnormal Power Usage when exceeding 100",
"disabled": false,
"severity": 1,
"schemaId": "f1b2b80f",
"condition": ".reading > 100",
"actions": [
"cc899bdc"
]
}
It also allows creating actions.
POST {baseUrl}/action
Payload:
{
"type": "node-red",
"name": "Node-RED Webhook",
"description": "A webhook for integrating with Node-RED",
"fields": {
"url": "http://btnodered.mybluemix.net/rti-webhook"
}
}
Note that you have to create actions before creating a rule as you refer to the action in your rule.
Above example is taken from this article. It provides details.
However, RTI has been merged with IoTP recently and I'm not sure if IBM has exposed the above API from IoTP as of now. I will try to find this.
The base URL of IoTP APIs is as follows.
https://{6-letter-org_id}.internetofthings.ibmcloud.com/api/v0002/
Use basic authentication with username set to API key and password set to API token. Details of all IoTP APIs can be found here. Use
Dashboard -> Apps -> Generate Key
to create a pair of API key and token.