microsoft-graph-apimicrosoft-graph-sdksmicrosoft-graph-calendar

Retrieve subject line from the organiser rather than invitee's using Microsoft Graph API


Just to start off, anything in the {} is just a variable passed in a foreach loop - but for simplicity's sake...

I am currently calling the Microsoft Graph API to call our meeting room calendar, and list the next 3 events:

https://graph.microsoft.com/v1.0/users/{id}/calendar/calendarView?StartDateTime=YYYY-MM-DDT08:00:00.0000000Z&EndDateTime=YYYY-MM-DDT18:00:00.0000000Z&select=start,end,organizer,subject

Which will return the correct details for that room, and its events:

Array (
    [@odata.etag] => W/"1QAcmk6aukS..."
    [id] => AAMkADRkM2I5MTk5LTZmO...

    [subject] => {Organiser's First Last} 

    [start] => Array (
        [dateTime]      => 2019-05-10T09:15:00.0000000
    )

    [end] => Array (
        [dateTime]      => 2019-05-10T09:30:00.0000000
    )

    [organizer] => Array (
        [emailAddress] => Array (
            [name]      => First Last
            [address]   => email@domain.ltd
        )

    )
)

However, as you can see I am getting the subject as the organiser's name rather than the meeting subject. This is a result of the room not being the organiser and their calendar stating they have a meeting with said person.

Is there a way to look up that organiser's subject for that meeting and having it pull the correct subject line?

I have tried using the [id] but they don't seem to match the user <-> room [id].

I have tried running the API call as so:

https://graph.microsoft.com/v1.0/users/{[organizer][email][address]}/calendar/calendarView?StartDateTime={[start][dateTime]}&EndDateTime={[end][dateTime]}&select=subject

Which works only if there are no all day events or overlapping events for that user.

Is there a way to correlate these items?


Solution

  • https://medium.com/meeting-room-365/issue-display-shows-organizers-name-instead-of-subject-731f4cf414ac

    Short version:

    Set-CalendarProcessing -Identity RESOURCEMAILBOX -DeleteSubject $False -AddOrganizerToSubject $False