Filtering messages in the Graph API by their type

When reading user's messages

GET /me/messages
GET /users/{id | userPrincipalName}/messages

The response body contains a collection of Message objects.

  • message resource type is a base type for
    • eventMessage - message that represents a meeting request, cancellation, or response entity
    • calendarSharingMessage - message that represents a calendar sharing request
  • eventMessage resource type is the base type for
    • eventMessageRequest - message that represents a meeting request in an invitee's mailbox
    • eventMessageResponse - message that represents a response to a meeting request in the meeting organizer's mailbox

What if you need to filter the messages based on their type?

Neither casting

GET /me/messages/microsoft.graph.message

Nor filtering using the isof canonical function, which should return all instances assignable to the type specified,

GET /me/messages?$filter=isof('microsoft.graph.message')

are supported by the Graph Message API.

We need to try another way.

There is a tool called MFCMapi, which can be run on a machine with Outlook installed to connect to the user's mailbox and explore all of the MAPI properties on a specific item.

The Graph API can access arbitrary MAPI properties via extended properties.

MFCMapi and exploring MAPI properties

Download the latest release of the MFCMapi.

Open MFCMapi and logon to your mailbox:


Select your default store and open the inbox folder:


Explore different messages and compare their properties


Many messages have different value of the canonical property PidTagMessageClass.


The table below shows how the value of the PidTagMessageClass is related to the type of the message

Graph type PidTagMessageClass value
microsoft.graph.message IPM.Note, IPM.Note.SMIME.MultipartSigned
microsoft.graph.eventMessageRequest IPM.Schedule.Meeting.Request
microsoft.graph.eventMessageResponse IPM.Schedule.Meeting.Resp.Pos
microsoft.graph.calendarSharingMessage IPM.Sharing

The canonical property PidTagMessageClass specifies the type of the message. MAPI data type is PT_UNICODE which is the equivalent to the String type in the Graph API. The property tag is 0x001A.

The Graph API can identify the property by its type and by the property tag. The id of the single-value extended property will be String 0x001A.

Now, you can filter messages by the single-value extended property.

Filter microsoft.graph.message

Filter messages by extended property and add a restriction for a value

GET /v1.0/me/messages?$filter=singleValueExtendedProperties/Any(ep: ep/id eq 'String 0x001A' and contains(ep/value, 'IPM.Note'))

Use contains in the filter to handle both PidTagMessageClass values IPM.Note and IPM.Note.SMIME.MultipartSigned.

Filter microsoft.graph.eventMessageRequest

GET /v1.0/me/messages?$filter=singleValueExtendedProperties/Any(ep: ep/id eq 'String 0x001A' and ep/value eq 'IPM.Schedule.Meeting.Request')

Filter microsoft.graph.eventMessageResponse

GET /v1.0/me/messages?$filter=singleValueExtendedProperties/Any(ep: ep/id eq 'String 0x001A' and ep/value eq 'IPM.Schedule.Meeting.Resp.Pos')

Filter microsoft.graph.calendarSharingMessage

GET /v1.0/me/messages?$filter=singleValueExtendedProperties/Any(ep: ep/id eq 'String 0x001A' and ep/value eq 'IPM.Sharing')


Filtering messages by their type is not directly supported by the Graph API. Today, only way is to filter messages by the canonical property PidTagMessageClass, represented by single-value extended property String 0x001A.

Buy Me a Coffee at
An error has occurred. This application may no longer respond until reloaded. Reload x