Share via

IsOnlineMeeting Becomes False When Updating Event via Microsoft Graph API

onyore 50 Reputation points
14 Oct 2024, 1:56 pm

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"
}
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,895 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,349 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yakun Huang-MSFT 10,555 Reputation points Microsoft External Staff
    15 Oct 2024, 5:27 am

    Hello onyore,

    Thank you for reaching out to Microsoft Support!

    After testing, the Update event endpoint works well, according to the document, when updating events, In the request body, supply only the values for properties to update. Only the properties listed in the document can be updated. Your Request JSON contains many properties that are not in the list. Please change the Request JSON according to the document.

    Here are my test results:

    Screenshot 2024-10-15 052527

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. onyore 50 Reputation points
    15 Oct 2024, 2:41 pm

    I Found It!!!

    When sending the request with the Body field included, the IsOnlineMeeting attribute breaks and the meeting loses its online status. After some testing, I realized that the issue occurs specifically when the Body content is part of the request. If I remove the Body field, the IsOnlineMeeting attribute remains intact, and the Join button is visible again.

    It seems there's a connection between the Body field in the request and the breaking of the IsOnlineMeeting functionality, though I'm not sure why this is happening. Even with simple HTML content or plain text, it still causes the problem.

    Would they help?
    User's image


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.