Get information about External User / Guest User through API Graph

Loic Emissan 1 Reputation point
2022-01-19T12:51:54.93+00:00

We receive calls records using the Webhook. However, we are unable to get more information (display name and number) from Guest users and external users. The only possibility we have found so far is to find the call in the Team admin by going to the call history of our company user. how can we obtain this information via the API because the users/"tenant-id" requests do not allow us to find this information. Also, We are unable to export from the Team admin, all call events, it is possible to have only the logs going through the PSTN. We want a complete log of all Audio / Video sessions, VoIP, and PSTN.

Microsoft Graph Teamwork API
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. JanardhanaVedham-MSFT 3,526 Reputation points
    2022-01-20T06:59:20.927+00:00

    Hi @Loic Emissan ,

    Microsoft Graph Users API is available to query details of the guest users of your M365 tenant and it will return the available information of the guest user from Azure AD (as shown below). Microsoft Graph Users API retuns both guest users added/created in your tenant and external users invited to your tenant. Also, Graph Beta Users API is providing some more guest user's details compared to V1.0. Please note that APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is currently not supported by Microsoft. You can verify the below API and see if it is useful for you.

    GET https://graph.microsoft.com/v1.0/users?$select=Id,userPrincipalName,userType,displayName,mail,accountEnabled,creationType,externalUserState&$filter=userType eq 'Guest'  
    

    166639-image.png
    Note : "userType" property can be returned only on applying $select OData query option with V1.0 Graph API.

    GET https://graph.microsoft.com/beta/users?$filter=userType eq 'Guest'  
    GET https://graph.microsoft.com/beta/users/{id | userPrincipalName}  
    GET https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}  
    

    Note: Please note that APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is currently not supported by Microsoft.
    166664-image.png

    Documentation Sources :

    https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http
    https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0

    Hope this helps.

    If the answer is helpful and your question is resolved, 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.
    0 comments No comments

  2. Loic Emissan 1 Reputation point
    2022-01-24T15:09:02.78+00:00

    Hi @JanardhanaVedham-MSFT Thank you for your answers. It only returns the Guest Users that have been added, doesn't it? it doesn't return all the external users or Guests that I have talked to.


  3. JanardhanaVedham-MSFT 3,526 Reputation points
    2022-01-25T03:07:37.46+00:00

    Hi @LoicEmissan,

    Yes, Microsoft Graph Users API mentioned in the above answer retuns both guest users added/created in your tenant and external users invited to your tenant.

    Hope this helps.

    If the above provided 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".

    0 comments No comments