Mimecast

Using the Mimecast API in Postman

Mimecast API in Postman

Postman is a tool that makes working with API calls easier to understand, perform test calls and execute basic tasks. The Mimecast API collection is meant as a training resource for those looking to build scripts or programs that make use of our API capabilities. In addition to the collection provided here, all API endpoints have sample scripts in varying languages on their respective pages.

Getting started with Mimecast and Postman

To get started with Postman, you can download an installer from https://www.postman.com.
To get started with Mimecast in Postman, you’ll need to download these two JSON files:
  1. Mimecast API Collection – This file contains the currently available Mimecast API calls, and includes pre-request scripting to generate an Authorization header for each call.
  2. Mimecast Environment – This file will be used to set variables, which will contain your Application ID, Application Key, Access Key and Secret Key. Follow these instructions in our KB to obtain these keys.
Once you have these files downloaded, and Postman installed, open the Postman application and follow the initial setup steps. Note: A Postman account is not required to use the Mimecast API collection.
From the main screen, select Import towards the top left of the window, and import both the Mimecast Collection and Mimecast Environment JSON files (these may need to be imported individually).
Postman with Import button highlighted
Once imported, you will see the Mimecast Collection on the left pane of the application, and the environment can be selected towards the top right. Click the Manage Environments button, and select Mimecast Environment.
If you do not already have API keys, follow this knowledgebase article to generate all keys necessary.
If you do not know your grid’s Base URL, it can be identified from this knowledgebase article.
Enter the 4 keys and Base URL under their respective Current Value field (ensure they are not entered into the Initial Value column):
Application ID: ApplicationID
Application Key: ApplicationKey
Access Key: AccessKey
Secret Key: SecretKey
API Base URL: BaseURL
Once entered, select update and close the Environment window. Select the Mimecast Environment from the drop-down list.
You’re now ready to make an API call to Mimecast! Expand the Mimecast / Account Information folders and select Get Account:
Postman showing Get Account API call
For API call, no request body changes are needed, and the collection will automatically use the variables entered to authenticate the API call. Hit the blue Send button and you will get a response containing account information, similar to that seen on the Administration Console’s Account Settings screen.
The Authorization header value used to authenticate will not be stored in a variable. To inspect the pre-request script used to generate the Authorization header, right click on the top level of the Mimecast collection, select Edit and navigate to the Pre-request Scripts tab (a console logging line is commented out, but can be used to troubleshoot header values):
Postman showing collection pre-request script
Additional API calls can be added to a collection as new capabilities are released, and will inherit the configuration from the parent collection structure. The available collection file will be updated with any enhancements and newly released API endpoints.

Please note that Postman is a tool separate from Mimecast, not affiliated with Mimecast and retains their own trademarks.