숙박 시설 ID 검색
이 예시는 Lodging Listings API를 통해 Expedia의 숙박 시설 ID를 사용하여 숙박 시설의 콘텐츠 및 가격 정보를 조회하는 방법을 보여줍니다.
숙박 시설 ID 검색은 location-based 검색보다 필요한 검색 조건이 적어, 숙박 시설 관련 콘텐츠와 가격 정보를 확인하는 데 더 효율적입니다.
숙박 시설 ID를 조회하는 방법에 대한 자세한 내용은 의 “숙박 시설 정적 데이터 조회”를 참조하십시오. Listings API에 대한 자세한 내용은 의 Listings API 문서를 참조하세요.
1. SDK에 정의된 클래스를 사용하여 요청 객체를 생성합니다.
GetLodgingListingsOperationParams getLodgingListingsOperationParams =
GetLodgingListingsOperationParams.builder()
.partnerTransactionId("PARTNER TRANSACTION ID")
// Expedia Property IDs to search for
.ecomHotelIds(new HashSet<>(Arrays.asList("73460112", "2330513")))
// The links to return, WEB includes WS (Web Search Result Page)
// and WD (Web Details Page)
.links(Collections.singletonList(GetLodgingListingsOperationParams.Links.WEB))
// Check-in 5 days from now
.checkIn(LocalDate.now().plusDays(5))
// Check-out 10 days from now
.checkOut(LocalDate.now().plusDays(10))
// Filter the properties that are available only
.availOnly(true)
// Use the default occupancy: 2 adults in one room
.build();
GetLodgingListingsOperation getLodgingListingsOperation =
new GetLodgingListingsOperation(getLodgingListingsOperationParams);2. 서비스 클라이언트를 사용하여 API 호출을 수행합니다.
Response<HotelListingsResponse> hotelListingsResponse =
client.execute(getLodgingListingsOperation);