Using the Run in Postman Button

Programmers around the world widely use Postman, an application providing an extensive API development environment (see Postman Learning Center).

Some Coveo documentation pages include a Run in Postman button allowing to easily test in Postman the API requests that are presented in the page or in a set of pages (such as in a tutorial).

The Push API Tutorial 1: Manage Public Content page features the Run in Postman button.

Run in Postman button in a page

In short, the Run in Postman button opens your Postman application with:

  • A shared Postman collection containing all the API requests covered in the page or set of pages.

  • A Postman environment containing the required variables (some with empty values).

    You must set your environment variable values and ensure that your API key or OAuth2 token carries the required Coveo privileges to perform the API requests included in the collection. You should find this information in the page containing the Run in Postman button.

Testing API Requests in Postman

If you’re not familiar with Postman, the following procedure will help you get started:

  1. If not done yet, install Postman (see Get Postman and Installation and updates).

  2. On the docs.coveo.com page featuring a Run in Postman button, click it.

  3. In the Open with panel that appears, select your Postman application.

    In a Mac computer:

    Postman Open with panel

  4. In your Postman application:

    1. If you get a Create New panel, close it.

      Postman Create New panel

      In the lower-left corner of the panel, clear the Show this window on launch check box to prevent getting having to close this panel every time.

      You can go back to this panel by clicking New in the upper-left corner of the Postman application.

    2. If you get a Collection Exists dialog box:

      Postman Open with panel

      • If you imported the collection some time ago, click Replace to ensure that you get the latest updated collection.

        OR

      • If you recently imported the collection, to prevent duplicating the collection, close the dialog by clicking X in the upper-right corner.

        When an environment is bundle with the shared collection, you may end up with duplicated environments.

    3. In the sidebar on the left, select the Collections tab (see Intro to collections).

    4. In the list of collections, click the collection prefixed with Coveo - and matching the title of the docs.coveo.com page in which you clicked the button.

    5. In application upper-right corner:

      1. Click the Environment drop-down menu, and then select the environment matching the collection name (see Intro to environments and globals).

      2. Click the Environment quick look (eye) icon on the right of the drop-down.

      3. In the Environment quick look panel, if some environment variables are empty or don’t have an appropriate value, click Edit to change the values.

        Ensure that the API key or OAuth2 token carries the required Coveo privileges to perform the API requests included in the collection

        You will find information on environment values to use and required privileges in the docs.coveo.com page in which you clicked the button.

        In the Coveo - Push API Tutorials environment, you must set the organizationId, apiKey, and myEmailAddress variables.

        Postman Edit environment variables

    6. Back in the list of collections, expand the collection.

    7. In the expanded collection, click the API request you want to test.

    8. Send the API request (see Requests).