Nylas

Nylas allows you to set up advanced booking capabilities for users on your platform. This is a good fit for expert marketplaces. Users can set up their own availability and calendar syncing.

Demo

Demo editor: https://bubble.io/page?type=page&name=nylas&id=chris-sandbox&tab=tabs-1

Run mode: https://chris-sandbox.bubbleapps.io/version-test/nylas

Run mode without redirect: https://chris-sandbox.bubbleapps.io/version-test/nylas?state=test&namespace_id=3z6ypewhajtuzw1fqmuli4m7u&account_id=3z6ypewhajtuzw1fqmuli4m7u&sid=31&access_token=9KRERoMdeMABdnU7AjJ3lKEOUeFuyG&provider=gmail&email_address=chris%40airdev.co

Username: username Password: password

Setup

In order to set up, the following things are needed:

  1. Nylas Application

    1. Be sure to set the Callback ID

  2. Google OAuth Setup (if allowing google accounts to use Nylas)

  3. AirDev Nylas plugin (private plugin as of July 2020, talk to Chris or email [email protected] for this)

API Calls

Authorize (JS)

This call signs a user in with their account (Gmail, Microsoft account, Yahoo, etc). Be sure to save the access_token after a user is redirected back to the page.

Inputs:

  • Redirect URI: page a user is redirected back to

  • State: Text that will be passed along with the redirect in the URL

  • Email: The email for the user that is signing up

This doesn't automatically create a Bubble user, since it's not an OAuth call through the Bubble OAuth flow. A workaround for this is this:

Create, Modify, Delete Events

These API calls can be used to manage events in a user's calendar.

Fairly straightforward. They use UNIX timestamps without milliseconds for times, so be sure to pass those correctly. UNIX timestamps do not have time zones so there is no need to worry about time zone confusion once the data is passed to Nylas.

Inputs include a Calendar ID, gotten by the "Get Calendars" data API endpoint, and an access token, returned when a user first authorizes.

NOTE: for future projects, if more inputs are needed, reach out to [email protected] (e.g. if a custom message needs sent when notifying participants, if participants need to be able to be added to events, if "all-day" events need created, etc).

The Get Calendar call may need to be used in the user onboarding process to prompt a user which calendar(s) to check for overlapping events. In the calendars returned here, a user's colleagues' calendars may appear here as well, for example, or they could have other calendars that they don't want to consider.

This flow could also be used to have a user confirm which Calendar they want us to create new events in.

Availability

To know if a user is available at a certain time, their calendar can be checked for times that they are available, checked for times that they are busy, or all events can be returned from their calendar(s).

Returns times a user is available
Returns times a user is busy
Returns information about a calendar's events, with a lot of metadata (event name, description, etc)

If more specific calls are needed for the Get Events call, email [email protected] or ask Chris to add those fields.

Video Walkthrough (v1, July 2020)