Get all incidents in a home

GET/homes/{homeId}/smartModules/{moduleId}/incidents

Base URL: https://api.tinkermode.com

Get the list of all incidents in this home.

Authentication

This endpoint does not require authentication.

Path parameters

NameTypeRequiredConstraintsDescription
homeIdintegerYesThe unique id for a home.
moduleIdstringYesThe unique id for a smart module.

Query parameters

NameTypeRequiredConstraintsDescription
limitintegerNodefault: 20; min: 1; max: 100If non-zero, maximum number of incidents to return. limit should be the number between 1 to 100.
monitorIdnumberNoID of monitor by which this incident is created
skipintegerNodefault: 0; min: 0Number of incidents to skip over (incidents are ordered in descending order by creation time)

Responses

200 An array of monitors are returned.

Content type: application/json

Incident that is created by monitor

An array of objects with the following shape:

PropertyTypeRequiredConstraintsDescription
creationTimestringNoread-only (server-generated)Timestamp of creation of this incident.
descriptionstringNoread-only (server-generated)Description of this incident
evaluationTimeRangeunknownNo
homeIdintegerNoread-only (server-generated)Home that this monitor belongs to
incidentTypestringNoread-only (server-generated); one of: alert, recoveryType of this incident
moduleIdstringNoread-only (server-generated)Smart Module that this incident belongs to
monitorIdintegerNoread-only (server-generated)Monitor that created this incident
monitorSnapshotobjectNoSnapshot of the monitor which is to be created when the incident is created
Properties of monitorSnapshot
PropertyTypeRequiredConstraintsDescription
conditionone of 2Noread-only (server-generated)Monitor Condition object

One of the following 2 shapes:

Variant 1

Heartbeat monitoring condition against data points in a time series.

PropertyTypeRequiredConstraintsDescription
conditionTypestringYesCurrently, the only supported type is timeSeriesHeartbeat.
intervalintegerYesDuration of time (second) how often data points are expected to appear in the time series. It should be longer than 60 seconds at least.
seriesIdstringYesTime Series ID to be monitored.

Variant 2

Threshold-based monitoring condition against static data points in a time series

PropertyTypeRequiredConstraintsDescription
conditionTypestringYesCurrently, the only supported type is timeSeriesThreshold
dataPointsDurationintegerYesExpected duration of time (in seconds) between two data points
dataPointsEvaluationPolicystringYesone of: consecutive, totalHow to count the breaching data points
intervalintegerYesHow often (in seconds) the monitoring condition is evaluated
missingDataPointPolicystringYesone of: ignore, breaching, notBreachingHow to treat missing data
numberOfBreachingDataPointsToAlertintegerYesNumber of breaching data points before an alert is triggered
operatorstringYesone of: lessThan, lessThanOrEqualTo, equal, notEqual, greaterThanOrEqualTo, greaterThanThe operator to compare the threshold value and monitored value
seriesIdstringYesTime Series ID to be monitored
thresholdnumberYesThreshold value against which the monitor evaluates whether the data point has breached the condition
descriptionstringNoMonitor description
evaluationDelayintegerNoread-only (server-generated)How long the monitor evaluation should be delayed
incidentCustomDescriptionsobjectNoUser defined incident descriptions
Properties of incidentCustomDescriptions
PropertyTypeRequiredConstraintsDescription
alertstringNoread-only (server-generated)Custom description for alert incident. If not set, default description will be 'ALERT: ${monitor.name}'
recoverystringNoread-only (server-generated)Custom description for recovery incident. If not set, default description will be 'RECOVERY: ${monitor.name}'
namestringNoMonitor name
projectIdintegerNoread-only (server-generated)Project that this incident belongs to

Response example

[
  {
    "creationTime": "2021-03-01T18:10:09Z",
    "description": "RECOVERY: humidity sensor connection is back to normal",
    "evaluationTimeRange": {
      "begin": "2021-03-01T18:08:09Z",
      "end": "2021-03-01T18:09:09Z"
    },
    "homeId": 100,
    "incidentType": "recovery",
    "moduleId": "tsdb",
    "monitorId": 1347,
    "monitorSnapshot": {
      "condition": {
        "conditionType": "timeSeriesHeartbeat",
        "interval": 60,
        "seriesId": "humidity"
      },
      "description": "",
      "evaluationDelay": 60,
      "incidentCustomDescriptions": {
        "alert": "ALERT: check if the humidity sensor is connected",
        "recovery": "RECOVERY: humidity sensor connection is back to normal"
      },
      "name": "humidity sensor heartbeat"
    },
    "projectId": 1234
  },
  {
    "creationTime": "2021-03-01T17:02:08Z",
    "description": "ALERT: check if the humidity sensor is connected",
    "evaluationTimeRange": {
      "begin": "2021-03-01T17:00:08Z",
      "end": "2021-03-01T17:01:08Z"
    },
    "homeId": 100,
    "incidentType": "alert",
    "moduleId": "tsdb",
    "monitorId": 1347,
    "monitorSnapshot": {
      "condition": {
        "conditionType": "timeSeriesHeartbeat",
        "interval": 60,
        "seriesId": "humidity"
      },
      "description": "",
      "evaluationDelay": 60,
      "incidentCustomDescriptions": {
        "alert": "ALERT: check if the humidity sensor is connected",
        "recovery": "RECOVERY: humidity sensor connection is back to normal"
      },
      "name": "humidity sensor heartbeat"
    },
    "projectId": 1234
  }
]

401 Authorization is required to access this resource.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.