API Routes - ARGON90/BadReads Wiki

Users

  • Get current user information.
    • GET /api/session
  • A new or logged out user may sign up, log in, and log out.
    • Sign-up: POST /api/users
    • Log-in: POST /api/session
    • Log-out: DELETE /api/session

Books

  • Get all books, user books, and book details.
    • All: GET /api/books
    • User: GET /api/books
    • One: GET /api/books/:book_id
  • A logged in user may create, update, and delete a book.
    • Create: POST /api/books
    • Update: PUT /api/books/:book_id
    • Delete: DELETE /api/books/:book_id

Bookshelves

  • Get user bookshelves.
    • GET /api/bookshelves
  • A logged in user may create, update, and delete a custom bookshelf.
    • Create: POST /api/bookshelves
    • Update: PUT /api/bookshelves/:bookshelves_id
    • Delete: DELETE /api/bookshelves/:bookshelves_id *A logged in user my edit which books are in their bookshelves.
    • PUT /api/bookshelves/library *When a user signs in, default bookshelves are generated for them
    • POST /api/bookshelves/default

Reviews

  • Get all reviews that belong to a specific book.
    • GET /api/reviews
  • A logged in user may create and delete a Review.
    • Create: POST /api/reviews/:book_id
    • Delete: DELETE /api/reviews/:book_id
    • Edit: EDIT /api/reviews/:book_id/:review_id