Need to filter the events based on startdatetime in Microsoft Graph API

Bhuvaneshwari.Balasubramaniam 1 Reputation point
2022-07-14T14:40:47.85+00:00

Hi Team,

I am trying to filter all events based on parameters such as sender, attendee, meeting scheduled time and the subject.

I am able to form the query with fromAddress and subject but need your support on adding attendee and meetingtime to the below endpoint.

For attendee, there should be only attendee and name should be test@Stuff .com

https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address eq 'anon@USER ' and subject eq 'test'

Please help in forming the query.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,587 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 5,946 Reputation points
    2022-07-14T17:02:34.707+00:00

    Hi @Bhuvaneshwari.Balasubramaniam

    Messages Graph API and Events Graph API both are different and they have different properties. So you can filter on these properties only at one Graph API at time. As you can see 'attendee' & 'meetingtime' properties are not present in messages documentation, so you cannot filter using these properties in messages Graph API.

    Further you can use Event Graph API. To get events based on startdatetime and Subject use this https://graph.microsoft.com/v1.0/me/calendar/events?$filter=start/dateTime eq '2022-07-14T12:30:00Z' and subject eq 'Testing' Graph API endpoint to filter events. This Graph API will retrieve Events based on Start date '2022-07-21' time '14:30:00' with subject 'Testing'.

    Please refer to the below sample request
    220912-testing2.png

    Hope this helps.

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