cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Seamless Integration of MS Teams Calls in office365calendar and office365video

Open robertfels opened this issue 3 months ago • 2 comments

Is your proposal related to a problem?

I'm frustrated when trying to integrate office365calendar and office365video, as they do not work together seamlessly. Specifically, I want to create an MS Teams call directly when using both tools, enabling participation through a single button click. Currently, office365video only generates a link and passes it to the calendar, which creates the invitation. Ideally, the calendar entry could be created directly within office365video, allowing for direct joining.

Describe the solution you'd like

I would like a feature that allows office365video to directly create a calendar entry within office365calendar. This would streamline the process, enabling a direct MS Teams call setup with a single click for participants. This integration should automatically generate the MS Teams meeting link and include it in the calendar invitation, ensuring a smooth and efficient workflow.

Describe alternatives you've considered

I have considered manually copying the MS Teams meeting link generated by office365video and pasting it into a calendar event in office365calendar. However, this method is cumbersome and prone to errors, as it requires additional steps and manual intervention. Another alternative is using third-party integration tools, but these often come with additional costs and complexity.

Additional context

The seamless integration of office365calendar and office365video would greatly enhance productivity by simplifying the process of scheduling and joining MS Teams calls. This feature would be especially useful for users who frequently host virtual meetings and need an efficient way to manage their schedules.

Requirement/Document

A technical document outlining the integration process between office365calendar and office365video, detailing how to enable the direct creation of MS Teams meeting links within calendar invitations, would support this feature. This document should include API references, necessary permissions, and step-by-step implementation guidelines.


House rules
  • If this issue has a 🚨 needs approval label, don't start coding yet. Wait until a core member approves feature request by removing this label, then you can start coding.
    • For clarity: Non-core member issues automatically get the 🚨 needs approval label.
    • Your feature ideas are invaluable to us! However, they undergo review to ensure alignment with the product's direction.

robertfels avatar May 21 '24 05:05 robertfels

POST https://graph.microsoft.com/v1.0/me/calendars/AAMkAGViNDU9zAAAAAGtlAAA=/events
Content-type: application/json

{
  "subject": "Let's go for lunch",
  "body": {
    "contentType": "HTML",
    "content": "Does next month work for you?"
  },
  "start": {
      "dateTime": "2019-03-10T12:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "end": {
      "dateTime": "2019-03-10T14:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "location":{
      "displayName":"Harry's Bar"
  },
  "attendees": [
    {
      "emailAddress": {
        "address":"[email protected]",
        "name": "Adele Vance"
      },
      "type": "required"
    }
  ],
  "isOnlineMeeting": true,
  "onlineMeetingProvider": "teamsForBusiness"
}

robertfels avatar May 21 '24 05:05 robertfels

Maybe something like this CalendarService.ts in office365calendar/lib:

private translateEvent = (event: CalendarEvent) => {
    const locationUrl = getLocation(event);
    const isTeamsMeeting = locationUrl && locationUrl.includes("teams.microsoft.com");
    const eventDetails: any = {
      subject: event.title,
      body: {
        contentType: "HTML",
        content: getRichDescription(event),
      },
      start: {
        dateTime: dayjs(event.startTime).tz(event.organizer.timeZone).format("YYYY-MM-DDTHH:mm:ss"),
        timeZone: event.organizer.timeZone,
      },
      end: {
        dateTime: dayjs(event.endTime).tz(event.organizer.timeZone).format("YYYY-MM-DDTHH:mm:ss"),
        timeZone: event.organizer.timeZone,
      },
      attendees: [
        {
          emailAddress: {
            address: event.destinationCalendar
              ? event.destinationCalendar.find((cal) => cal.userId === event.organizer.id)?.externalId ??
                event.organizer.email
              : event.organizer.email,
            name: event.organizer.name,
          },
        },
        ...event.attendees.map((attendee) => ({
          emailAddress: {
            address: attendee.email,
            name: attendee.name,
          },
          type: "required",
        })),
        ...(event.team?.members
          ? event.team?.members
              .filter((member) => member.email !== this.credential.user?.email)
              .map((member) => {
                const destinationCalendar =
                  event.destinationCalendar &&
                  event.destinationCalendar.find((cal) => cal.userId === member.id);
                return {
                  emailAddress: {
                    address: destinationCalendar?.externalId ?? member.email,
                    name: member.name,
                  },
                  type: "required",
                };
              })
          : []),
      ],
    };
  
    if (isTeamsMeeting) {
      eventDetails.isOnlineMeeting = true;
      eventDetails.onlineMeetingProvider = "teamsForBusiness";
    } else if (locationUrl) {
      eventDetails.location = { displayName: locationUrl };
    }
  
    return eventDetails;
  };

robertfels avatar May 21 '24 06:05 robertfels