1
votes

I would like to query only Event Messages from Outlook Mail using the Microsoft GRAPH API. I could not find any information on this in the documentation for Microsoft Graph.

I have tried the following queries on the Graph Explorers, but none worked. It seems like Microsoft Graph does not support the IsOf (which filters the type of an object) filtering option. However, I have found that this feature is supported and documented for Azure GRAPH API.

https://graph.microsoft.com/v1.0/me/messages?$filter=isof('#microsoft.graph.eventMessage') eq true

https://graph.microsoft.com/v1.0/me/messages?$filter=isof('#microsoft.graph.eventMessage')

Does anyone know if the operation I tried to do is supported by the Microsoft Graph API? If not, is there anything else I can do to query only Event Messages?

1

1 Answers

0
votes

As URL: Query string parameters states for the $filter parameter:

Indicates which entity types should be included in the response. Optional. The supported entity types are: User, Group and Contact. Only valid when resourceSet is “directoryObjects”; otherwise, resourceSet overrides the filter.

For example,

https://graph.windows.net/contoso.com/directoryObjects?api-version=2013-04-05&$filter=isof('Microsoft.WindowsAzure.ActiveDirectory.User')

For Microsoft Graph, I checked Use query parameters, but did not find any samples. Then, I used Graph Explorer to test this scenario as follows:

enter image description here

I assumed that this operation is not supported by Microsoft Graph API for now. You could add your feature request here. Or you could use the $select query parameter to return a set of properties. Details you could follow here.