-
Notifications
You must be signed in to change notification settings - Fork 1
API 문서 ver.3
Poogle edited this page Jun 4, 2020
·
12 revisions
로그인 버튼에 연결할 url: https://github.com/login/oauth/authorize?client_id={슬랙으로 전달}&scope=user%20public_repo
- client Id는 따로 전달합니다.
- (1) 도시 리스트 조회
- (2) 해당 도시 스크롤 간략 정보 10개 제공
- (3) 가격 필터링 탭, 평균값
- (4) 숙소 필터링 후 간략 정보 제공, 필터 조건: 날짜, 인원, 가격
- (5) 즐겨찾기 등록 요청
- (6) 즐겨찾기 해제 요청
- (7) 즐겨찾기 목록
- (8) 방 상세 정보 페이지
- (9) 예약하기
- (10) 예약 취소하기
- (11) 예약 조회하기
- (12) 구글 map api
- (13) 지도 확대, 축소 시
- {url} : 52.6.242.151:8080
- Github Login - OAuth
- 로그인 완료 후 도시 선택 화면
- 도시 선택 후 해당 도시 (10) 간략정보 요청 (메인 화면)
- 스크롤 내릴 때마다 (10) 데이터 더 요청
- 날짜. 인원 필터링 탭 완료 버튼 누를 때의 조건으로 필터링된 정보 제공
- 가격 탭 클릭 시 필터링된 숙소 리스트의 평균 가격을 제공
- 하트 클릭 시 Patch 요청으로 해당 유저의 즐겨찾기 숙소 등록/해제
- 즐겨찾기 탭 클릭 시 해당 유저의 즐겨 찾기 숙소 목록 반환
- 숙소 클릭 시 상세 정보 제공
- 숙소 상세 화면에서 예약하기
- 예약 탭에서 예약한 숙소 정보 확인
- 예약 탭에서 예약 취소 요청하기
- 지도 제공
도시 별 숙소 개수
- 1: 290
- 2: 287
- 3: 252
- 4: 281
- 5: 284
- 6: 300
- 7: 251
- 8: 282
- 9: 342
- 10: 328
- 11: 210
- 12: 314
총: 3421
숙소 최저, 최고 가격
- 최저: 9230원 (room_id: 2734, 유일한 10000원 이하 숙소)
- 최고: 9227830원 (room_id: 2372)
필터링을 하지 않을 때 필터의 기본 값들
- guests: 1
- minPrice: 0
- maxPrice: 9227830
- checkIn: 1900-01-01
- checkOut: 2021-12-31
이름 | 설명 |
---|---|
offset | 시작하는 레코드 몇 번째인지 |
limit | 몇 개의 레코드인지 |
- path variable, request parameter 제외 response 변수 명은 단어 구분 시 '_' 추가
- 변수명 오류 있으면 알려주세요!
- 모든 Request Header에 발급한 토큰 넣어서 요청
number | method | url | 설명 | 참고 |
---|---|---|---|---|
1 | GET | /cities | 도시 리스트 조회 | |
2 | GET | /cities/{cityId}/rooms?limit=10&offset=0?checkIn=2020-05-09&checkOut=2020-05-18&guests=1&minPrice=10000&maxPrice=100000 | 숙소 필터링 후 간략 정보 제공, default 10개 제공 | 숙소 정보 10개씩 0번부터 (0, 10, 20, ... ) 도시 별 약 300개 숙소 |
3 | GET | /cities/{cityId}/prices?checkIn=2020-05-09&checkOut=2020-05-18&guests=1 | 가격 필터링 탭 평균값 | 날짜, 인원 수 선택적으로 요청 |
5 | POST | /bookmarks/{roomId} | 즐겨찾기 등록 요청 | |
6 | DELETE | /bookmarks/{roomId} | 즐겨찾기 해제 요청 | |
7 | GET | /bookmarks | 즐겨찾기 목록 | |
8 | GET | /cities/{cityId}/rooms/{roomId} | 방 상세 정보 페이지 | |
9 | POST | /reservation | 예약하기 | 날짜와 인원 정보 담아서 요청(필수) |
10 | DELETE | /reservation?reservationId=22 | 예약 취소하기 | |
11 | GET | /reservation | 예약 조회하기 | |
12 | GET | /cities/{cityId}/rooms?check_in=2020-06-16&check_out=2020-06-18&guests=1&price_min=149468&price_max=214854/map | 구글 map api (실제 airbnb서비스: 날짜가 필터링 되어있을 경우 search_by_map=true라는 request parameter 받음) | |
13 | GET | 지도 확대, 축소 시 |
- 로그인 버튼에 연결할 url: https://github.com/login/oauth/authorize?client_id={슬랙으로 전달}&scope=user%20public_repo
- client id는 슬랙으로 따로 전달합니다.
- token 뒤에 나오는 값이 로그인한 해당 유저의 jwt 토큰입니다.
- 모든 요청 시 jwt 토큰을 헤더에 담아서 보내주세요.
GET {url}/cities
- Response
{
"status_code": 200,
"data": [
{
"city_id": 1,
"city_name": "Asheville"
},
{
"city_id": 2,
"city_name": "Austin"
},
...생략
]
}
GET {url}/cities/{cityId}/prices?check_in=2020-06-16&check_out=2020-06-18&guests=1
- 가격 필터링 탭 평균값
- 날짜, 인원 수 선택적으로 요청
{
"status_code": 200,
"data": {
"average": 132976.97,
"sale_prices": [
40910,
40910,
41840,
46140,
46760,
47190,
47990,
49840,
50200,
...
626510,
729070,
1753460
],
"count_list": [
0,
0,
25,
47,
41,
31,
14,
...
0,
1
]
}
}
- average: 평균가
- sale_price: 해당 가격 전체 리스트 오름차순
- count_list: 50개 구간 별 가격에 해당하는 숙소의 개수
- 2번, 4번, 7번 api 요청에 같은 형식의 response가 갈 것
- 7번 api의 경우 favorite 항목이 무조건 true
- 로그인 한 유저의 정보가 필요(즐겨찾기 표시 여부)
- GET {url}/cities/{cityId}?offset=1&limit=10 여기는 path variable에 rooms가 없습니다!!!
- GET {url}/cities/{cityId}/rooms?checkIn=2020-05-09&checkOut=2020-05-18&guests=1&minPrice=10000&maxPrice=100000
- GET {url}/bookmarks
{
"status_code": 200,
"data": [
{
"room_id": 1,
"room_name": "French Chic Loft",
"room_thumbnail": "https://a0.muscache.com/im/pictures/29807425/62a6b073_original.jpg?aki_policy=large",
"is_super_host": true,
"room_type": "Private room",
"beds": 2,
"scores": 4.33,
"reviews": 138,
"favorite": false
},
{
"room_id": 2,
"room_name": "Charming Victorian home - twin beds + breakfast",
"room_thumbnail": "https://a0.muscache.com/im/pictures/29807425/62a6b073_original.jpg?aki_policy=large",
"is_super_host": true,
"room_type": "Private room",
"beds": 2,
"scores": 4.33,
"reviews": 138,
"favorite": false
},
{
"room_id": 3,
"room_name": "French Chic Loft",
"room_thumbnail": "https://a0.muscache.com/im/pictures/29807425/62a6b073_original.jpg?aki_policy=large",
"is_super_host": true,
"room_type": "Private room",
"beds": 2,
"scores": 4.33,
"reviews": 138,
"favorite": false
},
...생략
{
"room_id": 10,
"room_name": "Charming Victorian home - twin beds + breakfast",
"room_thumbnail": "https://a0.muscache.com/im/pictures/29807425/62a6b073_original.jpg?aki_policy=large",
"is_super_host": true,
"room_type": "Private room",
"beds": 2,
"scores": 4.33,
"reviews": 138,
"favorite": false
}
]
}
POST {url}/bookmarks/{roomId}
{
"status_code": 200,
}
DELETE {url}/bookmarks?reservationId=22
{
"status_code": 200,
}
GET {url}/cities/{cityId}/rooms/{roomId}
{
"status_code": 200,
"data":
{
"room_id": 1,
"room_name": "French Chic Loft",
"address": "Asheville, NC, United States",
"room_thumbnail": "https://a0.muscache.com/im/pictures/29807425/62a6b073_original.jpg?aki_policy=large",
"image_lists": [
"https://a0.muscache.com/im/pictures/29807425/62a6b073_original.jpg?aki_policy=large",
"https://a0.muscache.com/im/pictures/29807425/62a6b073_original.jpg?aki_policy=large",
"https://a0.muscache.com/im/pictures/29807425/62a6b073_original.jpg?aki_policy=large",
"https://a0.muscache.com/im/pictures/29807425/62a6b073_original.jpg?aki_policy=large"
]
"is_super_host": true,
"host_name": "Evelyne"
"host_thumbnail": "https://a0.muscache.com/im/users/165529/profile_pic/1313449545/original.jpg?aki_policy=profile_small"
"room_type": "Private room",
"beds": 2,
"original_price": 61530,
"sale_price": 55370,
"scores": 4.33,
"reviews": 138,
"amenities": "Internet,Wifi,"Air conditioning",Kitchen,"Free parking on premises",Breakfast,"Pets live on this property",Cat(s),"Indoor fireplace",Heating,Washer,Dryer,"Smoke detector","Carbon monoxide detector","First aid kit","Fire extinguisher",Essentials,Shampoo,Hangers,"Hair dryer",Iron,"translation missing: en.hosting_amenity_49","translation missing: en.hosting_amenity_50","Hot water","Bed linens","Extra pillows and blankets","Patio or balcony","Garden or backyard","Host greets you"",
"cleaning_fee": 18460,
"maximum_guests": 5,
"favorite": false
}
}
POST {url}/reservation
- Request Body에 날짜(체크인, 체크아웃), 인원 수 정보를 필수로 요청을 보냄
Request Body
{
"roomId" : 1,
"checkIn" : 2020-06-11,
"checkOut": 2020-06-13,
"guests": 3
}
Response
{
"status_code": 200,
}
DELETE {url}/reservation?reservationId=1
{
"status_code": 200,
}
GET {url}/reservation
{
"status_code": 200,
"data":
{
"room_id": 1,
"room_name": "French Chic Loft",
"room_type": "Private room",
"original_price": 61530,
"sale_price": 55370,
"scores": 4.33,
"reviews": 138,
"check_in": "2020-03-29",
"check_out": "2020-03-31",
"guests": 1,
"nights": 2,
"cleaning_fee": 18460,
"tax": 3080,
"total_fee": 132280
}
}