Search code examples
azure-active-directorymicrosoft-graph-apimicrosoft-teamsgraph-explorer

I need to add co-organizer in teams meeting through graph api


I am using the https://graph.microsoft.com/v1.0/me/events/ endpoint This is my json code:

{
'subject': 'Test meeting',
'body': {
    'contentType': 'HTML',
    'content': 'Group code: Hello'
},
'start': {
    'dateTime': '2023-02-25T12:30',
    'timeZone': 'Europe/Sofia'
},
'end': {
    'dateTime': '2023-02-25T13:30',
    'timeZone': 'Europe/Sofia'
},
'attendees': [
    {
        'status': {
            'response': 'accepted',
            'time': '0001-01-01T00:00:00Z'
        },
        'emailAddress': {
            'address': '[email protected]',
            'name': 'Name'
        },
        'type': 'required'
    }
],
'allowNewTimeProposals': true,
'isOnlineMeeting': true,
'onlineMeetingProvider': 'teamsForBusiness'
}

It successfully makes a meeting and adding the participants to it, but I need to assign the participants a role 'co-organizers'. Please help!

I have tried searching on the forums, I have read the whole ms graph documentation, there is no info...


Solution

  • You’re using the create event endpoint. This has no way to change the meeting options. It’s not a meeting endpoint. It’s the events endpoint that has an option to also create a basic online meeting for the event.

    For changing the meeting options, you should search for the meeting id and then call the update onlineMeeting endpoint. That does allow setting all the properties you need.

    You won't get the correct id to edit the meeting when creating the event (which is a shame and would help a lot when you want to do these kind of things).

    1. Create the event with on of the event endpoints like create event
    2. Fetch the correct online meeting id, with the code in this sample GET /me/onlineMeetings?$filter=JoinWebUrl%20eq%20'{joinWebUrl}'
    3. Update the correct meeting with the update onlineMeeting endpoint.