How to access the categories or the tags of an email in the shared outlookmailbox using logic app

Pragiri 0 Reputation points
2025-05-02T03:52:08.5333333+00:00

I want to access the category or the tag assigned to an email in the shared mailbox using logic app

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,591 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rukmini 2,021 Reputation points Microsoft External Staff Moderator
    2025-05-06T06:37:09.7933333+00:00

    Hello @Pragiri,

    To access the category assigned to an email in the shared mailbox using logic app, check the below:

    Create a Microsoft Entra ID application and grant below application type API permissions:

    User's image

    To fetch the masterCategories of Shared mailbox generate the access token using client credential flow:

    
    POST https://login.microsoftonline.com/TenantID/oauth2/v2.0/token
    
    grant_type=client_credentials  
    
    &client_id=ClientID  
    
    &client_secret=Secret  
    
    &scope=https://graph.microsoft.com/.default
    
    

    Pass the Headers as Content-Type : application/x-www-form-urlencoded

    User's image

    Generated access token:

    User's image

    Now use the below API to fetch the masterCategories of Shared mailbox like below:

    
    https://graph.microsoft.com/v1.0/users/******@xxx.onmicrosoft.com/outlook/masterCategories
    
    

    And pass Headers as Authorization : Bearer access_token

    • access_token value is triggerBody()['access_token]

    User's image

    When I run the workflow, successfully got the response:

    User's image

    Reference:

    API Graph find the categories of an outlook email in a shared mailbox - Microsoft Q&A

    Hope this clarifies things!


    If this answers your query, do click Accept Answer and Yes for was this answer helpful, which may help members with similar questions. User's image

    If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.


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.