Entity Information
Data type: Alert, fields list1. Get single alert by Id
URL: /api/alerts/{alertId}
Where alertId - numeric alert identifier.
Query parameter | Required | Type | Default | Description |
---|---|---|---|---|
includechilddivisions | No | True/False | False | Search alert from assets in subdivisions |
2. Get multiple alerts
URL: /api/alerts
Sort order: reverse chronological (using CreatedOn property)
Query parameter | Required | Type | Default | Description |
---|---|---|---|---|
assetId | No | Numeric | - | If specified, returns alerts only for this asset |
assetIds | No | Comma-delimited list of numbers | - | Similar to assetId, allows to filter by multiple asset Ids. Can't be used together with assetId query parameter |
driverId | No | Numeric | - | If specified, returns alerts only for this driver |
includechilddivisions | No | True/False | False | Include alerts from subdivisions |
includedisabledassets | No | True/False | False | Include alerts from disabled assets |
startdatetime | No | Date/Time | - | If set, returns only alerts occurred at specified Date/Time or after it. Both UTC and local dates are accepted. Check Dates Handling for details. If value is not set, the Trakopolis API server returns alerts for last 30 days. |
enddatetime | No | Date/Time | - | If set, returns only alerts occurred at specified Date/Time or before it. Both UTC and local dates are accepted. Check Dates Handling for details. |
visibleforuserid | No | Numeric | - | If specified, returns only alerts on which user has permissions to view. Important: this parameter is not applicable for external web applications and mobile applications. See "Alerts filtration by visibility rules" section. |
visiblefordriverid | No | Numeric | - | If specified, returns only alerts on which driver has permissions to view. |
If both startdatetime and enddatetime are set, return alerts ocurred between startdatetime and enddatetime.
Alerts filtration by visibility rules
/api/alerts request behavior depends on application type.
Request | External / Mobile apps | PrivateM2M / Web plugins |
---|---|---|
/api/alerts | Alerts visible for current user | All alerts (visibility rules are ignored) |
/api/alerts?visibleForDriverId=X | Alerts visible for current user OR for specified driver | Alerts visible for specified driver |
/api/alerts?visibleForUserId=Y | 400: Bad request | Alerts visible for specified user |
/api/alerts?visibleForDriverId=X&visibleForUserId=Y | 400: Bad request | Alerts visible for specified user OR for specified driver |