Books Instance
A viewset for handling CRUD operations on Book objects. It provides custom
actions for managing book statuses like badges, flags, love reactions, and
saved states. The viewset allows filtering, searching, and retrieving book
data with enhanced context based on user interactions and permissions.
Standard HTTP methods:
- GET: Retrieve book data.
- HEAD: Retrieve HTTP headers only.
- POST: Create new book entries
(currently returns "Method Not Allowed").
- DELETE: Remove book entries (currently returns "Method Not Allowed").
Custom actions include:
- badge: Retrieve the badge information of a book.
- chapters_info: Get chapter details for specified indexes.
- flag: Flag a book or specific line with a reason.
- unflag: Remove flags from a book or specific line.
- flagged: Check if a book or line is flagged.
- myshelf: Add a book to the user's "My shelf" collection.
- delete_from_myshelf: Remove a book from the user's "My shelf".
- loved: Check if a book is loved by the user.
- saved_to_myshelf: Check if a book is saved to the user's shelf.
- saved_to_class: Check if a book is part of a class group.
- book_summary: Retrieve comprehensive book information,
including all status flags.
The queryset is filtered based on user permissions, and several helper
methods are provided to manage book interactions.
GET /api/books/23170/?format=api
{ "id": 23170, "author_names": [], "publisher_name": "Yen Press", "publisher": { "id": 230, "name": "Yen Press", "summary": "", "profile_img_url": "https://storage.googleapis.com/lit-pro-api-public-blobs/users/images/6708bc176a3d84a5a1ad78fcf9955f66.jpg", "cover_img_url": "https://storage.googleapis.com/lit-dev-my-test-bucket/cover_imgs/Literal/cover_img.jpg", "cover_img_mini_url": "https://storage.googleapis.com/lit-dev-my-test-bucket/cover_imgs/Literal/cover_img_mini.jpg", "page_requests_this_month": 0, "page_requests_all_time": 0, "pr_history": [ 0, 0, 0, 0, 0 ], "pr_history_url": "", "active": true, "provider": "comics-plus", "identifier": "247" }, "love_count": 0, "categories": [ { "name": "Gaming", "url": "lp-gaming", "id": 86 }, { "name": "High School", "url": "high-school", "id": 175 }, { "name": "Sci-Fi", "url": "lp-sci-fi", "id": 122 }, { "name": "Movie & TV", "url": "lp-movie-tv", "id": 107 }, { "name": "Manga / Manhwa", "url": "lp-manga", "id": 102 } ], "rental_price": 0, "approvalstatus": 100, "url": "sword-art-online-progressive-scherzo-of-deep-night-vol-2-manga", "title": "Sword Art Online Progressive Scherzo of Deep Night, Vol. 2 (manga)", "subtitle": "", "author": "", "image_cover": "https://cdpmm-public.librarypass.com/store/cover/large/18A748A6F0F.png", "image_cover_landscape": "https://storage.googleapis.com/lit-dev-my-test-bucket/default-img.jpg", "image_title_treatment": "", "image_hero_background": "", "image_hero_background_mobile": "", "image_hero_background_tablet": "", "is_featured": false, "is_premium_featured": false, "date_set_live": null, "summary": "The boss of the fifth floor of Sword Art Online will drop the Flag of Valor, a dangerously powerful item set to tip the delicate balance between the guilds! Hoping to preserve parity between the two mightiest guilds, Kirito organizes an impromptu raid to be the first to defeat the boss and seize the flag before it falls into the wrong hands... ", "free_preview": true, "free_book": false, "pricing_level": 80, "is_private": false, "line_count": 0, "word_count": 0, "rating": 0.0, "num_of_ratings": 0, "isbn": "", "grade_level_low": 9, "grade_level_high": 12, "lexile_level_letters": "", "lexile_level_low": 0, "lexile_level_high": 0, "published_date": 2023, "volumes": 0, "chapters": 0, "raw_content_url": "", "page_requests_this_month": 0, "page_requests_all_time": 0, "pr_history": [ 0, 0 ], "sort_order": 1, "is_anthology_cover": false, "last_modified": "2026-03-30T07:28:43.095230Z", "provider": "comics-plus", "identifier": "9781975361129", "language": "English", "content_rating": "Young Adult", "book_type": null, "literary_form": null, "allow_rent": false, "allow_purchase": false, "rental_tier": null, "content_type": "text", "meta_data": {}, "authors": [], "addons": [ 3 ] }