Getting Started with the Rapid SDK for Java
This section provides information about how to set up and use the Rapid SDK for Java.
1. Become a partner and get your credentials
You can find more details here.
2. Set up Java development environment
Your development environment needs to have Java 8 or later. You can use Apache Maven or Gradle to configure SDK dependencies for your projects.
Maven
<project>
<dependencies>
<dependency>
<groupId>com.expediagroup.openworld.sdk</groupId>
<artifactId>openworld-java-sdk-rapid</artifactId>
<!-- version -->
</dependency>
</dependencies>
</project>
Gradle
dependencies {
implementation 'com.expediagroup.openworld.sdk:openworld-java-sdk-rapid'
}
3. Create a service client and configure it
To make requests to Rapid endpoints, create a service client and configure it with your credentials.
RapidClient rapidClient =
RapidClient
.builder()
.key("KEY")
.secret("SECRET")
.build();
The service client can be configured with a request timeout (in milliseconds) to override the default interval allowed for HTTP calls.
RapidClient rapidClient =
RapidClient
.builder()
.requestTimeout(10000)
.key("KEY")
.secret("SECRET")
.build();
4. Make API calls
The service client has a method for each endpoint in the Rapid API. You can access the endpoint by calling the corresponding method with the requisite parameters.
List<PropertyAvailability> propertyAvailabilityList =
rapidClient.getAvailability(
"CHECK_IN",
"CHECK_OUT",
"CURRENCY",
/* ... */
);
You can find usage examples here