Advertisement
Guest User

APIARY

a guest
Mar 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. FORMAT: 1A
  2. HOST: https://reqres.in/api
  3.  
  4. # REST API - Prenos Dรกt
  5.  
  6. Polls is a simple API allowing consumers to view polls and vote in them.
  7.  
  8. ## GET [/users?page={id}]
  9.  
  10. ### LIST USERS [GET]
  11. + Parameters
  12. + id (optional, number, `2`) ... Page ID
  13. + Response 200 (application/json)
  14.  
  15. {
  16. "page": 2,
  17. "per_page": 3,
  18. "total": 12,
  19. "total_pages": 4,
  20. "data": [
  21. {
  22. "id": 4,
  23. "first_name": "Eve",
  24. "last_name": "Holt",
  25. "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/marcoramires/128.jpg"
  26. },
  27. {
  28. "id": 5,
  29. "first_name": "Charles",
  30. "last_name": "Morris",
  31. "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/stephenmoon/128.jpg"
  32. },
  33. {
  34. "id": 6,
  35. "first_name": "Tracey",
  36. "last_name": "Ramos",
  37. "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/bigmancho/128.jpg"
  38. }
  39.  
  40.  
  41. ## GET [/users/{id}]
  42.  
  43. ### SINGLE USER [GET]
  44. + Parameters
  45. + id (required, number, `2`) ... Page ID
  46. + Response 200 (application/json)
  47.  
  48. {
  49. "data": {
  50. "id": 2,
  51. "first_name": "Janet",
  52. "last_name": "Weaver",
  53. "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/josephstein/128.jpg"
  54. }
  55. }
  56.  
  57. ## GET [/users/23]
  58.  
  59. ### SINGLE USER NOT FOUND [GET]
  60.  
  61. + Response 404 (application/json)
  62.  
  63. {
  64. }
  65.  
  66. ## GET [/{unknown}]
  67.  
  68. ### LIST <RESOURCE> [GET]
  69. + Parameters
  70. + unknown (optional, string, `unknown`)
  71.  
  72. + Response 200 (application/json)
  73.  
  74. {
  75. "page": 1,
  76. "per_page": 3,
  77. "total": 12,
  78. "total_pages": 4,
  79. "data": [
  80. {
  81. "id": 1,
  82. "name": "cerulean",
  83. "year": 2000,
  84. "color": "#98B2D1",
  85. "pantone_value": "15-4020"
  86. },
  87. {
  88. "id": 2,
  89. "name": "fuchsia rose",
  90. "year": 2001,
  91. "color": "#C74375",
  92. "pantone_value": "17-2031"
  93. },
  94. {
  95. "id": 3,
  96. "name": "true red",
  97. "year": 2002,
  98. "color": "#BF1932",
  99. "pantone_value": "19-1664"
  100. }
  101. ]
  102. }
  103.  
  104. ## GET [/{unknown}/{id}]
  105.  
  106. ### SINGLE <RESOURCE> [GET]
  107. + Parameters
  108. + unknown (required, string, `unknown`)
  109. + id (required, number, `2`)
  110.  
  111. + Response 200 (application/json)
  112.  
  113. {
  114. "data": {
  115. "id": 2,
  116. "name": "fuchsia rose",
  117. "year": 2001,
  118. "color": "#C74375",
  119. "pantone_value": "17-2031"
  120. }
  121. }
  122.  
  123. ## GET [/{unknown}/23]
  124.  
  125. ### SINGLE <RESOURCE> NOT FOUND [GET]
  126. + Parameters
  127. + unknown (required, string, `unknown`)
  128.  
  129. + Response 404 (application/json)
  130.  
  131. {
  132. }
  133.  
  134. ## POST [/users]
  135.  
  136. ### CREATE [POST]
  137.  
  138. + Request (application/json)
  139.  
  140. {
  141. "name": "morpheus",
  142. "job": "leader"
  143. }
  144.  
  145. + Response 201 (application/json)
  146.  
  147. + Body
  148.  
  149. {
  150. "name": "morpheus",
  151. "job": "leader",
  152. "id": "226",
  153. "createdAt": "2018-03-21T13:38:44.772Z"
  154. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement