Search code examples
microsoft-graph-apimicrosoft-graph-mailmicrosoft-graph-calendar

Get EventMessage Associated with Event in MS Graph API


I am creating a service that needs to decline events, when certain conditions are met, from a room's perspective and update the event on attendees' calendars.

While declining the meeting is simple, I am struggling to update the event on a user's calendar. I assume that I would do this using update eventMessage.

Right now I have the ID of the event that is declined and I need to associate that event with its eventMessage. Therefore, I am making the following request:

`/users/${roomEmail}/messages?$expand=microsoft.graph.eventMessage/event($select=id;$filter=id eq ${meetingId})`

What I am trying to do is get all messages, then expand so that I see the events associated with each message, then filter each event by its ID until I find the event that I care about. Once I have that event, I can send an update to its eventMessage.

However, I get the error "Parsing Select and Expand failed."

Where am I going wrong?


Solution

  • As the id is not a number value, I believe you may need to add single quotes around the meetingID parameter at the end.

    `/users/${roomEmail}/messages?$expand=microsoft.graph.eventMessage/event($select=id;$filter=id eq '${meetingId})'`
    

    https://learn.microsoft.com/en-us/dynamics-nav/using-filter-expressions-in-odata-uris#referencing-different-data-types-in-filter-expressions