Fetching Organization Chart - API

Ayan Usmani 171 Reputation points
2022-08-26T06:05:30.183+00:00

I wanted to fetch org chart that gets displayed in Teams.
Also what API Permissions are required to make these calls.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,332 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,308 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 42,611 Reputation points
    2022-08-29T08:29:57.657+00:00

    Hi @Ayan Usmani

    Of course, you can list all team members under a given manager.

    235685-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. CarlZhao-MSFT 42,611 Reputation points
    2022-08-26T06:36:04.133+00:00

    Hi @Ayan Usmani

    Referring to the API documentation, you can list the user's immediate managers and even extend the manager's chain up to the root node.

    GET /users?$expand=manager  
    GET /users/{id | userPrincipalName}/?$expand=manager($levels=n)  
    

    Here are the permissions required to call this endpoint:

    235152-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Ayan Usmani 171 Reputation points
    2022-08-26T10:54:53.893+00:00

    Will this only list the managers ? ......... Because i wanted all the team members that are under a given manager as shown in teams org chart


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.