Nylas Docs

The Nylas Developer Hub

Welcome to the Nylas developer hub. You'll find comprehensive guides and documentation to help you start working with Nylas as quickly as possible, as well as support if you get stuck. Let's jump right in!

Developer Guide

Postman + Nylas

Setup

First, install postman by downloading it from here: https://www.postman.com/downloads/

Add the Nylas Collection

The “Nylas Cloud API Collection” has almost every endpoint in the cloud APIs hooked up to postman.

Click "Import" in the upper left part of Postman and then copy the following link in the "Import from Link" section of the modal popup:

https://www.getpostman.com/collections/668420992dee36b2d2e7

📘

Nylas Collection Updates

We periodically update this collection, so you may need to re-import it from time to time to stay up to date with the latest changes.

Install Nylas Environments

Postman Environments 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.

This template environment is scaffolding to get started with Nylas, and provides empty variables like account_id, access_token, and url that are used as variables throughout different endpoints in the collection.

For example, the Nylas collection has an endpoint /account to get info about a connected account:

As you can see in the GET request, the {{url}} is a variable that is pulled from your environment. In the image above, no environment is set, so {{url}} is colored red to indicate it isn't resolving to a value. Let's import the Nylas template environment to change this so we can start using that url variable.

Click the settings cog icon in the upper right, and then click the Import button:

Download and load this environment:

Once you’ve imported this, there’s still some setup you’ll need to complete for each before making requests.

Click on the settings Cog and then "Nylas Production Template" and you’ll see a screen like this:

As you can see, now we have a value for the url variable. Any blank value is one you’ll need to fill in yourself. Any value that has “autogenerated” in it means it will eventually be replaced as you start making requests through postman.

Using Postman

Once you've updated your specific environment variables with things like your client_id and client_secret, you'll need to step through some API queries to have other environment variables populated automatically based on the API response.

To have the appropriate variables auto-generated for you, you’ll need to step through the authentication process. For example, to auth an account, first send a request to /connect/authorize . You’ll get a code back as a json object. If you look at the “tests” below for that endpoint, you’ll see that the environment variable code is set to the output of the response.

Now you can call /connect/token . You’ll see in the body of the request that the variable {{code}} is being inserted, which was saved from the last request into the environment.

You can see the current environment variables and their values by clicking on the eye in the top right of Postman.

Some of the requests require that environment variables are set. So just do some digging, look at the tests for different requests, and you’ll be able to tell what endpoints update what variables, and what order certain requests should be made in.

Updated 2 months ago

Postman + Nylas


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.