Using Postman to Test APIs

The free Postman GUI application allows you to test API requests and see examples before you add the API to your development environment. Postman files are provided in the Downloads / Developer Toolkits section of the online help for each set of APIs.

In this topic:

Credentials

You must send your request to the correct version of the API you are using - check the version in the URL of the endpoint, and make sure it matches the version indicated in your message headers.

Installing Postman

If you haven't already, download and install the appropriate version of the Postman app from https://www.getpostman.com/

Importing a Postman Collection

Take the following steps to load an API collection from Travelport. You can either import a collection from a link provided by Travelport, or download the collection to your local device and import the file from there.

  • In Postman, click the Import button on the black toolbar at the top of the screen.

  • If you are importing from a link, in the Import dialog box, click Import From Link, enter the link provided by Travelport, and click the Import button.

  • If you are importing a downloaded file, click Import File, click the Choose Files button, navigate to the file location, and click Open.

Postman displays the available samples in the collection in the left-hand panel. For the Air APIs, after importing a collection, you must set up an environment before you can run sample data.

Running Test Searches in Postman

The panel on the right side of Postman has the Authorization, Headers, and Body tabs. Each Postman collection includes sample data and pre-formed requests, allowing you to test searches available in the collection. Select a search in the left-hand panel and click Send to load a sample response. Use the dropdown circled below to select JSON format. You can copy the JSON generated in Postman and paste it into your HTTP client with the appropriate header information to try it in your own application.

If the collection uses an environment file, remember to always select the appropriate environment file from the dropdown in the upper right-hand corner.

When copying Postman request data into your own application, you may want to substitute actual data for any variables in the test data. Otherwise, variables are pulled from the environment file.