I am using
https://developer.microsoft.com/graph/graph-explorer/
to test out some things. When I use
https://graph.microsoft.com/v1.0/me/mailFolders
https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages
I get what I expect, a list of my folders and messages in my Inbox. When change me to my email address I get the same information. Now when I try using a different mailbox I have access to and try to get the messages in "Interesting Messages" I get the ErrorInvalidIdMalformed. I assume the issue is the space in the path
https://graph.microsoft.com/v1.0/users/[email protected]/mailFolders/Interesting Messages/messages
{
"error": {
"code": "ErrorInvalidIdMalformed",
"message": "Id is malformed.",
"innerError": {
"request-id": "f47d4c3b-5681-4b83-b8f4-c2b9be591ff6",
"date": "2019-02-07T22:39:31"
}
}
I've tried using %20 instead of the space and I still get the error. Is there a way of having spaces in the URL or do I need to get the mailbox renamed?
TIA, Joe
As per the docs for get messages https://learn.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0
GET /users/[email protected]/mailFolders/{id}/messages
You have to use the {id} of the mailFolder. That's why you are getting "ErrorInvalidIdMalformed" as its expecting an id.
You can get this by calling
GET /users/{id | userPrincipalName}/mailFolders
https://learn.microsoft.com/en-us/graph/api/user-list-mailfolders?view=graph-rest-1.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With