Advertisement
SNiPeRzCiinema

Assignment 1 - REST API design

Sep 21st, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.36 KB | None | 0 0
  1. /login?user&pass
  2. /artist /:name,:id /song /:name,:id /review /:id
  3.  
  4. C - POST
  5. R - GET
  6. U - PUT
  7. D - DELETE
  8.  
  9. ---------------------------------------------------------
  10.  
  11.                 /login
  12.                
  13. POST:
  14.     Purpose:
  15.         - Not valid API call
  16.     Responses:
  17.         - 501       Invalid API call
  18. GET:
  19.     Purpose:
  20.         - Validate login credentials
  21.     Paramaters:
  22.         - user
  23.         - pass
  24.     Responses:
  25.         - 202       Valid Information                            Token
  26.         - 502       Invalid Information
  27.         - 503       Something has occured, try again later
  28. PUT:
  29.     Purpose:
  30.         - Not valid API call
  31.     Responses:
  32.         - 501       Invalid API call
  33. DELETE:
  34.     Purpose:
  35.         - Not valid API call
  36.     Responses:
  37.         - 501       Invalid API call
  38.  
  39. ---------------------------------------------------------
  40.  
  41.                 /artist
  42.                
  43. POST:
  44.     Purpose:
  45.         - Create new artist
  46.     Requirements:
  47.         - Valid token
  48.     Responses:
  49.         - 201       Created Artist
  50.         - 401       Invalid authorization
  51.         - 503       Something has occured, try again later
  52. GET:
  53.     Purpose:
  54.         - Get a list of all artists
  55.     Requirements:
  56.         - Valid token
  57.     Responses:
  58.         - 200       Got list of all artists                     listOfArtists
  59.         - 401       Invalid authorization
  60.         - 503       Something has occured, try again later
  61. PUT:
  62.     Purpose:
  63.         - Not valid API call
  64.     Responses:
  65.         - 501       Invalid API call
  66. DELETE:
  67.     Purpose:
  68.         - Remove all artists owner by user
  69.     Requirements:
  70.         - Valid token
  71.     Responses:
  72.         - 202       Removed all artists owner by user
  73.         - 401       Invalid authorization
  74.         - 503       Something has occured, try again later
  75.  
  76. ---------------------------------------------------------
  77.  
  78.                 /artist/:id,:name
  79.                
  80. POST:
  81.     Purpose:
  82.         - Not valid API call
  83.     Responses:
  84.         - 501       Invalid API call
  85. GET:
  86.     Purpose:
  87.         - Get details of given artist
  88.     Requirements:
  89.         - Valid token
  90.     Responses:
  91.         - 200       Got info of artist                      artistInfo
  92.         - 401       Invalid authorization
  93.         - 503       Something has occured, try again later
  94. PUT:
  95.     Purpose:
  96.         - Update an artist
  97.     Requirements:
  98.         - Valid token
  99.     Responses:
  100.         - 202       Updated artist
  101.         - 401       Invalid authorization
  102.         - 503       Something has occured, try again later
  103. DELETE:
  104.     Purpose:
  105.         - Remove an artist
  106.     Requirements:
  107.         - Valid token
  108.     Responses:
  109.         - 202       Removed artist
  110.         - 401       Invalid authorization
  111.         - 503       Something has occured, try again later
  112.        
  113. ---------------------------------------------------------
  114.  
  115.                 /artist/:id,:name/song
  116.                
  117. POST:
  118.     Purpose:
  119.         - Create new song
  120.     Requirements:
  121.         - Valid token
  122.     Responses:
  123.         - 201       Created Song
  124.         - 401       Invalid authorization
  125.         - 503       Something has occured, try again later
  126. GET:
  127.     Purpose:
  128.         - Get a list of all songs
  129.     Requirements:
  130.         - Valid token
  131.     Responses:
  132.         - 200       Got list of all songs                       listOfAllSongs
  133.         - 401       Invalid authorization
  134.         - 503       Something has occured, try again later
  135. PUT:
  136.     Purpose:
  137.         - Not valid API call
  138.     Responses:
  139.         - 501       Invalid API call
  140. DELETE:
  141.     Purpose:
  142.         - Remove all songs by artist
  143.     Requirements:
  144.         - Valid token
  145.     Responses:
  146.         - 202       Removed all songs by artist
  147.         - 401       Invalid authorization
  148.         - 503       Something has occured, try again later
  149.  
  150. ---------------------------------------------------------
  151.  
  152.                 /artist/:id,:name/song/:id,:name
  153.                
  154. POST:
  155.     Purpose:
  156.         - Not valid API call
  157.     Responses:
  158.         - 501       Invalid API call
  159. GET:
  160.     Purpose:
  161.         - Get details of given song
  162.     Requirements:
  163.         - Valid token
  164.     Responses:
  165.         - 200       Got info of song                        songInfo
  166.         - 401       Invalid authorization
  167.         - 503       Something has occured, try again later
  168. PUT:
  169.     Purpose:
  170.         - Update a song
  171.     Requirements:
  172.         - Valid token
  173.     Responses:
  174.         - 202       Updated song
  175.         - 401       Invalid authorization
  176.         - 503       Something has occured, try again later
  177. DELETE:
  178.     Purpose:
  179.         - Remove a song
  180.     Requirements:
  181.         - Valid token
  182.     Responses:
  183.         - 202       Removed song
  184.         - 401       Invalid authorization
  185.         - 503       Something has occured, try again later
  186.        
  187. ---------------------------------------------------------
  188.  
  189.                 /artist/:id,:name/song/:id,:name/review
  190.                
  191. POST:
  192.     Purpose:
  193.         - Create new review
  194.     Requirements:
  195.         - Valid token
  196.     Responses:
  197.         - 201       Created review
  198.         - 401       Invalid authorization
  199.         - 503       Something has occured, try again later
  200. GET:
  201.     Purpose:
  202.         - Get a list of all reviews
  203.     Requirements:
  204.         - Valid token
  205.     Responses:
  206.         - 200       Got list of all reviews                     listOfAllReviews
  207.         - 401       Invalid authorization
  208.         - 503       Something has occured, try again later
  209. PUT:
  210.     Purpose:
  211.         - Not valid API call
  212.     Responses:
  213.         - 501       Invalid API call
  214. DELETE:
  215.     Purpose:
  216.         - Remove all reviews on song
  217.     Requirements:
  218.         - Valid token
  219.     Responses:
  220.         - 202       Removed all reviews on song
  221.         - 401       Invalid authorization
  222.         - 503       Something has occured, try again later
  223.        
  224. ---------------------------------------------------------
  225.  
  226.                 /artist/:id,:name/song/:id,:name/review/:id
  227.                
  228. POST:
  229.     Purpose:
  230.         - Not valid API call
  231.     Responses:
  232.         - 501       Invalid API call
  233. GET:
  234.     Purpose:
  235.         - Get details of given review
  236.     Requirements:
  237.         - Valid token
  238.     Responses:
  239.         - 200       Got info of review                      reviewInfo
  240.         - 401       Invalid authorization
  241.         - 503       Something has occured, try again later
  242. PUT:
  243.     Purpose:
  244.         - Update a review
  245.     Requirements:
  246.         - Valid token
  247.     Responses:
  248.         - 202       Updated review
  249.         - 401       Invalid authorization
  250.         - 503       Something has occured, try again later
  251. DELETE:
  252.     Purpose:
  253.         - Remove a review
  254.     Requirements:
  255.         - Valid token
  256.     Responses:
  257.         - 202       Removed review
  258.         - 401       Invalid authorization
  259.         - 503       Something has occured, try again later
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement