Views accessable via API #2825

Closed
opened 2026-02-05 05:21:36 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @bytepoets-ssi on GitHub (Jun 1, 2022).

API Endpoint or Feature

At the moment the views of a user are not visible in the API. The status should be visible at least for pages as isRead: boolean:

  • GET /api/pages
  • GET /api/pages/{id}

In addition a user should be able to set it.

  • POST /api/pages/{id}/isRead

For better experience of new users a page is only unread if it was created after the user was created

Use-Case

Feature completeness of the API. Gather the information that is stored in Bookstack and other places in a central system. e.g. show all unread emails, Bookstack pages,... and mark them as read shortly after the user has interacted with it.

Additional context

No response

Originally created by @bytepoets-ssi on GitHub (Jun 1, 2022). ### API Endpoint or Feature At the moment the views of a user are not visible in the API. The status should be visible at least for pages as `isRead: boolean`: - GET /api/pages - GET /api/pages/{id} In addition a user should be able to set it. - POST /api/pages/{id}/isRead For better experience of new users a page is only unread if it was created after the user was created ### Use-Case Feature completeness of the API. Gather the information that is stored in Bookstack and other places in a central system. e.g. show all unread emails, Bookstack pages,... and mark them as read shortly after the user has interacted with it. ### Additional context _No response_
OVERLORD added the 🔩 API Request label 2026-02-05 05:21:36 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jun 1, 2022):

As per my comment in your other issue (https://github.com/BookStackApp/BookStack/issues/3471#issuecomment-1143321310) it would help if you could provide more detail on the use-case that you actually have.
It's not clear if the provided use-case (Of unread/read) is just an example use-case or something you actually need.
Having some detail regarding your usage may help understand if there are more appropriate ways to achieve what you need.

@ssddanbrown commented on GitHub (Jun 1, 2022): As per my comment in your other issue (https://github.com/BookStackApp/BookStack/issues/3471#issuecomment-1143321310) it would help if you could provide more detail on the use-case that you actually have. It's not clear if the provided use-case (Of unread/read) is just an example use-case or something you actually need. Having some detail regarding your usage may help understand if there are more appropriate ways to achieve what you need.
Author
Owner

@bytepoets-ssi commented on GitHub (Jun 1, 2022):

Thanks for the fast response. I already have a system where I aggregate information of Bookstack and several other sources. I currently use the authenticated Bookstack API in this system. Now I want to show to the user on one screen all the new Bookstack pages that he hasn't seen before. With the current API I only could filter for updated_at of pages and would need to store the information whether the user has read it in a different place

@bytepoets-ssi commented on GitHub (Jun 1, 2022): Thanks for the fast response. I already have a system where I aggregate information of Bookstack and several other sources. I currently use the authenticated Bookstack API in this system. Now I want to show to the user on one screen all the new Bookstack pages that he hasn't seen before. With the current API I only could filter for `updated_at` of pages and would need to store the information whether the user has read it in a different place
Author
Owner

@ssddanbrown commented on GitHub (Jun 1, 2022):

Thanks for the extra info @bytepoets-ssi.

With the current API I only could filter for updated_at of pages and would need to store the information whether the user has read it in a different place

There is another way which may do what you need. You can use the /api/search endpoint with a query like so:

 {not_viewed_by_me} {created_after:2022-01-01} {type:page}

This would provide all pages not viewed by the current user, created this year. A full list of available search filters can be seen on this page: https://www.bookstackapp.com/docs/user/searching/#advanced-search-syntax

This seems like it would solve your goal of "show to the user on one screen all the new Bookstack pages that he hasn't seen before"

Keep in mind that views are not tracked per revision/update, only per-user-per-item.

@ssddanbrown commented on GitHub (Jun 1, 2022): Thanks for the extra info @bytepoets-ssi. > With the current API I only could filter for updated_at of pages and would need to store the information whether the user has read it in a different place There is another way which may do what you need. You can use the `/api/search` endpoint with a query like so: ``` {not_viewed_by_me} {created_after:2022-01-01} {type:page} ``` This would provide all pages not viewed by the current user, created this year. A full list of available search filters can be seen on this page: https://www.bookstackapp.com/docs/user/searching/#advanced-search-syntax This seems like it would solve your goal of "show to the user on one screen all the new Bookstack pages that he hasn't seen before" Keep in mind that views are not tracked per revision/update, only per-user-per-item.
Author
Owner

@ssddanbrown commented on GitHub (Jul 25, 2022):

Since there has been no further follow-up upon the alternate solution provided I'll therefore close this off.

@ssddanbrown commented on GitHub (Jul 25, 2022): Since there has been no further follow-up upon the alternate solution provided I'll therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2825