Skip to content

Instantly share code, notes, and snippets.

@benmangold
Last active November 13, 2018 21:48
Show Gist options
  • Save benmangold/0ebfaa88487189da02dc37b75ccc61fc to your computer and use it in GitHub Desktop.
Save benmangold/0ebfaa88487189da02dc37b75ccc61fc to your computer and use it in GitHub Desktop.
FangNYC - Booking
FangNYC - Booking Endpoints
by Ben Mangold
Key
-------------------------------------
REQUEST /endpoint/:argument
{
body:json
}
{
response: json
}
-------------------------------------
GET /api/listing/:id
{
"dates": [
"9/12/2011",
"8/11/2016",
"3/19/2011",
"3/4/2019"
],
"price": 596,
"id": 21,
"minStay": 0,
"stars": 2,
"numRatings": 65,
"max": 13
}
-------------------------------------
POST /api/listing
{
price: "10",
minStay: "1",
stars: "5",
numRatings: "1",
max: "5"
}
{
"fieldCount": 0,
"affectedRows": 1,
"insertId": 10026856,
"serverStatus": 2,
"warningCount": 0,
"message": "",
"protocol41": true,
"changedRows": 0
}
-------------------------------------
DELETE /api/listing/:id
{
"fieldCount": 0,
"affectedRows": 1,
"insertId": 0,
"serverStatus": 2,
"warningCount": 0,
"message": "",
"protocol41": true,
"changedRows": 0
}
-------------------------------------
GET /api/listings
[
{
"id": 6,
"price": 596,
"max": 13,
"minStay": 0,
"stars": 2,
"numRatings": 65
},
{
"id": 7,
"price": 400,
"max": 7,
"minStay": 2,
"stars": 3,
"numRatings": 76
}
]
-------------------------------------
GET /api/dates
[{"id":1,"date":"11/27/2015","apartment_id":968},
{"id":2,"date":"9/14/2010","apartment_id":596},
{"id":3,"date":"7/12/2011","apartment_id":566}
]
-------------------------------------
POST /api/date
-------------------------------------
GET /api/nothingThere
Not Found
-------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment