Where are a users contacts or a users company contacts stored in teams?

Daniel Dunér 1 Reputation point
2023-01-03T13:50:09.693+00:00

Hi I am trying to use microsoft graph api to retrieve a users contacts from teams, where should I look for this?

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

2 answers

Sort by: Most helpful
  1. Martin Dimovski 1,591 Reputation points MVP
    2023-01-03T15:15:31.257+00:00

    Hi,

    Thank you for posting the question to the Q&A forum.

    If you want to use Microsoft Graph API to retrieve the contacts from Teams, please refer on the below link: https://learn.microsoft.com/en-us/graph/api/user-list-contacts?view=graph-rest-1.0&tabs=http

    All of the contacts on the user default can be checked from here:

    Contacts folder:

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

    Also, to get contacts in a specific folder in the user's mailbox use below API query:

       GET https://graph.microsoft.com/v1.0/me/contactfolders/{Id}/contacts  
       GET https://graph.microsoft.com/v1.0/me/contactfolders/{Id}/contacts GET /users/{id |userPrincipalName}/contactfolders/{id}/contacts  
    

    I hope the above information can help you.

    If the ANSWER is helpful, please click "Accept Answer" and upvote it. Thanks

    0 comments No comments

  2. Srinivasa Rao Darna 6,696 Reputation points Microsoft Vendor
    2023-01-05T16:49:21.263+00:00

    Hello @Daniel Dunér ,

    Contacts stored in Teams are superset of personal contacts from outlook.
    You can use /me/contacts or /users/{id | userPrincipalName}/contacts to get outlook contacts.

    But currently there is no API available to get contacts which are stored in teams but not in available in outlook.

    Since there is no Graph API, request you to create feature request in graph feedback portal, that will be monitored by Microsoft Product Engineering teams and will be considered for implementation based on number of votes received and people requesting for the same.

    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