All URIs are relative to https://api.artik.cloud/v1.1
Method | HTTP request | Description |
---|---|---|
createRule | POST /rules | Create Rule |
deleteRule | DELETE /rules/{ruleId} | Delete Rule |
getRule | GET /rules/{ruleId} | Get Rule |
updateRule | PUT /rules/{ruleId} | Update Rule |
RuleEnvelope createRule(ruleInfo, userId)
Create Rule
Create a new Rule
var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;
// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"
var apiInstance = new ArtikCloud.RulesApi()
var ruleInfo = new ArtikCloud.RuleCreationInfo(); // {RuleCreationInfo} Rule object that needs to be added
var userId = "userId_example"; // {String} User ID
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createRule(ruleInfo, userId, callback);
Name | Type | Description | Notes |
---|---|---|---|
ruleInfo | RuleCreationInfo | Rule object that needs to be added | |
userId | String | User ID |
- Content-Type: Not defined
- Accept: application/json
RuleEnvelope deleteRule(ruleId)
Delete Rule
Delete a Rule
var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;
// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"
var apiInstance = new ArtikCloud.RulesApi()
var ruleId = "ruleId_example"; // {String} Rule ID.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.deleteRule(ruleId, callback);
Name | Type | Description | Notes |
---|---|---|---|
ruleId | String | Rule ID. |
- Content-Type: Not defined
- Accept: application/json
RuleEnvelope getRule(ruleId)
Get Rule
Get a rule using the Rule ID
var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;
// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"
var apiInstance = new ArtikCloud.RulesApi()
var ruleId = "ruleId_example"; // {String} Rule ID.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getRule(ruleId, callback);
Name | Type | Description | Notes |
---|---|---|---|
ruleId | String | Rule ID. |
- Content-Type: Not defined
- Accept: application/json
RuleEnvelope updateRule(ruleId, ruleInfo)
Update Rule
Update an existing Rule
var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;
// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"
var apiInstance = new ArtikCloud.RulesApi()
var ruleId = "ruleId_example"; // {String} Rule ID.
var ruleInfo = new ArtikCloud.RuleUpdateInfo(); // {RuleUpdateInfo} Rule object that needs to be updated
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.updateRule(ruleId, ruleInfo, callback);
Name | Type | Description | Notes |
---|---|---|---|
ruleId | String | Rule ID. | |
ruleInfo | RuleUpdateInfo | Rule object that needs to be updated |
- Content-Type: Not defined
- Accept: application/json