Guest User

Untitled

a guest
Jan 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. **Title**
  2. ----
  3. <_Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple)._>
  4.  
  5. * **URL**
  6.  
  7. <_The URL Structure (path only, no root url)_>
  8.  
  9. * **Method:**
  10.  
  11. <_The request type_>
  12.  
  13. `GET` | `POST` | `DELETE` | `PUT`
  14.  
  15. * **URL Params**
  16.  
  17. <_If URL params exist, specify them in accordance with name mentioned in URL section. Separate into optional and required. Document data constraints._>
  18.  
  19. **Required:**
  20.  
  21. `id=[integer]`
  22.  
  23. **Optional:**
  24.  
  25. `photo_id=[alphanumeric]`
  26.  
  27. * **Data Params**
  28.  
  29. <_If making a post request, what should the body payload look like? URL Params rules apply here too._>
  30.  
  31. * **Success Response:**
  32.  
  33. <_What should the status code be on success and is there any returned data? This is useful when people need to to know what their callbacks should expect!_>
  34.  
  35. * **Code:** 200 <br />
  36. **Content:** `{ id : 12 }`
  37.  
  38. * **Error Response:**
  39.  
  40. <_Most endpoints will have many ways they can fail. From unauthorized access, to wrongful parameters etc. All of those should be liste d here. It might seem repetitive, but it helps prevent assumptions from being made where they should be._>
  41.  
  42. * **Code:** 401 UNAUTHORIZED <br />
  43. **Content:** `{ error : "Log in" }`
  44.  
  45. OR
  46.  
  47. * **Code:** 422 UNPROCESSABLE ENTRY <br />
  48. **Content:** `{ error : "Email Invalid" }`
  49.  
  50. * **Sample Call:**
  51.  
  52. <_Just a sample call to your endpoint in a runnable format ($.ajax call or a curl request) - this makes life easier and more predictable._>
  53.  
  54. * **Notes:**
  55.  
  56. <_This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here._>
Add Comment
Please, Sign In to add comment