How to send calendar events to non microsoft accounts?

rpalm-driptraceio 0 Reputation points
2024-06-10T03:03:25.9266667+00:00

Question for Microsoft Support

Subject: Issue with Creating Calendar Events for Non-Microsoft Accounts

Description:

I am developing an application using the Microsoft Graph API to create calendar events for a doctor-patient appointment scheduling system. The patients do not need to be logged in to create an appointment. The application successfully creates events, but the events do not appear in the calendars of attendees who use non-Microsoft email accounts, such as Gmail. Below are the details of the scenario and the problem:

Scenario:

  1. Users: Patients can create appointments without logging in. Doctors have Microsoft accounts.
  2. Event Creation: The application attempts to create calendar events on behalf of patients using the Microsoft Graph API.
  3. Expected Outcome: The event should appear in the calendars of all attendees, regardless of their email provider.

Problem:

When trying to create a calendar event for a user with a non-Microsoft email account (e.g., Gmail), the event creation responds with a status of 201 (Created). However, the event does not appear in the attendee's calendar.

Code Snippet:

import type { NextApiRequest, NextApiResponse } from "next";

interface EventData {
    subject: string;
    startTime: string;
    endTime: string;
    timezone: string;
    userEmail: string;
    accessToken: string;
}

interface CreateEventRequestBody {
    eventData: EventData;
    userEmail: string;
    userToken: string;
}

interface ErrorResponse {
    message: string;
}

export default async function handler(
    req: NextApiRequest,
    res: NextApiResponse
Microsoft Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
6,149 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,447 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,386 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,629 questions
{count} votes