Announcing the Postman Collection for Postmark
We are happy to introduce the official Postman Collection for Postmark! If you are not familiar with Postman it is a graphical interface tool that allows you to test and share API calls at the click of a button. Our Postman collection makes it easy to try out the Postmark APIs and see the results instantly without the need to write any code.
Postman is similar to Postmark’s API Explorer because it allows you to view and send prepopulated API calls. Postman also allows you to save variables that can be shared across multiple API calls. This makes it even easier to test multiple API calls together.
If you are not familiar with Postman, here are a few things you should know:
- In order to get started we recommend downloading the Postman desktop application.
- A Postman Collection is a set of API endpoints and requests, along with the required authorization, headers, request bodies, and parameters for each API call.
- Postman Collections also include a set of variables called Collection Variables that may be required for API calls to work
Once you have installed Postman you can import the Postmark collection by clicking the Run in Postman button below. You can choose to Fork or Import the collection.
Before you can use the collection you will need to update some of the Collection Variables. Most importantly you will need your API tokens. Postmark makes use of two types of API tokens, depending on the endpoint. The Server API token and the Account API token. You can access your API tokens in your Postmark account.
In Postman, make sure you have the top level directory of the collection ("Postmark APIs") selected. Then click on the "Variables" tab.
The "Current value" field will be used when a variable is accessed by the collection. To get started, for the api_token variable, replace the current value with your Postmark Server token. Next, replace the account_token current value with your Postmark Account token.
We recommend getting started with the Email endpoint. Many of the other endpoints require some email data before functioning properly. Expand the Email directory in the collection window and select Send a single email.
We have prepopulated the body of this call with an example message, but you will need to change the From field to a valid sender signature for your account before the API call will be accepted. You can also take this time to experiment with the other fields available in this API call.
Once you have changed the From address to a valid sender signature you can click the "Send" button in Postman to send the API call. The API response will be output beneath the request and if all goes well you should see a 200 response.
You can also verify that the API call was received successfully by logging into your Postmark account and viewing the activity feed for the server and message stream that you used to make the API call.