- changed component to VersionEye-API
Mark notifications as read
Are there any API to mark notifications as read? I am trying to implement a tool to report notifications to slack. But I have to pass the last reporting time because the 'read' status of notifications is always false when using the API 'GET /v2/me/notifications'. It is troublesome so I would like to mark notifications as read by API.
Comments (12)
-
reporter -
-
assigned issue to
-
assigned issue to
-
Hi @miyajan which Endpoint are you using exactly?
-
reporter Hi @reiz . I'm using the endpoint "https://www.versioneye.com/api/v2/me/notifications" in my tool (https://www.npmjs.com/package/versioneye-slack).
For example,
$ versioneye-slack notifications
always post all notifications. So I have to pass the last reporting time like the following to filter old notifications.
$ versioneye-slack notifications --last-notified-time 2017-01-01T00:00:00.000Z
But saving the last reporting time is troublesome so I would like to filter notifications by the "read" status.
-
Hi @miyajan. I just double checked the read property on the notification collections and it seems that it never is set to true. Will work on this today. Should be fixed by end of the week!
-
reporter Thanks!
-
Hi @miyajan. I fixed it with this commit: https://github.com/versioneye/versioneye-api/commit/e606819714c1fa4f7fbd40e13a4554b00525d8ef. Now the notification entities are marked as read directly after they are fetched from the API. The count is wrong now, I will fix the count tomorrow and add paging.
-
reporter @reiz I confirmed that notifications become read after calling the API. Great job!
-
- changed status to resolved
This is done now. I also fixed the number of unread notifications and added paging to the Endpoint. You can append
page=2
for example to get the 2nd page. On each page there are max 30 entries. -
reporter @reiz The API returns 1st page when I append
page=0
and 2nd page whenpage=1
. In other APIs, they don't handle whenpage=0
. Are the behaviors what you intended? -
@miyajan Good point! In the web app paging is starting with 1 as well. I just fixed it here: https://github.com/versioneye/versioneye-api/commit/945f8115bdce850c3e7154250982ebbed987bde9.
-
reporter @reiz LGTM!
- Log in to comment