[GH-ISSUE #659] APIv1: Bookmarks #331

Open
opened 2026-02-25 23:33:58 +03:00 by kerem · 2 comments
Owner

Originally created by @fmartingr on GitHub (Jul 21, 2023).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/659

Originally assigned to: @fmartingr on GitHub.

Migrate the legacy bookmarks API to the new router and API specification

Acceptance criteria

  • /api/v1/bookmarks: GET for list, POST for creation.
    • Bookmark creation should allow all current features (create archive/readable) plus ebook creation. But all these fields should be put inside another (_creation_options?) instead of mixed with the object attributes.
  • /api/v1/bookmarks/:id: PUT/PATCH for modification, GET for retrieving information, DELETE for deletion.
  • /api/v1/bookmarks/:id/cache: POST call that allows a single bookmark cache regeneration (re-download archive, rebuild ebook, ...).
  • /api/v1/bookmarks/cache: POST call that allows multiple bookmarks cache regeneration (re-download archive, rebuild ebook, ...).
  • Logic should be moved to domains
  • All endpoints should be properly tested.
  • All endpoints should use swagger definitions.
  • All endpoints require the user to be authenticated, only owners can create, modify and delete bookmarks.

Relates to: #640
Fixes: #634

Originally created by @fmartingr on GitHub (Jul 21, 2023). Original GitHub issue: https://github.com/go-shiori/shiori/issues/659 Originally assigned to: @fmartingr on GitHub. Migrate the legacy bookmarks API to the new router and API specification ## Acceptance criteria - `/api/v1/bookmarks`: `GET` for list, `POST` for creation. - Bookmark creation should allow all current features (create archive/readable) plus ebook creation. But all these fields should be put inside another (`_creation_options`?) instead of mixed with the object attributes. - `/api/v1/bookmarks/:id`: `PUT/PATCH` for modification, `GET` for retrieving information, `DELETE` for deletion. - `/api/v1/bookmarks/:id/cache`: `POST` call that allows a single bookmark cache regeneration (re-download archive, rebuild ebook, ...). - Fix #634 - `/api/v1/bookmarks/cache`: `POST` call that allows multiple bookmarks cache regeneration (re-download archive, rebuild ebook, ...). - Logic should be moved to [domains](https://github.com/go-shiori/shiori/tree/master/internal/domains) - All endpoints should be properly tested. - All endpoints should use swagger definitions. - All endpoints require the user to be authenticated, only owners can create, modify and delete bookmarks. Relates to: #640 Fixes: #634
Author
Owner

@Monirzadeh commented on GitHub (Jan 21, 2024):

Hi.
I don't know how you want to impeliment API for adding bookmark but if it possible please return something that we can distinguish between internal error and bookmark exist.
Currently shiori return status 500 if bookmark exist.

<!-- gh-comment-id:1902618208 --> @Monirzadeh commented on GitHub (Jan 21, 2024): Hi. I don't know how you want to impeliment API for adding bookmark but if it possible please return something that we can distinguish between internal error and bookmark exist. Currently shiori return status 500 if bookmark exist.
Author
Owner

@fmartingr commented on GitHub (Jan 21, 2024):

Hi. I don't know how you want to impeliment API for adding bookmark but if it possible please return something that we can distinguish between internal error and bookmark exist. Currently shiori return status 500 if bookmark exist.

Yeah, on successful creation the response would be 201 and on duplicated 409.

<!-- gh-comment-id:1902673449 --> @fmartingr commented on GitHub (Jan 21, 2024): > Hi. I don't know how you want to impeliment API for adding bookmark but if it possible please return something that we can distinguish between internal error and bookmark exist. Currently shiori return status 500 if bookmark exist. Yeah, on successful creation the response would be `201` and on duplicated `409`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#331
No description provided.