question

JulienSarlat-2493 avatar image
0 Votes"
JulienSarlat-2493 asked GlenScales-6756 answered

Retrieve messages and displaynamed of the folder

Hello,

I would like to retrieve all the messages in my inbox including the displayed name of the folder the messages are in in one call.

So far I onlw find this https://docs.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0&tabs=http that gives me the parentFolderId but not the displayed name of the folder ("inbox" for example)

How can I do?

microsoft-graph-mail
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

GlenScales-6756 avatar image
0 Votes"
GlenScales-6756 answered

You can use the PidTagParentDisplay property https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtagparentdisplay-canonical-property?WT.mc_id=M365-MVP-10145 which you request as a singleValueExtendedProperties like

 https://graph.microsoft.com/v1.0/me/messages?$expand=singleValueExtendedProperties($filter=id%20eq%20'String%200x0E05')

and it will return eg

            ],
             "ccRecipients": [],
             "bccRecipients": [],
             "replyTo": [],
             "flag": {
                 "flagStatus": "notFlagged"
             },
             "singleValueExtendedProperties@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('1c...0')/messages('A...A%3D')/singleValueExtendedProperties",
             "singleValueExtendedProperties": [
                 {
                     "id": "String 0xe05",
                     "value": "Inbox"
                 }
             ]
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.