Alerts API documentation version v1
Application_URL/services/api/v1
About Alerts
The alerts displays a list of the current alerts that are triggered by equipment events or rules defined for sensor data and health scores.
Purpose
This API allows you to create single alert.
/alerts
post
This endpoint allows to create alert for an equipment.
post /alerts
This endpoint allows to create alert for an equipment.
Secured by basic
REST API supports Basic Authentication
Body
Type: application/json
Schema:
{
"$schema":"http://json-schema.org/draft-4/schema",
"type":"object",
"additionalProperties": false,
"properties":
{
"id": {
"type": "string",
"maxLength": 32
},
"businessTimeStamp": {
"type": "string",
"maxLength": 24
},
"status": {
"type": "string",
"maxLength": 50
},
"type": {
"type": "string",
"maxLength": 71
},
"eventType": {
"type": "string",
"maxLength": 81
},
"description": {
"type": "string",
"maxLength": 50
},
"severity": {
"type": "number",
"maxLength": 1
},
"source": {
"type": "string",
"maxLength": 50
},
"code": {
"type": "string",
"maxLength": 32
},
"thingId": {
"type" : "string",
"maxLength": 32
},
"thingProperty" : {
"type" : "string",
"maxLength": 255
},
"alert_details" : {
"type" : "object",
"additionalProperties": true,
"properties": {
"AlertDescription": {
"type": "string",
"maxLength": 50
},
"AlertSource": {
"type": "string",
"maxLength": 50
},
"CreatedTimeStamp": {
"type": "string",
"maxLength": 24
}
}
}
},
"required":[
"id",
"businessTimeStamp",
"eventType",
"status",
"severity",
"thingId"
]
}Example:
{
"id": "Alert_1",
"businessTimeStamp": "2018-04-04T10:00:00Z",
"type": "pdms.events:AlertsPST",
"eventType": "pdms.events:E_<AlertTypeName>",
"status": "New",
"severity": 2,
"code": "ErrorCode",
"thingId": "6DAC315F180940CB9AAFDC32EE808BC0",
"alert_details": {
"AlertDescription": "Bearing Overheating",
"AlertSource": "Machine",
"CreatedTimeStamp":"2018-08-08T10:22:00Z"
}
}HTTP status code 201
Created.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-4/schema",
"type": "object",
"additionalProperties": true,
"properties": {
"value": {
"type": "object",
"properties" : {
"EventId":{
"type":"string"
},
"CorrelationId":{
"type":"string"
}
}
}
}
}Example:
{
"value": {
"EventId": "Alert_1",
"CorrelationId": "Alert_1"
}
}HTTP status code 204
No Content
HTTP status code 500
Internal Server Error, something unexpected happened.