Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Alert Management

adrianweber edited this page Sep 19, 2014 · 17 revisions

The Alert API is a REST Interface for informing alerts to be analyzed and processed by the platform.

Create new Alert

Param Type Description Value
Authorization HTTP Header Access Token Authorization: Bearer 23094823424y2i3uy4i2u3y4i2i43uy
Request
POST /alerts

Request
{
"msgType": "alertsPush",
"data": [{
	"accountId": "35548686-35bc-47a3-b137-579fdd496101",
	"alertId": 75,
	"ruleId": 1206,
	"deviceId": "00-00-00-00-a8-9c",
	"alertStatus": "Open",
	"timestamp": 1402580459000,
	"resetTimestamp": 123,
	"resetType": "Automatic",
	"lastUpdateDate": 2934209384029,
	"ruleName": "rule 2 - basic condition new",
	"rulePriority": "Low",
	"naturalLangAlert": "temperature > 17.2",
	"ruleExecutionTimestamp": 1402580459000,
	"conditions": [{
		"conditionSequence": 1,
		"naturalLangCondition": "temperature > 17.2",
		"components": [{
			"componentId": "e5f09130-c70e-4082-9801-49833c853493",
			"dataType": "Number",
			"componentName": "GA9c-3-Temp.Sensor",
			"valuePoints": [{
				"timestamp": 1402580459000,
				"value": "21"
			}]
		}]
	}]
}]
}

Get List of Alerts

Get a list of all alerts for the specified account.

Param Type Description Value
Authorization HTTP Header Access Token Authorization: Bearer 23094823424y2i3uy4i2u3y4i2i43uy
accountId URL Slug The ID of an Account 534da46c820cb9f74a0d3de6
Request
GET /accounts/{accountId}/alerts

Response 200 OK (application/json)
[
{
    "accountId": "0d66c8b6-9f4d-4551-a9c8-d356c2dd033d",
    "alertId": "75",
    "deviceId": "00-00-00-00-a8-9c",
    "ruleId": 6832,
    "ruleName": "rule 2 - basic condition new",
    "priority": "Low",
    "triggered": 1402580459000,
    "created": 1411130946286,
    "naturalLangAlert": "temperature > 17.2",
    "conditions": [
        {
            "sequence": 1,
            "condition": "temperature > 17.2"
        }
    ],
    "status": "New",
    "updated": 1411130946286,
    "_id": "541c2642b3700bcbe9c76fc5"
}
]

Clone this wiki locally