How to send calendar events to non microsoft accounts?
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:
- Users: Patients can create appointments without logging in. Doctors have Microsoft accounts.
- Event Creation: The application attempts to create calendar events on behalf of patients using the Microsoft Graph API.
- 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