Skip to content

API Documentation

Brian X edited this page Apr 26, 2021 · 5 revisions

API Routes


User


  • Sign up: Create a new account.

    • POST /api/users
  • Login: Lets a user login to an existing account.

    • POST /api/session
  • Logout: Let's a user logout of their account.

    • DELETE /api/session
  • Restore Session: Keeps user logged in to their account.

    • GET /api/session


Pictures


C.R.U.D Operations:

CREATE:

  • Lets user upload new image, add to their account
    • POST /api/pictures

READ:

  • Gets picture from db.
    • GET /api/pictures/:pictureid

Update:

  • A user can rename/change description of picture
    • PATCH /api/pictures/:pictureid

Delete:

  • A user can remove a picture from the db.
    • DELETE /api/pictures/:pictureid

Albums


C.R.U.D Operations:

CREATE:

  • Lets user create new album
    • POST /api/albums

READ:

  • Gets album from db.
    • GET /api/albums/:albumid

UPDATE:

  • A user can rename/change description of album, change what pictures are in album + order.
    • PATCH /api/albums/:albumid

DELETE:

  • A user can remove an album from their account.
    • DELETE /api/albums/:albumid

Comments


C.R.U.D Operations:

CREATE:

  • Lets user add a comment to a picture
    • POST /api/comments

READ:

  • Gets comments from db.
    • GET /api/comments/:commentid

Bonus: UPDATE:

  • A user can edit their own comment.
    • PATCH /api/comments/:commentid

Bonus: DELETE:

  • A user can remove a comment.
    • DELETE /api/comments/:commentid

Clone this wiki locally