irobust

Sample API Blueprint

Aug 26th, 2021 (edited)
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. FORMAT: 1A
  2. HOST: https://localhost:3000/api/v1
  3.  
  4. # Demo06
  5.  
  6. Polls is a simple API allowing consumers to view polls and vote in them.
  7.  
  8. ## Order Collection [/order]
  9.  
  10. ### List All Orders [GET]
  11. + Request (application/json)
  12.  
  13. + Headers
  14.  
  15. accepted: application/json
  16.  
  17. + Body
  18.  
  19. + Response 200 (application/json)
  20.  
  21. [
  22. {
  23. "customer": "John Doe",
  24. "ordered_date": "2015-08-05T08:40:51.620Z",
  25. "items": [
  26. {
  27. "product": "Product A",
  28. "qty": 1
  29. }, {
  30. "product": "Product B",
  31. "qty": 10
  32. }, {
  33. "product": "Product C",
  34. "qty": 5
  35. }, {
  36. "product": "Product D",
  37. "qty": 100
  38. }
  39. ]
  40. }
  41. ]
  42.  
  43. ### Create a New Question [POST]
  44.  
  45. You may create your own question using this action. It takes a JSON
  46. object containing a question and a collection of answers in the
  47. form of choices.
  48.  
  49. + Request (application/json)
  50.  
  51. {
  52. "product": "Product D",
  53. "qty": 5
  54. }
  55.  
  56. + Response 201 (application/json)
  57.  
  58. + Headers
  59.  
  60. Location: /order/2
  61.  
  62. + Body
  63.  
  64. {
  65. "customer": "John Doe",
  66. "ordered_date": "2015-08-05T08:40:51.620Z",
  67. "items": [
  68. {
  69. "product": "Product A",
  70. "qty": 1
  71. }, {
  72. "product": "Product B",
  73. "qty": 10
  74. }, {
  75. "product": "Product C",
  76. "qty": 5
  77. }, {
  78. "product": "Product D",
  79. "qty": 100
  80. }
  81. ]
  82. }
  83.  
Add Comment
Please, Sign In to add comment