Missing 'participants' parameter support in Scheduler UI packages: @nylas/react and @nylas/web-elements

I’ve discovered a problem with the @nylas/react and @nylas/web-elements packages.

We have a configuration that stores multiple participants. We need to use the nylas-scheduling wizard to check availability using the participant list from our configuration, but only book for the organizer and the guest who provided their details.

When using your API directly (/v3/scheduling/bookings), we can pass a parameter called “participants” that allows us to explicitly specify users from our configuration who should be part of the event.

The problem is that your Scheduler UI packages don’t support this parameter, even though they use the same endpoint (/v3/scheduling/bookings) that enables this functionality.

When using the nylas-scheduling component, we can pass custom events through eventOverrides, where we can call connector.scheduler.bookTimeslot. I can pass the information I need to this method, but not the ‘participants’ parameter.

Here’s a types for connector.scheduler.bookTimeslot:

bookTimeslot(data?: NylasSchedulerBookingDataWithFlatFields & {
        timeslot?: Timeslot;
    }): Promise<NylasSchedulerResponse<NylasEvent>>;

Types definition for
NylasSchedulerBookingDataWithFlatFields and NylasSchedulerBookingData:

export type NylasSchedulerBookingData = {
    primaryParticipant: NylasSchedulerBookingParticipant;
    startTime?: Date;
    endTime?: Date;
    timezone?: string;
    language?: string;
    guests?: NylasSchedulerBookingParticipant[];
    additionalFields?: Record<string, {
        value: string;
        type?: string;
        readOnly?: boolean;
    }>;
};
export type NylasSchedulerBookingDataWithFlatFields = Omit<NylasSchedulerBookingData, 'additionalFields'> & {
    additionalFields?: Record<string, string>;
    location?: string;
    booking_ref?: string;
};

Type definition for TimeSlot:

export type Timeslot = {
    start_time: Date;
    end_time: Date;
    emails?: string[];
    capacity?: number;
    event_id?: string;
    master_id?: string;
    calendar_id?: string;
};

How can this issue be resolved? I believe this is a bug on your side that can be resolved quickly :slight_smile:

Hi Oleksandr,

It’s not 100% clear to me what you are trying to achieve. It sounds like you want to implement a two step scheduling process where you take multiple participants’ schedules into account when deciding on a timeslots to offer, but then you want to only offer those timeslots for a booking that is specific to the organizer and a guest. If I understand this correctly, I think the best path is for you to use our /availability endpoint to pass in all the participants needed to find a subset of timeslots that work, then with the returned timeslots use a scheduler configuration with “specific time availability” to pass on those specific slots.

Let me explain once again what I need.

We have a configuration for Nylas Scheduling. Each configuration has a participants object that includes booking and availability objects…
availability - for checking availability across calendars (this works as needed)
booking - here you can specify which calendar to book the event to (for each participant), but there’s an interesting point, here’s your description for this field: “The booking data for the participant. If omitted, the participant is not included in the booked event. At least one participant must have booking data.”, meaning as I understand it - if for example the configuration has 2 participants - “josh” and “alex”, and for alex I didn’t pass booking - he should not be included in the event, but this doesn’t work as described… all participants are passed to the event anyway, regardless of whether you passed the booking field or not.

But in the /scheduling/bookings request - our problem with the incorrectly working booking is solved by the participants field which accepts a list of emails that should be included in the event (emails must be exclusively from the configuration)… and this works. For example, if I have josh, alex emails in my configuration, and when booking I only send josh - then alex won’t be a participant in the event (which is what we need).

But, there’s an important point - due to the fact that the booking field in the configuration doesn’t work as expected, the NylasScheduling component doesn’t allow excluding certain participants from my configuration in the event, and it turns out that every participant will be a participant anyway - and this doesn’t suit us.

NylasScheduling allows somewhat (though I haven’t found any real-life examples) overriding the base behavior. In overrideEvents each event has a connector parameter which contains this field - connector.scheduler.bookTimeslot and this method under the hood sends the same /scheduling/bookings, but the problem is that bookTimeslot doesn’t support the participants field from the /scheduling/bookings request.

I see 2 solution paths:

  1. You make the booking field in the configuration work as described (this option is higher priority)
  2. You add support for the participants field (for selecting emails from the configuration) in the connector.scheduler.bookTimeslot (nylas/web-elements lib) method

Please show this to the developers - they should understand the problem.

I’ll be waiting for your response, thank you