Get List of Notification API
Require Authentication
This API is used to get list of notifications and alerts for user based on combination of deviceID and token.
URL
api/notifications/list
Required parameter (POST)
- deviceID
- token
Optional parameter (GET)
All optional parameters use GET method. So it should be embedded in the URL, e.g: api/notifications/list?t=notification&o=notificationName&ot=asc
- t «used to filter notification based on notificationType field. Available value: notification, alert»
- o «used to sort data, contains field name. Available value: notificationName, total_recipients. Default value: notificationName»
- ot «used to sort data, contains sort type. Available value: asc, desc. Default value: desc»
- per_page «indicates how many data that will be displayed in each call. Value must be a number between 1 to 500. Default value: none (unlimited result)»
- offset «indicates the first data index that will be displayed in each call. Value must be a number with minimum value is 0. Default value: 0»
Example JSON Payload
{ "deviceID": "ABCD-EFGH-IJKL-MNOP", "token": "bb602ab13b8090268cd6e3bb9dfa39e2" }
Possible return HTTP status code
- 200
- 401
- 405
Return message
{ "status": "success", "message": { "notificationType": "Alert / Notification", "offset": 0, "count": 15, "embedString": "", "lists": [ { "notificationconfigID": 139, "companyID": 16, "notificationType": "notification", "notificationName": "ALERT TEMPERATURE", "emailSubject": "Waste Insights Platform Notifications", "emailContent": "You received Waste Insights Platform notification based on your configuration.", "smsMessage": "You received Waste Insights Platform notification based on your configuration.", "alertSensorTriggerSecond": "0", "alertOnetimeAlreadySend": "N", "emergency": "Y", "emergencyIntervalSeconds": -60, "sendType": "daily", "sendDay": "", "sendDate": "0", "createdDate": 1602848564, "updatedDate": 1690821015, "createdByUserID": 0, "updatedByUserID": 90, "lastSendTime": null, "total_recipients": "1" }, { "notificationconfigID": 111, "companyID": 16, "notificationType": "notification", "notificationName": "Demo 212", "emailSubject": "Waste Insights Platform Notifications", "emailContent": "You received Waste Insights Platform notification based on your configuration.", "smsMessage": "You received Waste Insights Platform notification based on your configuration.", "alertSensorTriggerSecond": "0", "alertOnetimeAlreadySend": "N", "emergency": "Y", "emergencyIntervalSeconds": -60, "sendType": "daily", "sendDay": "", "sendDate": null, "createdDate": 1587277395, "updatedDate": 1690374792, "createdByUserID": 0, "updatedByUserID": 90, "lastSendTime": null, "total_recipients": "0" } ] } }
Note: :notificationrecipientsendingID is the same as messageID
If notificationType = 'notification', you can ignore alertSensorTriggerSecond field.
If notificationType = 'alert', you can ignore emergency field (or immediate flag). alertSensorTriggerSecond contains threshold of last sensor data reading in seconds.
Note: use "next_parameter" and "previous_parameter" to go to next or previous result page. Just combine it with the API URL, e.g: "api/notifications/list"+next_parameter or "api/notifications/list"+previous_parameter