Skip to content

API Documentation

Denise edited this page Feb 8, 2022 · 12 revisions

API Documentation

API-Routes

This web app uses the following API routes to dynamically update the page.

Decks

  • An authenticated user may create a new deck and view all decks that they have created without causing a refresh/redirect.

    • GET /api/decks
    • POST /api/decks
  • An authenticated user may view, edit, and delete a specific deck that they have created by changing its title or description.

    • GET /api/decks/:deckId
    • PUT /api/decks/:deckId
    • DELETE /api/decks/:deckId

Cards

  • An authenticated user may create a new card in a deck that they have created. They can also view, edit, and delete a specific card that they have created without causing a refresh/redirect.
    • GET /api/cards/:cardId
    • POST /api/cards/:cardId
    • PUT /api/cards/:cardId
    • DELETE /api/cards/:cardId

Tags

  • An authenticated user may view all decks that have a specific tag.

    • READ /api/tags/:tagId
  • When viewing a specific deck, an authenticated user may view all tags associated with that specific deck.

    • READ /api/decks/:deckId/tags
  • An authenticated user may create new tags on a deck that they have created. They can also edit and delete tags on decks that they have created without causing a refresh/redirect.

    • POST /api/tags/
    • PUT /api/tags/:tagId
    • DELETE /api/tags/:tagId

Study List

  • An authenticated user may add or remove decks to their Study List without causing a refresh or redirect.
    • POST /api/user-study-decks/:deckId

Studying a Deck

  • When studying a card, an authenticated user may view a card, reveal its answer, and mark it as correct or incorrect without causing a refresh.
    • GET /api/user-study-card/:id
    • POST /api/user-study-card/:id

Bonus Routes

Deck Comments

  • An authenticated user may create a new comment on any deck without causing a refresh or redirect. They can also edit and delete any comments that they have created without causing a refresh or redirect. When a user creates, edits, or deletes a comment, the page will update dynamically.
    • POST /api/comments/:deckId
    • GET /api/comments/:deckId
    • PUT /api/comments/:commentId

Clone this wiki locally