How to Ensure ICS Files are Displayed as RSVP Events Using Microsoft Graph API?

sivakaresh Navaretnam 0 Reputation points
2025-02-02T15:20:24.6533333+00:00

We are facing an issue with sending ICS files as RSVP calendar events using Microsoft Graph API (ModernAuthEmailLogic). Below are the details:

Background:

The ICS file works as expected with Gmail and Google Calendar, where it is interpreted as an RSVP event.

  With Outlook, the same ICS file is treated as a regular attachment. While users can manually add the ICS file to their calendar, subsequent updates to the ICS file do not automatically update the existing event as they do in Gmail.
  
  **What We've Tried**:
  
     When using **SMTPEmailLogic**, we resolved the issue by setting the email header as: `ContentType = "text/calendar; method=REQUEST; charset=UTF-8"` This caused the ICS file to display as an RSVP event in Outlook.
     
        However, when using **ModernAuthEmailLogic** (Microsoft Graph API), we are unable to set the `ContentType` in the same way. The Graph API sets the header as: `ContentType = "text/calendar;"` This results in the ICS file being treated as a normal attachment, not as an RSVP event.
        
  1. Sample API Call and Request Body: Endpoint: https://graph.microsoft.com/v1.0/users/{userID}/sendMail Request Body: { "message": { "subject": "Sample Event - Confirmation: 1/20/2025 2:00:00 PM", "body": { "content": "Dear Alex,\r\n Your Booking is Confirmed. Please refer below details\r\n 12345AlexEvent Name:Sample EventDate:20 Jan 2025Time:02:00 PMVenue/Facility:Community Center - Main HallBooking Name:Sample EventBooking Reference:REF12345Booking Status:ConfirmedNumber of Attendees:5\r\n Please find the attached event details in the ICS file format, which you can add to your calendar for easy reference.\r\n Should you have any questions or require further assistance, please do not hesitate to contact us.\r\n Best regards,\r\n Event Organizer\r\n Email: i***** Email address is removed for privacy \r\n \r\n", "contentType": "Html" }, "toRecipients": [ { "emailAddress": { "address": "sa*** Email address is removed for privacy ***" } } ], "attachments": [ { "@odata.type": "#microsoft.graph.fileAttachment", "name": "calendar.ics", "contentType": "text/calendar; method=REQUEST; charset=UTF-8", "contentBytes": "QkVHSU46VkNBTEVOREFSDQpWRVJTSU9OOjIuMA0KUFJPRElEOi0NCk1FVEhPRDpSRVFVRVNUDQpCRUdJTjpWRVZFTlQNClVJRDphYmNkZWYtMTIzNC1hYmMtMTIzNC01Njc4OTAxMjM0NTYNCkRUU1RBTVA6MjAyNTAxMjBUMTQwMDAwWg0KRFRTVEFSVDoyMDI1MDEyMFQxNjAwMDBaDQpEVEVORDoyMDI1MDEyMFQxODAwMDBaDQpTVU1NQVJZOiBTYW1wbGUgRXZlbnQNCkF0dGVuZGVlczoxDQpWZW51ZTogQ29tbXVuaXR5IENlbnRlciAtIE1haW4gSGFsbA0KTE9DQVRJT046DQpDbGllbnQgTmFtZTpBbGV4IEpvaG5zb24NCkRFU0NSSVBUSU9OOiBUaGlzIGlzIGEgc2FtcGxlIGV2ZW50Lg0KRU5EOlZFVkVOVA0KRU5EOlZDQUxFTkRBUg0K" } ] } } Request How can we ensure that ICS files are displayed as RSVP events in Outlook when using the Microsoft Graph API? Are there any alternative approaches or configurations to set the ContentType as "text/calendar; method=REQUEST; charset=UTF-8" with Microsoft Graph API? Any insights or recommendations would be greatly appreciated!
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,029 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.