Rapid SDK developer guide

The EPS Rapid SDK simplifies the onboarding process, enables less error-prone integrations, shortens development cycles, and gets products into the market faster.

SDK overview

What is an SDK?

In a nutshell, a software development kit (SDK) is a collection of software development tools in one easily installable package. By taking advantage of the Rapid SDK partners can streamline their integration journey and remove the need to build functionality from scratch.

What's the difference between an SDK and an API?

An SDK provides developers with documentation, APIs, code samples, and libraries and processes. All the essential building blocks for the software product.

By contrast, an API only provides the necessary code that allows two software programs to communicate and share information with one another. As such, at least one API is often included in an SDK because, without an API, applications can’t relay information and work together.

What are the advantages of using an SDK?

  • Efficiency. SDKs let developers easily build the standard components of their apps and add functionality to them without having to build everything from the ground up themselves.
  • Simplified integration. SDKs reduce the complexity of integrations by simplifying standard processes.
  • Documentation and code libraries. SDKs include a variety of resources including documentation and code samples that developers can use to build and maintain applications.
  • Enhanced functionality. SDKs help developers enhance apps with more functionality or create new tools.
  • Cost savings. SDKs speed up the development process and make it quicker to get new apps to market meaning apps built with SDKs can offer substantial cost savings. SDK integrations also don't require specialized technical skills meaning partners can perform in-house integrations without needing outside professionals.
  • Customization. SDKs offer partners the opportunity to develop apps with personalized user experiences.

Getting started with the Rapid SDK

Below is a step-by-step guide to using the Rapid SDK for your integration.

|

Step 1: Choose an integrated development environment

In order to take advantage of the Rapid SDK you will need to choose your preferred IDE.

An integrated development environment (IDE) is a software application that provides facilities to computer programmers for software development. IDEs present a single program in which all development is done, including tools for authoring, modifying, compiling, deploying, and debugging software.

Some examples of popular IDEs include NetBeans, IntelliJ IDEA, and Eclipse.

Step 2: Create a new project in your IDE

In your integrated development environment (IDE) create a new project with the below parameters:

  • Language: Java (more languages to come!)
  • Build system: Maven
  • JDK: Download JDK (choose any version 11 or later)

Step 3: Update your pom.xml file

Within your new project, in your IDE, you should find a pom.xml file. Your next step is to add a code snippet here which will prompt your IDE to download the Rapid SDK behind the scenes automatically.

Step 1: Navigate to the pom.xml file in your project.
Step 2: Under Step 2 on the SDK Quick start page you will find the required code snippet.
Step 3: Paste the code snippet into your pom.xml file anywhere before the closing tag.

Tip: Don't include the <project> and </project> tags as your pom.xml file will already have these opening and closing tags.

Step 4: Once you have pasted in the code snippet, save the file. In your IDE you should find a Maven tab, it might be on the right of your work console. Open the tab and click the refresh button.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>EPS_Rapid_SDK</artifactId>
    <version>1.0.0</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
            <dependency>
                <groupId>com.expediagroup.openworld.sdk</groupId>
                <artifactId>openworld-java-sdk-rapid</artifactId>
                <version>1.0.0</version>
            </dependency>
    </dependencies>
</project>

Step 4: Update the Main.java file in your IDE

Now that you have updated your pom.xml file and downloaded the Rapid SDK to your IDE, it's time to update the Main.java file which you will find within the java folder in your project.

To start with, it will look like this:

package org.example;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
}

Step 1: Under Step 3 on the SDK Quick start page you will find a code snippet. You need to replace the code System.out.println("Hello world!"); in your Main.java file with the code snippet from from Step 3 on the Quick Start page.

Example:

package org.example;

public class Main {
    public static void main(String[] args) {
        
        RapidClient rapidClient =
                RapidClient
                        .builder()
                        .key("KEY")
                        .secret("SECRET")
                        .build();

);
    }
}

Step 2: Populate the key and secret objects with your own API Key and shared secret. For information on getting your API key and shared secret see here.
Step 3: Optionally, you can also configure your endpoint here using the .endpoint object. This will allow you to test your integration by making a call to the test environment. If you want to make a call to the production environment then you can skip this step. To make calls to the test environment then .endpoint needs to be set to https://test.ean.com/v3/

Example:

RapidClient rapidClient =
    RapidClient
        .builder()
        .endpoint("https://test.ean.com/v3/")
        .key("KEY")
        .secret("SECRET")
        .build();

Tip: If some of your code is showing an error, try right clicking on the highlighted code, choose 'more options', then 'show context actions', and finally 'import class'.

Step 4: Finally, once you have populated the .key, .secret and (optionally) the .endpoint objects you can make API calls using one of the usage examples with code snippets here. Copy and paste the code into your Main.java file below the RapidClient snippet. Execute your call using the run button in your IDE.

Example:

package org.example;

import com.expediagroup.openworld.sdk.rapid.client.RapidClient;
import com.expediagroup.openworld.sdk.rapid.models.PropertyAvailability;

import java.math.BigDecimal;
import java.util.List;

public class Main {
    public static void main(String[] args) {

        RapidClient rapidClient =
                RapidClient
                        .builder()
                        .endpoint("https://test.ean.com/v3/")
                        .key("KEY")
                        .secret("SECRET")
                        .build();

        List<PropertyAvailability> propertyAvailabilityList = rapidClient.getAvailability(
                "2023-03-01",
                "2023-03-28",
                "USD",
                "en-US",
                "US",
                List.of("2"),
                List.of("11775754"),
                "website",
                "hotel_only",
                BigDecimal.ONE,
                "5.5.5.5"
        );

    }
}

Step 5: To see the result of your call, add System.out.println(propertyAvailabilityList); to your code and run.

package org.example;

import com.expediagroup.openworld.sdk.rapid.client.RapidClient;
import com.expediagroup.openworld.sdk.rapid.models.PropertyAvailability;

import java.math.BigDecimal;
import java.util.List;

public class Main {
    public static void main(String[] args) {

        RapidClient rapidClient =
                RapidClient
                        .builder()
                        .endpoint("https://test.ean.com/v3/")
                        .key("KEY")
                        .secret("SECRET")
                        .build();

        List<PropertyAvailability> propertyAvailabilityList = rapidClient.getAvailability(
                "2023-03-01",
                "2023-03-28",
                "USD",
                "en-US",
                "US",
                List.of("2"),
                List.of("11775754"),
                "website",
                "hotel_only",
                BigDecimal.ONE,
                "5.5.5.5"
        );
        
System.out.println(propertyAvailabilityList);

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