Setting up the Java SDK for Rapid API

Software development kits make integration simple so you can quickly get products to market

1. Become a partner and get your credentials

You can find more details here.

Information

Note

Expedia Group has made branding changes to the Fraud Prevention Service Java SDK. Information on this page refers to the rebranded SDK. Update instructions


Your development environment needs to have Java 8 or later. You can use Apache Maven or Gradle to configure SDK dependencies for your projects.


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();

(Optional) 3.1. Configure endpoint

The service client can also be configured to override the Rapid API endpoint, for example to use the test environment.

RapidClient rapidClient =
    RapidClient
        .builder()
        .endpoint("https://test.ean.com/v3/")
        .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.

Did you find this page helpful?
How can we improve this content?
Thank you for helping us improve Developer Hub!