Guest User

Untitled

a guest
Nov 13th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. FangNYC - Booking Endpoints
  2. by Ben Mangold
  3.  
  4. Key
  5. -------------------------------------
  6. REQUEST /endpoint/:argument
  7. {
  8. body:json
  9. }
  10. {
  11. response: json
  12. }
  13. -------------------------------------
  14. GET /api/listing/:id
  15. {
  16. "dates": [
  17. "9/12/2011",
  18. "8/11/2016",
  19. "3/19/2011",
  20. "3/4/2019"
  21. ],
  22. "price": 596,
  23. "id": 21,
  24. "minStay": 0,
  25. "stars": 2,
  26. "numRatings": 65,
  27. "max": 13
  28. }
  29. -------------------------------------
  30. POST /api/listing
  31. {
  32. price: "10",
  33. minStay: "1",
  34. stars: "5",
  35. numRatings: "1",
  36. max: "5"
  37. }
  38. {
  39. "fieldCount": 0,
  40. "affectedRows": 1,
  41. "insertId": 10026856,
  42. "serverStatus": 2,
  43. "warningCount": 0,
  44. "message": "",
  45. "protocol41": true,
  46. "changedRows": 0
  47. }
  48. -------------------------------------
  49. DELETE /api/listing/:id
  50. {
  51. "fieldCount": 0,
  52. "affectedRows": 1,
  53. "insertId": 0,
  54. "serverStatus": 2,
  55. "warningCount": 0,
  56. "message": "",
  57. "protocol41": true,
  58. "changedRows": 0
  59. }
  60. -------------------------------------
  61. GET /api/listings
  62. [
  63. {
  64. "id": 6,
  65. "price": 596,
  66. "max": 13,
  67. "minStay": 0,
  68. "stars": 2,
  69. "numRatings": 65
  70. },
  71. {
  72. "id": 7,
  73. "price": 400,
  74. "max": 7,
  75. "minStay": 2,
  76. "stars": 3,
  77. "numRatings": 76
  78. }
  79. ]
  80. -------------------------------------
  81. GET /api/dates
  82. [{"id":1,"date":"11/27/2015","apartment_id":968},
  83. {"id":2,"date":"9/14/2010","apartment_id":596},
  84. {"id":3,"date":"7/12/2011","apartment_id":566}
  85. ]
  86. -------------------------------------
  87. POST /api/date
  88. -------------------------------------
  89. GET /api/nothingThere
  90. Not Found
  91. -------------------------------------
Add Comment
Please, Sign In to add comment