Only show these results:

Postman and Nylas

Use our Postman collection to get started using the Nylas API quickly. Alternatively, you can follow our video or blog post walking you through how to start using the Nylas Postman collection.

Our Postman collection includes:

  • Environment variables: these variables allow you to reuse common values such as the Nylas API url and the Nylas client_id for your app across different API calls in postman. We’ll revisit these shortly. Here are what environment variables look like in Postman:
    Postman adjust Environment variables

  • 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:
    Postman Autogenerated values

  • Tests that are used to check for correct responses:
    Postman Request tests

Setup

  1. You can access the collection via the web, click here to access the online postman collection:
    Nylas API Postman Collection

  2. (Optional) Consider forking the online collection if you want to make modifications or changes to the collection:

Forking a Postman Collection
  1. (Optional) If you have Postman installed, click the link below to run the collection in postman locally.

Using Environment Variables

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:

Nylas Production Template environment variables

Specific environment variables are required to get started using the Nylas APIs:

  • url is the Nylas API URL (provided by default).
    • The environment variable url must take into account the region. By default, the Nylas Production Template uses the API URL for the United States (https://api.nylas.com). For more information, refer to Data Residency.
  • client_id and client_secret are available in your Nylas dashboard
  • access_token is the credential of a connected user’s account.
    • An easy way to retrieve an access_token is via the Nylas Dashboard by using the Quickstart App and clicking on the Connect an account button:
Connecting a User Account using Quickstart

Modifying Environment Variables

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:

Postman Environment Variables current value column

Some items to note as you come across different initial values:

  1. autogenerated: values that will be replaced as you start making requests. You can also remove autogenerated and replace them manually:
    Postman Environment Variables autogenerated values

  2. URL: this value is pre-filled with the Nylas API server:
    Postman Environment Variables prefilled values

  3. blank fields: values that you will need to fill those in yourself:
    Postman Environment Variables blank values

Setting up the Postman Collection

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:
Selecting Postman Environment Variables

Ensure you have specified the client_id, client_secret, and access_token.

Adjusting Environment Values

Select the eye icon, then edit to adjust values.

Postman adjust Environment variables

Make your first API call

As a first API call, try calling the GET /account endpoint to retrieve the connected user’s account details:
Get User Account details