Make an API call

Make an API call

With the Box Postman Collection forked into the Postman App it is now possible to make API calls to the Box API on behalf of the user you logged in as.

First: Reset browser storage

Now that you've imported the Box API credentials into Postman you should take a moment to remove these credentials from your browser's storage.

Removing your API credentials from the browser storage ensures that no other script can read your Client ID, Client Secret, Access Token or Refresh Token.

Select an environment

Before an API call can be made it is important to select the right Postman environment to use when making API calls.

When you imported the Box Postman collection it automatically imported a Box Postman environment for you to use. The collection will automatically recognize and use the variables in this environment for making API calls.

To select the Box Postman environment, select Box from the dropdown in the top-right of Postman.

Select Postman environment

You can inspect the environment by clicking the eye icon to the right of the dropdown.

Inspect Postman environment

Make an API request

To make an API request, select a Request from the Box Postman Collection. In this example, we will use the List items in folder API which can be found in the Folders folder.

Selecting an API request

By default the folder_id for this API endpoint is set to 0 which represents every user's root folder. You can leave this value as is or set it to the folder ID of a folder you want to inspect.

Next, click the Send button in the top right to make the API request.

Postman Send button

The API call should return quickly and show you a list of items in your folder in the response Body tab in the bottom half of the screen.

Postman response body

Authentication error

At this point Postman might return an error instead of a list. Often, this means your Access Token has expired. Check our guide on refreshing an access token in Postman for more details.

Summary

  • You selected the Postman environment to use for making API calls to Box
  • You made your first API call to Box, requesting the folder items for your user's root folder.