Skip to content

Get Alerts

Return a list (or a subset) of Alerts the user has access to.

Both the raised-at and cleared-at ranges may be searched up to seven days at a time. Supply neither bound of a range, or only one of them, and we fill in the missing date using the same seven days, so asking for no dates returns the last week and asking for only an end date returns the week before it. See DateTime Handling for the complete rules and the response headers that report the window we used.

A full page of 10,000 alerts is roughly 4.3 MB of JSON at worst, so size your buffers and client timeouts accordingly.

Verb POST
Endpoint {base-url}/alerts
Max Page Size 10000

Request Body

{
  "routeFilter": {
    "alertIds": [],
    "alertCodes": [],
    "isCleared": false,
    "isUserClearable": false,
    "includeDebugAlerts": "Exclude",
    "raisedAtStart": "2024-03-15T00:00:00Z",
    "raisedAtEnd": "2024-03-22T00:00:00Z",
    "clearedAtStart": "2024-03-15T00:00:00Z",
    "clearedAtEnd": "2024-03-22T00:00:00Z"
  },
  "requestFilter": {
    "organizationIds": [],
    "accountIds": [],
    "siteIds": [],
    "machineIdentifiers": [],
    "includeDeleted": false
  }
}

Filters Honored

  • RequestFilter
    • organizationIds
    • accountIds
    • siteIds
    • machineIdentifiers
  • AlertFilter
    • alertIds
    • alertCodes
    • isCleared
    • isUserClearable
    • includeDebugAlerts
    • raisedAtStart
    • raisedAtEnd
    • clearedAtStart
    • clearedAtEnd

Returns

On Success

The requested set of alerts.

Response Body

[
  {
    "id": 36578,
    "accountId": 161,
    "siteId": 477,
    "organizationId": 12,
    "machineLocation": "Lunchroom - Soda",
    "machineProse": null,
    "machineId": 1402,
    "code": "NS",
    "alertCodeId": 7,
    "message": "No Sales have been reported by this machine for at least 3 day(s).",
    "isCleared": false,
    "clearedAt": null,
    "raisedAt": "2021-03-29T15:56:41.677",
    "alertMetadata": [],
    "timeZone": "America/Chicago"
  }
]

On Error

HTTP Code Error
400 A provided date range had the start date after the end date (INVALID_DATE_RANGE). Applies independently to both the raised-at and cleared-at ranges.