Using Postman and Developer Toolkits

Postman is a free cloud-based application that allows you to test API requests and see examples. Postman allows users to save API requests and examples into collections. Postman can store variable values for use in the URL, headers, and body of any request in a collection. You can use Postman to test APIs before deploying code to production.

Postman collections are included in the JSON API developer toolkits, available for download for the Air GDS, Air NDC, Exchange, Hotel, and Pay APIs. At the top of any page in the online help, select Downloads & Support > Downloads & Tools.

You can enter the credentials given to you at API provisioning to run through sample transactions. Several of the Postman collection include examples that allow you to see end-to-end shopping and booking flows without being provisioned.

In this topic:

Sign Up for Postman

If you aren't already using Postman, sign up for a free account at https://www.postman.com/. After a short series of questions, Postman creates a workspace for you. You can create multiple workspaces and share with others as needed.

Importing a Postman Collection

Take the following steps to import any of the JSON API Postman collections.

  1. If you haven't already, download the developer toolkit:

    1. At the top of any page in the online help, select Downloads & Support > Downloads & Tools.

    2. Download the appropriate developer toolkit, if there is more than one.

    3. Unzip the file and navigate to the Postman collection.

While the contents of developer toolkits vary, all toolkits include a Postman collection. The Postman collection file itself has a .json extension. Some toolkits also include Swagger files and sample payloads, while others have examples embedded into the Postman collection.
  1. In Postman, click the Import button at the top of your workspace.

  1. In the dialog that opens, either drag the Postman collection file to the window or select it from the window. The imported collection appears in your workspace.

Using Postman

Entering Credentials

See the Authentication topic for details on entering your credentials and generating an authorization token: At the top of any page in the online help, select General > Authorization.

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.

Navigating Postman

All Postman collections for the JSON APIs are organized in folders and sub-folders that follow the flow of the API calls in the order you would send them for the flow expected for that set of APIs. API requests with extensive options have multiple folders to showcase possible paths, as in this Air GDS Postman collection:

API collections without as many options have a flatter structure, as in this Exchange APIs collection:

Saved Examples in the Air Developer Toolkits

The Air Postman collections for GDS and NDC include saved examples, which allow you to browse code without entering credentials. The names of these saved examples are prefaced with e.g. instead of the HTTP method. These examples have already been run, and include matching requests and responses; click on the Body tab to see the request.

Some of the examples illustrate longer end-to-end flows that carry a specific scenario through all required API calls. In the example below, the first example highlighted with red is a standalone example, while the second highlight is part of an end-to-end (E2E) flow. This second scenario appears several times in this collection under the same example name.

End-to-end examples use the naming convention of E2E Example #.step#description of flow. In the example below, E2E Example 1.2 Full Payload with FSLS is example 1, step 2 (1.2) of the full payload flow with FSLS (defined in example 1 step 1 as Flight Specific Led Search).

Running JSON Requests

Follow these steps to run any of the scripts in the Postman collections.

  1. Click on any POST, GET, or DEL option (HTTP methods) to open a script for the API request. If desired, you can modify the request from the Headers and Body tabs. These scripts generate live pre-production responses from the API.

    Notes:

    • To see the full code for JSON request click the Code icon </> below and to the right of the Send button.

    • For any variable used, you can look at the code to see the data passed to this request by that variable.

      • However, if the request body uses a variable that requires data from a previous API request that you haven't yet run, it remains a variable in the Code section until receiving the prerequisite data.

      • When copying Postman requests into your own application, you may want to substitute your data for variables in the scripts.

  2. After making any desired modifications to the script, click the Send button to send the API request. The response appears in the panel below the request body.

  • You can save responses by clicking the Save as Example button at the top-right of the response. The ... button to the right of Save as Example allows you to save the response to a file.