Skip to content

Latest commit

 

History

History
357 lines (325 loc) · 9.44 KB

api.md

File metadata and controls

357 lines (325 loc) · 9.44 KB

API and Routes

Based on http status code and rest.

Basic Routes

  • /user/authentication
  • /user/registration
  • /media/artist
  • /media/distributor
  • /media/edition
  • /media/platform
  • /media/genre
  • /media/language
  • /media/search
  • /media/title
  • /media/type
  • /media/audio
  • /media/book
  • /media/comment
  • /media/game
  • /media/video

authentication

  • GET - login, password
    • log in
    • returns 200 and token on success
    • returns 401 on failure
  • POST - login, password
    • create new log in
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - login, password
    • update password
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - login, password
    • delete log in
    • returns 200 on success
    • returns 400/401/403/404 on failure

user

  • GET - id
    • returns 200 and
      • first name
      • email
    • returns 401 on failure
  • POST - first name, , email
    • create new user
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - id, first name, , email
    • update user
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - id
    • delete user
    • returns 200 on success
    • returns 400/401/403/404 on failure

media

artist

  • GET - id
    • returns 200 and name
    • returns 401 on failure
  • POST - name
    • create new artist
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - id, name
    • update artist
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - id
    • delete artist
    • returns 200 on success
    • returns 400/401/403/404 on failure

distributor

  • GET - id
    • returns 200 and name
    • returns 401 on failure
  • POST - name
    • create new distributor
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - id, name
    • update distributor
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - id
    • delete distributor
    • returns 200 on success
    • returns 400/401/403/404 on failure

edition

  • GET - id
    • returns 200 and name
    • returns 401 on failure
  • POST - name
    • create new edition
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - id, name
    • update edition
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - id
    • delete edition
    • returns 200 on success
    • returns 400/401/403/404 on failure

platform

  • GET - id
    • returns 200 and name
    • returns 401 on failure
  • POST - name
    • create new platform
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - id, name
    • update platform
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - id
    • delete platform
    • returns 200 on success
    • returns 400/401/403/404 on failure

genre

  • GET - id
    • returns 200 and name
    • returns 401 on failure
  • POST - name
    • create new genre
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - id, name
    • update genre
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - id
    • delete genre
    • returns 200 on success
    • returns 400/401/403/404 on failure

language

  • GET - id
    • returns 200 and name
    • returns 401 on failure
  • POST - name
    • create new language
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - id, name
    • update language
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - id
    • delete language
    • returns 200 on success
    • returns 400/401/403/404 on failure

type

  • GET - id
    • returns 200 and name
    • returns 401 on failure
  • POST - name
    • create new type
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - id, name
    • update type
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - id
    • delete type
    • returns 200 on success
    • returns 400/401/403/404 on failure

audio

  • GET - id
    • returns 200 and
      • name
      • distributor
        • name
        • id
      • edition
        • name
        • id
      • type name
        • name
        • id [ * user id
        • first name
        • last name
        • id ]
      • age limit
      • number of discs
      • created at
      • released at
      • collection of audio track
        • track
          • id
          • name
          • artist
            • name
            • id
          • number of play
          • number of disc
          • duration
          • distributor
            • name
            • id
          • edition
            • name
            • id
          • type name
            • name
            • id [ * user id
            • first name
            • last name
            • id ]
    • returns 401 on failure
  • POST - * name * distributor * name * id * edition * name * id * type name * name * id [ * user id * first name * last name * id ] * age limit * number of discs * created at * released at * collection of audio track * track * id * name * artist * name * id * number of play * number of disc * duration * distributor * name * id * edition * name * id * type name * name * id [ * user id * first name * last name * id ]
    • create audio
    • returns 201 on success
    • returns 400/403 on failure
  • PUT - * id * distributor * name * id * edition * name * id * type name * name * id [ * user id * first name * last name * id ] * age limit * number of discs * created at * released at * collection of audio track * track * id * name * artist * name * id * number of play * number of disc * duration * distributor * name * id * edition * name * id * type name * name * id [ * user id * first name * last name * id ]
    • update audio
    • returns 200 on success
    • returns 400/401/403 on failure
  • DELETE - id
    • delete audio
    • returns 200 on success
    • returns 400/401/403/404 on failure

audio track

book

video

game

comment

thoughts

  • for first revision, any media only available below user since they are coupled to the user?
    • /user
    • /user/
    • /user//media
    • /user//media/
    • /user//media/audio
    • /user//media/audio/
    • /user//media