[BE] API 목록 - Malloc72P/airbnb GitHub Wiki

0. test api url = http://ec2-13-124-172-161.ap-northeast-2.compute.amazonaws.com:8080

1. User API

1-1. 로그인(Github)

url /users/github/login
param type -
param example -
response -

2. 숙소 API

2-1. 숙소 목록조회

url /rooms
param type query string
  • query string 예시
key value
location 대한민국 서울특별시
checkIn 2020-05-20
checkOut 2020-09-21
adultCount 2
childCount 1
infantCount 1
priceMinimum 1
priceMaximum 500000
  • 검색필터가 불완전 한 경우엔 에러가 발생합니다.
    • checkIn은 입력했는데 checkOut은 입력 안한 경우
    • adult, child, infantCount중에서 어떤건 입력했는데 어떤건 빠진 경우
    • price 범위를 입력할때 어떤건 입력했는데 어떤건 빠진 경우
  • response 예시
{
{
    "rooms": [
        {
            "room_id": 1,
            "location_name": "오금동",
            "latitude": 37.252352,
            "longtitude": 235.52532,
            "name": "숙소A",
            "room_rating": 5.0,
            "person_capacity": 5,
            "review_count": 0,
            "price_per_day": 20000,
            "total_price": 427800,
            "bedroom_type": "ONE_ROOM",
            "bed_count": 2,
            "bathroom_type": "PRIVATE_BATHROOM",
            "amenity": "주방, 무선인터넷, 에어컨, 헤어드라이어",
            "room_thumbnail": "https://pix10.agoda.net/hotelImages/8515928/-1/2757b14c0680924208c33f286eab4c46.jpg?s=1024x768",
            "host": {
                "host_id": 1,
                "host_name": "Milo Kachinsky",
                "profile_image": "https://static.wikia.nocookie.net/starcraft/images/d/d5/Kachinsky_SC2_Head1.jpg/revision/latest/top-crop/width/360/height/360?cb=20100722105327",
                "superhost": true
            }
        }
    ]
}
  • 숙소 목록보기는 숙소정보에 대한 간략화된 정보만 제공합니다
    • detailImages를 제공하지 않습니다
    • 세부적인 가격정보도 제공하지 않습니다
    • 위의 두 정보는 상세조회에서 제공합니다

2-2. 숙소 상세조회

url /rooms/:roomId
param type query string
  • query string 예시
key value
checkIn 2020-05-20
checkOut 2020-09-21
  • 숙박기간만 입력받습니다. totalPrice계산을 위한 숙박일수를 입력받기 위해서 입니다
  • response 예시
{
    "room_id": 2,
    "location_name": "오금동",
    "latitude": 31.25144,
    "longtitude": 935.52532,
    "name": "숙소B",
    "room_rating": 0.5,
    "person_capacity": 3,
    "review_count": 0,
    "service_fee": 500,
    "accomodation_tax": 1000,
    "clean_up_cost": 2500,
    "price_per_day": 50000,
    "weekly_discount": 5,
    "total_price": 453150,
    "bedroom_type": "ONE_ROOM",
    "bed_count": 2,
    "bathroom_type": "PRIVATE_BATHROOM",
    "amenity": "주방, 무선인터넷, 에어컨, 헤어드라이어",
    "room_thumbnail": "https://pix10.agoda.net/hotelImages/124/1246280/1246280_16061017110043391702.jpg?s=1024x768",
    "host": {
        "host_id": 1,
        "host_name": "Milo Kachinsky",
        "profile_image": "https://static.wikia.nocookie.net/starcraft/images/d/d5/Kachinsky_SC2_Head1.jpg/revision/latest/top-crop/width/360/height/360?cb=20100722105327",
        "superhost": true
    },
    "detail_images": [
        "https://a0.muscache.com/im/pictures/f6e9a07a-8a17-4d14-8a42-4fc3e3b5f2bd.jpg?im_w=720",
        "https://a0.muscache.com/im/pictures/cc2371de-4386-4f2c-80ce-763ca32bc058.jpg?im_w=720",
        "https://a0.muscache.com/im/pictures/56cccaca-04fd-48d6-9877-13f41b037cab.jpg?im_w=1200"
    ]
}
  • 상세조회에서는 detailImages와 세부적인 가격정보를 제공합니다

3. 예약 API

3-1. 숙소 예약하기

url /rooms/1/reservations
param type application/json
  • query string 예시
key value
checkIn 2020-05-20
checkOut 2020-09-21
adultCount 2
childCount 1
infantCount 1
  • 예약에 필요한 정보만 json포맷으로 입력받습니다
  • 예약성공시 200 ok를 응답코드로 한 예약정보가 반환됩니다
  • 예약실패시, 400번대의 응답코드를 한 에러메세지가 반환됩니다.
    • 실패사유는 reason키의 value값으로 반환됩니다

4. 미구현 API 목록

  • 예약 취소 API
  • 예약 목록조회 API
  • 예약 상세조회 API
  • 가격범위목록조회 API
  • 가까운 인기 관광지 목록조회 API