Is it possible to access the root folder of a delegated mailbox in Outlook?

Diksha Yadav 61 Reputation points
2023-11-07T06:30:47.9366667+00:00

When trying to access users/<emailid>/messages for a delegated mailbox, I receive a 404 error. Is there a way to give a delegate user access to the root folder of a delegated mailbox? The error message I'm receiving is:

{
    "error": {
        "code": "ErrorItemNotFound",
        "message": "The specified object was not found in the store., Default folder AllItems not found."
    }
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,274 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 42,526 Reputation points
    2023-11-07T08:32:49.08+00:00

    Hi @Diksha Yadav

    Did you forget to pass the mailbox folder id? It should be:

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

    If the target user only delegates you to access their specific mailbox folder, then you will be able to list all the mails in that folder. If the target user delegates you to access their entire mailbox, then you will be able to list all the mails of the target user. vice versa.

    Reference: Get Outlook messages in a shared or delegated folder.

    Hope this helps.

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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.