Whether you're a seasoned developer, a novice developer, or someone that's just starting to understand what an API is or how it can be used, you can benefit from Postman. Postman, available in the Chrome Web Store, is a great app to get familiar with Box’s Content & View API. That's why we took the vast majority of Box's API calls and saved them as Postman 'Collections' to be shared with you! You can get the Postman plugin for Chrome here.
To import the API collections, launch Postman and click ‘Import’.
Upload the json files you can download from the following URLs:
You should receive a successful message: “It worked!”
Once you import these and you’re ready to make some calls, you’ll need to add your own token into the Authorization Header.
The Content API Header follows the format:
Bearer [insert your token]
The View API Header follows the format:
Token [insert your token]
To receive a token for either API, you’ll need to create an app and get a client ID and client secret. For the Box View API, simply create a Box View app and you’ll receive a token. You can quickly create your app for either API here, which will require a Box account. If you don't have one, sign up for a Box account here.
For the Box Content API, you’ll want to authenticate to get the access token and refresh token. Steps to do so are shown under “OAuth” in the documentation. A shortcut when using a test account is to generate a developer token within the “OAuth “settings of your Box Content API app. This is a one-time token that will expire in one hour.
Click here for a full registration tutorial.
While going through all of the steps of “OAuth,” note that the authorization codes to get an access token are valid for 30 seconds, while access tokens are valid for one hour, and refresh tokens are for one-time usage and will expire 60 days after being generated. Also, the As-User API requires an additional scope, which can be turned on by the Platform team. Please email email@example.com to do so.