This repository contains examples of how to use the Expedia Group XAP Java SDK. The examples are written in Java and use Maven for dependency management.
The example implementation provided in the examples package demonstrates different scenarios utilizing various XAP APIs through the SDK.
Currently, the following scenarios are included:
-
ListingsQuickStartScenario.java
:This example demonstrates how to search for properties with a location keyword with filters applied in Lodging Listings API.
-
HotelIdsSearchEndToEndScenario.java
:This example demonstrates how to retrieve accessible property ids from SDP DownloadURL API and then get the content and prices of these properties using the Lodging Listings API.
-
QuotesQuickStartScenario.java
:This example demonstrates how to search for property quotes with property IDs in Lodging Quotes API.
-
VrboPropertySearchEndToEndScenario.java
:This example demonstrates how to retrieve accessible Vrbo property ids and location content from SDP DownloadURL API and then get the prices of these properties using the Lodging Quotes API.
-
AvailabilityCalendarsQuickStartScenario.java
:This example demonstrates how to use Availability Calendar api with simple search. In terms of how to get property ids, you can refer to
QuotesQuickStartScenario.java
.
-
CarDetailsQuickStartScenario.java
:This example demonstrates how to search for cars using an airport keyword with filters applied in the Car Listings API.
-
CarDetailsQuickStartScenario.java
:This example demonstrates how to search for car details using the offerToken obtained from the car listing in the Car Details API.
We are continuously adding more scenarios to demonstrate the usage of other XAP APIs.
- Ensure you have a valid API key and secret from Expedia Group. Check Getting started with XAP for more info.
- Java 1.8 or higher
- Maven
- Clone the repository.
- Navigate to the project directory
examples
. - Run
mvn clean install
to build the project and install the dependencies including the XAP SDK.
- Navigate to the example class you want to run
- Right-click on the class name and select
More Run/Debug
->Modify Run Configuration
- Check the
Modify options
->Add VM options
and add the following VM options:Replace-Dcom.expediagroup.xapjavasdk.apikey="{API_KEY}" -Dcom.expediagroup.xapjavasdk.apisecret="{API_SECRET}"
{API_KEY}
and{API_SECRET}
with your actual API key and secret.Note: If you are running the examples for Vrbo, you would need the following VM options instead:
-Dcom.expediagroup.xapjavasdk.vrbokey="{VRBO_KEY}" -Dcom.expediagroup.xapjavasdk.vrbosecret="{VRBO_SECRET}"
The key you use must be enabled for Vrbo brand. If you are not sure, please reach out to your account manager.
- Click
OK
and then run themain
method of the example class.
Run the following command to run the example class you want to run:
mvn exec:java -Dexec.mainClass="path.to.example.ExampleClassName" \
-Dcom.expediagroup.xapjavasdk.apikey="{API_KEY}" \
-Dcom.expediagroup.xapjavasdk.apisecret="{API_SECRET}"
Replace path.to.example.ExampleClassName
with the full path to the example class you want to run,
and {API_KEY}
and {API_SECRET}
with your actual API key and secret.
Note: If you are running the examples for Vrbo, you should use the following command instead:
mvn exec:java -Dexec.mainClass="path.to.example.ExampleClassName" \ -Dcom.expediagroup.xapjavasdk.vrbokey="{VRBO_KEY}" \ -Dcom.expediagroup.xapjavasdk.vrbosecret="{VRBO_SECRET}"
The key you use must be enabled for Vrbo brand. If you are not sure, please reach out to your account manager.
This project is licensed under the Apache License v2.0 - see the LICENSE for details.