Use the Run in Postman button

This is for:

Developer

Programmers around the world widely use Postman, an application that provides an extensive API development environment.

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).

Example

The Push API Tutorial 1 features a 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.

Test API requests in Postman

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

  1. If not done yet, download and install Postman.

  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.

    Example

    On 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
      Tip

      In the lower-left corner of the panel, clear the Show this window on launch checkbox 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.

        Note

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

    3. In the sidebar on the left, select the Collections tab.

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

    5. In the upper-right corner of the application:

      1. Click the Environment dropdown menu, and then select the environment matching the collection name.

      2. Click the Environment quick look (eye) icon on the right of the dropdown menu.

      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’ll find information about which environment values to use and the required privileges in the docs.coveo.com page on which you clicked the button.

        Example

        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.