SOLVED

Teams bot api to fetch the list of all users in a Microsoft tenant

%3CLINGO-SUB%20id%3D%22lingo-sub-1440066%22%20slang%3D%22en-US%22%3ETeams%20bot%20api%20to%20fetch%20the%20list%20of%20all%20users%20in%20a%20Microsoft%20tenant%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1440066%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20any%20api%20to%20fetch%20the%20list%20of%20all%20users%20available%20in%20Microsoft%26nbsp%3B%20tenant.%3C%2FP%3E%0A%3CP%3EI'm%20searching%20for%20something%2C%20similar%20to%20mentioned%20in%20the%20link%20%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fresources%2Fbot-v3%2Fbots-context%23fetching-the-team-roster%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EFetching%20the%20team%20roaster%3C%2FA%3E%20api%2C%20but%20to%20get%20the%20list%20of%20all%20user%20in%20a%20tenant.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExpected%20response%20similar%20to%20%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%22id%22%3A%20%2229%3A1GcS4EyB_oSI8A88XmWBN7NJFyMqe3QGnJdgLfFGkJnVelzRGos0bPbpsfJjcbAD22bmKc4GMbrY2g4JDrrA8vM06X1-cHHle4zOE6U4ttcc%22%2C%20%0A%22objectId%22%3A%20%229d3e08f9-a7ae-43aa-a4d3-de3f319a8a9c%22%2C%20%0A%22givenName%22%3A%20%22Larry%22%2C%20%0A%22surname%22%3A%20%22Brown%22%2C%20%0A%22email%22%3A%20%22Larry.Brown%40fabrikam.com%22%2C%20%0A%22userPrincipalName%22%3A%20%22labrown%40fabrikam.com%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1440066%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBots%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1496671%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20bot%20api%20to%20fetch%20the%20list%20of%20all%20users%20in%20a%20Microsoft%20tenant%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1496671%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F293468%22%20target%3D%22_blank%22%3E%40Sanket26%3C%2FA%3E%26nbsp%3BI%20would%20suggest%20trying%20the%20'List%20Users'%20function%20in%20Graph%2C%20please%20let%20me%20know%20if%20this%20helps%20resolve%20your%20issue.%20Check%20out%20the%20documentation%20here%3A%26nbsp%3B%20%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fuser-list%3Fview%3Dgraph-rest-1.0%26amp%3Btabs%3Dhttp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fuser-list%3Fview%3Dgraph-rest-1.0%26amp%3Btabs%3Dhttp%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Microsoft

Is there any api to fetch the list of all users available in Microsoft  tenant.

I'm searching for something, similar to mentioned in the link : Fetching the team roaster api, but to get the list of all user in a tenant. 

 

Expected response similar to :

 

 

"id": "29:1GcS4EyB_oSI8A88XmWBN7NJFyMqe3QGnJdgLfFGkJnVelzRGos0bPbpsfJjcbAD22bmKc4GMbrY2g4JDrrA8vM06X1-cHHle4zOE6U4ttcc", 
"objectId": "9d3e08f9-a7ae-43aa-a4d3-de3f319a8a9c", 
"givenName": "Larry", 
"surname": "Brown", 
"email": "Larry.Brown@fabrikam.com", 
"userPrincipalName": "labrown@fabrikam.com"

 

 

1 Reply
Highlighted
Best Response confirmed by ThereseSolimeno (Microsoft)
Solution

Hi @Sanket26 I would suggest trying the 'List Users' function in Graph, please let me know if this helps resolve your issue. Check out the documentation here:   https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http