1

Count how many Notifications are recieved and viewed

Тема: Count how many Notifications are recieved and viewed

Good afternoon everyone, today im asking for your help with this.

We are trying to have some control when it comes to the online notifications, we made the notification has events that's something we did, but now I'm trying to figure out a way to count how many of those notifications are received throughout the day with the help of the API and how many of them have been viewed (or open or expanded) but now I'm wondering if that's possible, reading the documentation of notifications in the API i thought i could use the "Notifications: detailed information" but where can i get the array of notifications IDs or is there another way to get the information i want???

Thank you, any help is appreciated.

2

Count how many Notifications are recieved and viewed

(14/09/2022 00:41:52 отредактировано jornadadgps22)

Re: Count how many Notifications are recieved and viewed

Hopefully this picture helps to understand what im trying to do, i wanna take the total number of Notifications from a certain time period, so has is showed shown in the picture bellow there's one notification (at the moment), but in two hours theres gonna be like 20, so i wanna know if theres a way using the API to take the number of total notifications and if theres a way to know if said notifications have been opened or checked.

  • Count how many Notifications are recieved and viewed
3

Count how many Notifications are recieved and viewed

Re: Count how many Notifications are recieved and viewed

Hello,  jornadadgps22
In order to get notifications' IDs you can use 'search_items' request by resource with 1024 flags value
The response contains "ac" parameter with the total number of triggers since the notification creation date.

unfortunately, the is no request that can show the state of the online notification, whether they were read or not. 
As you've mentioned you can use 'Register event for unit' action to view information about the triggers in the 'Events' table type or messages.
According to this action you can store the information about the trigger and text.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
4

Count how many Notifications are recieved and viewed

Re: Count how many Notifications are recieved and viewed

zant пишет:

Hello,  jornadadgps22
In order to get notifications' IDs you can use 'search_items' request by resource with 1024 flags value
The response contains "ac" parameter with the total number of triggers since the notification creation date.

unfortunately, the is no request that can show the state of the online notification, whether they were read or not. 
As you've mentioned you can use 'Register event for unit' action to view information about the triggers in the 'Events' table type or messages.
According to this action you can store the information about the trigger and text.

Thank you, just a quick question, since there's no way to see if the notifications were read or not, is there a way to still get the total number of notifications the sesion recieves throughout the day "example : theres 54 notifcations right now" and get the complete information of the last three or get the events???

Also when executing the line to get the notification ID, the response shows me the notifications and the ac parameter as you said, but the thing is that some notifications have repeated id's, i mean the notification named "Connexion Lost" has an ID and then the "Lost Connection" notification has the same ID.

5

Count how many Notifications are recieved and viewed

Re: Count how many Notifications are recieved and viewed

jornadadgps22 Hello,

Thank you, just a quick question, since there's no way to see if the notifications were read or not, is there a way to still get the total number of notifications the sesion recieves throughout the day "example : theres 54 notifcations right now" and get the complete information of the last three or get the events???

If you register notification trigger as an events, you can track the counts by events availability  in the report by each day.
Or, you can execute search_items request to get notifications everyday, and using ac parameter store current value for each notification in your app.
Then you can compare current and previous values to get total triggers for each day.

Also when executing the line to get the notification ID, the response shows me the notifications and the ac parameter as you said, but the thing is that some notifications have repeated id's, i mean the notification named "Connexion Lost" has an ID and then the "Lost Connection" notification has the same ID.

Yes, the notifications' IDs are not unique in general, but unique for the specific resource. Try to add 1 to the flags value in the search_items request execution (1025). Thus the response contains resource name and ID and notifications will be grouped by the exact resources.
In this case, you will be able to separate them not only by ID of the notification, but by the resource ID as well.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
6

Count how many Notifications are recieved and viewed

Re: Count how many Notifications are recieved and viewed

zant пишет:

jornadadgps22 Hello,

Thank you, just a quick question, since there's no way to see if the notifications were read or not, is there a way to still get the total number of notifications the sesion recieves throughout the day "example : theres 54 notifcations right now" and get the complete information of the last three or get the events???

If you register notification trigger as an events, you can track the counts by events availability  in the report by each day.
Or, you can execute search_items request to get notifications everyday, and using ac parameter store current value for each notification in your app.
Then you can compare current and previous values to get total triggers for each day.

Also when executing the line to get the notification ID, the response shows me the notifications and the ac parameter as you said, but the thing is that some notifications have repeated id's, i mean the notification named "Connexion Lost" has an ID and then the "Lost Connection" notification has the same ID.

Yes, the notifications' IDs are not unique in general, but unique for the specific resource. Try to add 1 to the flags value in the search_items request execution (1025). Thus the response contains resource name and ID and notifications will be grouped by the exact resources.
In this case, you will be able to separate them not only by ID of the notification, but by the resource ID as well.

Thank you, adding the 1 to the flag did the trick