Outlook Open Another Mailbox ErrorFolderNotFound

Declan 1 Reputation point
2022-01-21T03:06:20.27+00:00

0

I am trying to open another mailbox from Outlook/Access a different email account using the Graph API. Within the exchange admin centre, I have enabled Full Access to the mailbox I am trying to access. However when I try open the account the account from Outlook using 'Open Another mailbox' I get this error:

UTC Date: 2022-01-20T04:32:42.882Z
BootResult: accessDenied
Client Version: 20220110007.08
err: Microsoft.Exchange.Data.StoreObjects.AccessDeniedException
esrc: StartupData
et: ServerError
estack: Microsoft.Mapi.MapiExceptionNoAccess
st: 500
ehk: X-OWA-Error
efe: SY6PR01CA0002
ebe: SY4PR01MB6948
ewsver: 15.20.4909.8
emsg: ErrorPermissionDenied
I've also tried doing this through the Graph Explorer using the endpoint (https://graph.microsoft.com/v1.0/users/userId/messages)But I get an error saying the folder is unavailable.

{
"error": {
"code": "ErrorFolderNotFound",
"message": "The specified folder could not be found in the store.",
"innerError": {
"date": "2022-01-20T04:41:59",
"request-id": "4f835246-029b-47af-86d5-15f5dbb52bde",
"client-request-id": "20ae4819-d85e-dd92-fe6b-14fda438e947"
}
}
}
Am I missing some permission set or something? The user I am using I believe is an admin.

Microsoft Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
5,554 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,692 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,617 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JanardhanaVedham-MSFT 3,536 Reputation points
    2022-01-21T04:47:19.077+00:00

    Hi @Declan ,

    Microsoft Graph Explorer app executes Microsoft Graph APIs under delegated permissions scope. When delegated permissions scope is being used, Mail.ReadBasic, Mail.Read only provides access to the authenticated user's mailbox (the only exception being those that have been explicitly shared with that user). When application permissions scope is being used, Mail.ReadBasic.All, Mail.Read provides access to any user's mailbox.

    As mentioned in this documentation ,there are two scenarios where an app can get messages in another user's mail folder:

    1. If the app has application permissions, or,
    2. If the app has the appropriate delegated permissions from one user, and another user has shared a mail folder with that user, or, has given delegated access to that user. You can use the delegated permissions, Mail.Read.Shared or Mail.ReadWrite.Shared, to respectively read or write messages in a shared or delegated folder. See Get Outlook messages in a shared or delegated folder to help you achieving this.

    As an example, Shared "Inbox" mail floder of another user : demouser@o365XXXX.onmicrosoft.com and able to access that user's "Inbox" folder emails :

    GET https://graph.microsoft.com/v1.0/users/{Other User's -userId | -userPrincipalName}/mailfolders('Inbox')/messages  
    

    Example:

    GET https://graph.microsoft.com/v1.0/users/demouser@o365XXXX.onmicrosoft.com/mailfolders('Inbox')/messages  
    

    167155-image.png

    167171-image.png

    Exchange Online Administrators can be able to grant the permissions on user's mailboxes from Exchange Online Admin Center.

    167503-image.png
    167511-exo-admin-center-grant-mailbox-permissions.jpg
    167450-image.png

    Below Graph API can be used to fetch email messages of an user :

    GET https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/messages  
    

    Example :

    GET https://graph.microsoft.com/v1.0/users/sampleuser@o365XXXX.onmicrosoft.com/messages  
    

    167430-image.png

    References:
    Please refer the below documenation links for more information on this:
    https://learn.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0&tabs=http
    https://learn.microsoft.com/en-us/graph/outlook-share-messages-folders

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it ,so that it will be helpful to the other community users. If you have any further questions about this answer, please click "Comment".

    1 person found this answer helpful.