Learn how to get started with Nylas using Postman. Postman is a powerful tool for working with different API integrations. We’ll test out using Nylas APIs on Postman.
In this post let’s take a look at making Nylas API calls using Postman. Nylas offers a CLI, API, and SDKs to connect with your users’ communication data. We’ll explore using Postman to try out different Nylas APIs. Using Postman is a great approach when building out a new integration and learning the available endpoints. Alternatively, you can follow our video walking you through how to start using the Nylas Postman collection:
Sign up here if you need to create a Nylas account for free!
Create a new App in the Nylas dashboard
We’ll be using Postman, web version, to make Nylas API calls, to be sure to signup for free
No local environment setup is required, we’ll be using the Nylas and Postman web tools to set everything up.
Retrieving Nylas Credentials
To setup Postman, we will need to share Nylas credentials for our application and for a connected user:
1. Retrieve the Nylas credentials from the Nylas Dashboard (Nylas Dashboard → Select the Quickstart Application —> App Settings):
2. You can connect a user via the dashboard:
Now you have retrieved the Nylas’ client_id, client_secret and user’s access_token. Now we’ve gone through accessing the Nylas credentials to make API calls using Postman.
Accessing Nylas’ Postman Collection
You can access the collection via the web, click here to access the online postman collection. The Nylas API collection on Postman contains all Nylas APIs documented, we are always working to keep Postman up-to date.
Consider forking the online collection if you want to make modifications or changes to the collection:
Now we’ve accessed the Nylas API Postman collection.
Setting up Environment Variables
You can access variables used throughout the Postman collection, with examples being credentials or Nylas’ API url. Let’s setup Postman to use the Nylas Production Template:
Now let’s make sure to update the Nylas credentials that we retrieved earlier by accessing the Environment variables:
Now we’ve updated the Postman Environment variables with all that we need to start using the Nylas API.
Making your first call with Postman
As a first API call, try calling the GET /account endpoint to retrieve the connected user’s account details:
You should see a response that looks like this:
Now we’ve successfully made our first Nylas API call with Postman.
Useful Postman features
Postman has many useful features when exploring and building out API integrations. One useful one to consider is the code snippet window that shows code snippets in different languages, here is an example of the GET /account call using cURL:
You can also complete scripts before and after a API call is made, here is an example of testing the response of an API call:
Now we’ve touched on a few useful features when building with Postman.
Reading and Sending Emails
Let’s consider the flow for reading and sending emails. Let’s try the read email API call via and limit the total emails by 1:
So by adding a limit of 1, we received the first email in our Inbox. Interestingly, its a blog post by Blag on reading emails using the Nylas SDKs!! Next let’s try sending an email:
Here we are using additional environment variables, name and exchange_email, so let’s modify those variables to be an email address we can access:
Since we confirmed the name as Nyla and the exchange_email as [email protected], let’s test out sending an email:
And we can quickly check our email to see the received message:
Now we’ve explored reading and sending emails using Nylas on Postman.
Reading and Creating Calendar Events
Let’s consider the flow for reading and creating calendar events. Let’s try by first accessing calendars to retrieve a calendar id:
Next let’s update the calendar_id value in the Environment variables:
Next let’s retrieve the next 3 calendar events:
Let’s try creating a calendar event in the future, take note of the Pre-request Script tab:
We are using the Pre-request Script to create an event in the future that starts now and ends 30 minutes in the future. The script is run before the API call creating two environment variables (timestamp and timestamp2) to create a new event in the calendar:
Ensure you are using a calendar that has the read_only property as false or you may receive the response:
Delivering Unified User Experiences with Transactional and Contextual Email APIs
A Small Guide to Virtual Calendars
How to Mail Merge in Outlook Step by Step
Subscribe for our updates
Please enter your email address and receive the latest updates.
Ram loves teaching, building and exploring technologies. He is passionate about empowering developers to ship amazing products to market as fast as possible 🚀. Ram is excited to share knowledge and help others. He’s a Relaxed Tomato 🍅.