Getting Started with Platform Data API

Why Platform Data API uses GraphQL

We chose GraphQL for the Platform Data API because it offers significant flexibility for our integrations. The ability to define precisely the data you want—and only the data you want—is a powerful advantage over the REST API endpoints. GraphQL lets you replace multiple REST requests with a single call to fetch the data you specify.

For an in-depth understanding of GraphQL concepts and terminology, please refer to Interacting with GraphQL.

The API Endpoints

Because all APIs are modeled as resources on the platform, the GraphQL endpoint is not directly accessible by Partners. Instead, here are the base endpoints:

  • Production https://cp.expedia.com/api/
  • Sandbox https://sandbox.cp.expedia.com/api/

The API Reference

You can query and explore the Platform Data API GraphQL schema definition.

Authentication

To communicate with the GraphQL server, you need credentials with the appropriate scopes.

Before raising access requests, refer to the RBAC Resource Model for understanding exposed resources and domains.

The scopes you require will depend on the type of data you're trying to request.

Once you have the correct scopes set up and have secrets, you can use the following request as an example of how to query the Platform Data API:

POST {{BASE_URL}}/partners/{{Partner-ID}}/data/{conversationdata}/getConversationById
Content-Type: application/json
Authorization: Basic {{Client-ID}}:{{Secret}}
x-cp-partner-id: {{Partner-ID}}
x-resource-template-version: {{template-version}}

{ “query”: “query{getConversationById(conversationId:\“39824e66-7eb1-4099-8110-ed41d7793f4d\“){conversationId}}” } 

Consuming the API

The API schema definition is self-explanatory. It describes:

  1. All exposed domains
  2. All available queries for searching these domains
  3. All required arguments for accessing the domain data