API Graph find the categories of an outlook email in a shared mailbox

RENAUD, Benjamin 0 Reputation points
2024-05-15T16:12:45.59+00:00

Hello,

I would like to retrieve the categories from an email in a shared mailbox :

https://graph.microsoft.com/v1.0/users/{user-id}/outlook/masterCategories

  • I have the message :User's image
  • I have the authorisation :User's image- in my token I have authorisation for Graph explorer : User's image

if {user-id} is my mailbox then the API works, but if {user-id} is a shared mailbox (which I can access from my Outlook) the API tells me that I don't have the authorisations.

Do you have any idea why Graph Explorer is telling me I don't have authorisation ?

Regards

Outlook Windows Classic Outlook for Windows For business
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-05-16T05:32:46.88+00:00

    Hi @RENAUD, Benjamin

    With delegated permission MailboxSettings.ReadWrite you can't read/write outlook categories of other users due to security. Graph Explorer requires the user to log in, and all permissions used are delegated, so you cannot use Explorer.

    Only way to read/write outlook categories is with application permission MailboxSettings.ReadWrite. First you need to create an app in the Entra ID, and then you need to get a token with the client credentials flow, test it in postman.

    Screenshot 2024-05-16 105618

    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.

    0 comments No comments

  2. Hitesh Pachipulusu - MSFT 3,620 Reputation points Microsoft External Staff
    2024-05-16T11:59:31.4233333+00:00

    Hello @RENAUD Benjamin ,

    Graph Explorer is unable to access the mailbox settings of a Shared Mailbox, as it operates solely with Delegated permissions.

    Using Application Permissions, we can achieve it. For this you can use postman.

    Please check below screenshot of permissions required to consent in App registrations.

    mail permissions azure

    Below is for reference using postman. mailbox settings postman

    Hope this helps. If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

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.