Postman is a popular and capable platform for working with and testing APIs. While you are in the exploratory stage with the Shipwell API, we recommend Postman as a platform for familiarizing yourself with the various endpoints exposed through the API.
Install Postman on your computer. You can download Postman as a Chrome extension and a native application for Windows and Mac OSX, pick the installation that makes the most sense for your development environment and processes. Visit the Postman website, download the appropriate installation package, and install as instructed here.
Collections are a group of API endpoints contained inside Postman. All collections save the latest response and header settings from each API call.
Shipwell allows users to download the latest API endpoints, even as all endpoints are backward compatible with the current version of your API.
- Download the Swagger specification for the latest version of Shipwell's API.
- Import the swagger file to Postman as a collection. Click Import > Import file, and select the swagger file downloaded in step one.
3) Verify that the collection imported by selecting the folder "Shipwell API."
Postman environments allow you to make specific variables against both the Production and Sandbox Environments. Creation of these two environments is ideal for quick testing. To set up a production and sandbox environment:
- In Postman, click the Cog icon at the top-right of the screen. The Manage Environments pop-up appears.
- Click Add.
- Name your environment. We recommend Shipwell - prod for production and *Shipwell - sandbox** for Sandbox.
- Enter the following environment variables for baseURL and authoerization_token, based on the environment you are creating. Substitute the values with your user token and API token, which you can find by authenticating. | Key Type | environment | baseUrl | authorization_token | | --- | --- | --- | --- | | User based token | sandbox | https://sandbox-api.shipwell.com/v2 | Token <YOUR_USER_TOKEN> | | API based token | production | https://api.shipwell.com/v2 | APIkey <YOUR_API_TOKEN> |
- Click Add. Repeat these steps for the environment you did not add.
After you have set up an environment, you will want to test an endpoint.
- Navigate to the
authdirectory and find the
- Navigate to the headers tab and use the
authorization_tokenvariable defined in your environment variables.
- Upon entering your environment variables, hit send. Postman returns all information involved with your user, including id, name, permissions, and other relevant information.