I'm encountering an issue when updating a Microsoft Teams meeting via the Microsoft Graph API. Despite sending the IsOnlineMeeting = true
value in my request, the response I get shows IsOnlineMeeting = false
, and the meeting loses its online status.
I'm using the exact request format from the Graph API documentation example. The event is an online Teams meeting, and while updating, the online status is not retained.
Could you please provide any guidance or a solution to ensure the online meeting settings are preserved during the update?
Thank you.
public async Task<Result<string>> UpdateMeeting(UpdateMeetingRequestDto updateMeetingDto, MeetingRequestDto dto)
{
try
{
var graphClient = CreateGraphClient(dto);
var existingEvent = await graphClient.Users[dto.UserId].Events[updateMeetingDto.EventId].GetAsync();
if (existingEvent == null)
{
return Result<string>.Failure("Meeting not found.");
}
var requestBody = new Event
{
Subject = updateMeetingDto.UpdatedSubject,
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = updateMeetingDto.UpdatedContent
},
OriginalStartTimeZone = existingEvent.OriginalStartTimeZone,
OriginalEndTimeZone = existingEvent.OriginalEndTimeZone,
ResponseStatus = new ResponseStatus
{
Response = ResponseType.None,
Time = DateTimeOffset.UtcNow
},
Recurrence = null,
ReminderMinutesBeforeStart = existingEvent.ReminderMinutesBeforeStart ?? 99,
IsOnlineMeeting = existingEvent.IsOnlineMeeting ?? true,
OnlineMeetingProvider = existingEvent.OnlineMeetingProvider ?? OnlineMeetingProviderType.TeamsForBusiness,
IsReminderOn = existingEvent.IsReminderOn ?? true,
HideAttendees = false,
Categories = new List<string> { "Red category" }
};
await graphClient.Users[dto.UserId].Events[updateMeetingDto.EventId].PatchAsync(requestBody);
return Result<string>.Success("Meeting updated successfully.");
}
catch (Exception ex)
{
return Result<string>.Failure($"Failed to update meeting: {ex.Message}");
}
}
Request JSON:
{
"AllowNewTimeProposals": null,
"Attachments": null,
"Attendees": null,
"Body": {
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"Content": "Update Description",
"ContentType": 1,
"OdataType": null
},
"BodyPreview": null,
"Calendar": null,
"End": null,
"Extensions": null,
"HasAttachments": null,
"HideAttendees": false,
"ICalUId": null,
"Importance": null,
"Instances": null,
"IsAllDay": null,
"IsCancelled": null,
"IsDraft": null,
"IsOnlineMeeting": true,
"IsOrganizer": null,
"IsReminderOn": true,
"Location": null,
"Locations": null,
"MultiValueExtendedProperties": null,
"OnlineMeeting": null,
"OnlineMeetingProvider": 3,
"OnlineMeetingUrl": null,
"Organizer": null,
"OriginalEndTimeZone": "Europe/Istanbul",
"OriginalStart": null,
"OriginalStartTimeZone": "Europe/Istanbul",
"Recurrence": null,
"ReminderMinutesBeforeStart": 15,
"ResponseRequested": null,
"ResponseStatus": {
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"OdataType": null,
"Response": 0,
"Time": "2024-10-14T13:42:04.5563943+00:00"
},
"Sensitivity": null,
"SeriesMasterId": null,
"ShowAs": null,
"SingleValueExtendedProperties": null,
"Start": null,
"Subject": "Update Join Button Test 2024-10-15 09:40",
"TransactionId": null,
"Type": null,
"WebLink": null,
"Categories": [
"Red category"
],
"ChangeKey": null,
"CreatedDateTime": null,
"LastModifiedDateTime": null,
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"Id": null,
"OdataType": "#microsoft.graph.event"
}
Response JSON:
{
"AllowNewTimeProposals": true,
"Attachments": null,
"Attendees": [
{
"ProposedNewTime": null,
"Status": {
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": false
},
"OdataType": null,
"Response": 0,
"Time": "0001-01-01T00:00:00+00:00"
},
"Type": 0,
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": false
},
"EmailAddress": {
"AdditionalData": {},
"Address": "******@ext.logo.com.tr",
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": false
},
"Name": "Onur Yildiz (EXT)",
"OdataType": null
},
"OdataType": "#microsoft.graph.attendee"
}
],
"Body": {
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body>\r\nUpdate Description\r\n</body>\r\n</html>\r\n",
"ContentType": 1,
"OdataType": null
},
"BodyPreview": "Update Description",
"Calendar": null,
"End": {
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"DateTime": "2024-10-15T06:40:00.0000000",
"OdataType": null,
"TimeZone": "UTC"
},
"Extensions": null,
"HasAttachments": false,
"HideAttendees": false,
"ICalUId": "040000008200E00074C5B7101A82E00800000000EA5A27D03E1EDB01000000000000000010000000A74686D308233C4786D2BF1056D362DD",
"Importance": 1,
"Instances": null,
"IsAllDay": false,
"IsCancelled": false,
"IsDraft": false,
"IsOnlineMeeting": false,
"IsOrganizer": true,
"IsReminderOn": true,
"Location": {
"AdditionalData": {},
"Address": {
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"City": null,
"CountryOrRegion": null,
"OdataType": null,
"PostalCode": null,
"State": null,
"Street": null
},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"Coordinates": {
"Accuracy": null,
"AdditionalData": {},
"Altitude": null,
"AltitudeAccuracy": null,
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"Latitude": null,
"Longitude": null,
"OdataType": null
},
"DisplayName": "",
"LocationEmailAddress": null,
"LocationType": 0,
"LocationUri": null,
"OdataType": null,
"UniqueId": null,
"UniqueIdType": 0
},
"Locations": [],
"MultiValueExtendedProperties": null,
"OnlineMeeting": null,
"OnlineMeetingProvider": 0,
"OnlineMeetingUrl": null,
"Organizer": {
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"EmailAddress": {
"AdditionalData": {},
"Address": "******@peoplise.com",
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"Name": "Nail Diker",
"OdataType": null
},
"OdataType": null
},
"OriginalEndTimeZone": "Europe/Istanbul",
"OriginalStart": null,
"OriginalStartTimeZone": "Europe/Istanbul",
"Recurrence": null,
"ReminderMinutesBeforeStart": 15,
"ResponseRequested": true,
"ResponseStatus": {
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"OdataType": null,
"Response": 1,
"Time": "0001-01-01T00:00:00+00:00"
},
"Sensitivity": 0,
"SeriesMasterId": null,
"ShowAs": 3,
"SingleValueExtendedProperties": null,
"Start": {
"AdditionalData": {},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"DateTime": "2024-10-15T06:30:00.0000000",
"OdataType": null,
"TimeZone": "UTC"
},
"Subject": "Update Join Button Test 2024-10-15 09:40",
"TransactionId": null,
"Type": 0,
"WebLink": "https://outlook.office365.com/owa/?itemid=AAMkAGNlZjdmYzYwLTQ3MDYtNDFiNi05YmE4LTRjMGJmZjE2NGQwNABGAAAAAADw%2Fq6PJzc0QaB6ZTQN2YvDBwDT8Vbk880XTLLcGak1OsrhAAAAmdzxAAD0B85A2%2BYuRqEYGFd%2FHjmDAAc23P98AAA%3D&exvsurl=1&path=/calendar/item",
"Categories": [
"Red category"
],
"ChangeKey": "9AfOQNvmLkahGBhXfx45gwAHMcOJ0g==",
"CreatedDateTime": "2024-10-14T13:41:46.6718739+00:00",
"LastModifiedDateTime": "2024-10-14T13:42:05.7243471+00:00",
"AdditionalData": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('ddf8f734-9d8b-4c43-a8c1-4d802a5948b4')/events/$entity",
"@odata.etag": "W/\"9AfOQNvmLkahGBhXfx45gwAHMcOJ0g==\"",
"uid": "040000008200E00074C5B7101A82E00800000000EA5A27D03E1EDB01000000000000000010000000A74686D308233C4786D2BF1056D362DD",
"occurrenceId": null
},
"BackingStore": {
"ReturnOnlyChangedValues": false,
"InitializationCompleted": true
},
"Id": "AAMkAGNlZjdmYzYwLTQ3MDYtNDFiNi05YmE4LTRjMGJmZjE2NGQwNABGAAAAAADw-q6PJzc0QaB6ZTQN2YvDBwDT8Vbk880XTLLcGak1OsrhAAAAmdzxAAD0B85A2_YuRqEYGFd-HjmDAAc23P98AAA=",
"OdataType": "#microsoft.graph.event"
}