Postman and Nylas
Our Postman collection includes:
Environment variables: these variables allow you to reuse common values such as the Nylas API
urland the Nylas
client_idfor your app across different API calls in postman. We’ll revisit these shortly. Here are what environment variables look like in Postman:
Autogenerated values: these are values that are generated before or after API calls. For example, when creating an event, you need to populate specific data, which can be autogenerated before the API call is made. Here is an example of autogenerated values created via a Pre-request Script when creating a new calendar event:
Tests that are used to check for correct responses:
You can access the collection from the web by going to the Nylas API overview to access the online postman collection:
(Optional) Consider forking the online collection if you want to make modifications or changes to the collection:
(Optional) If you have Postman installed, click the link below to run the collection in postman locally.
Postman Environment variables make it easy to store variables used throughout your collection, so you can have different values for production vs. staging while only needing to maintain a single collection of endpoints.
In the Nylas postman collection, we’ve created a list of initial variables that will be useful when making calls to the Nylas API. You can find it by clicking on the
Environment icon and selecting
Nylas Production Template:
Specific environment variables are required to get started using the Nylas APIs:
urlis the Nylas API URL (provided by default).
- The environment variable
urlmust take into account the region. By default, the
Nylas Production Templateuses the API URL for the United States (
https://api.nylas.com). For more information, refer to Data Residency.
client_secretare available in your Nylas dashboard
access_tokenis the credential of a connected user’s account.
- An easy way to retrieve an
access_tokenis via the Nylas Dashboard by using the Quickstart App and clicking on the
Connect an accountbutton:
Some environment variables values are filled in and others are not. When updating the environment values, consider the initial value column as a read-only column. It is recommended to only modify current values with your specific values. Current values will overwrite the initial values when API calls are made:
Some items to note as you come across different initial values:
autogenerated: values that will be replaced as you start making requests. You can also remove autogenerated and replace them manually:
URL: this value is pre-filled with the Nylas API server:
blank fields: values that you will need to fill those in yourself:
If you are using Postman Desktop, follow the Postman docs to import the Nylas Production Template environment variables if they are not already in your collection.
To use the Nylas Production template environment variables make sure you still have Environments selected and click the Nylas Template Environment:
Ensure you have specified the
Select the eye icon, then edit to adjust values.
As a first API call, try calling the
GET /account endpoint to retrieve the connected user’s account details:
Prefer video? You can watch our LiveStream Coding with Nylas.
- Read the blog post How to Get Started With Nylas Using Postman.