Forum Discussion

Sanket26's avatar
Sanket26
Icon for Microsoft rankMicrosoft
Jun 04, 2020

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

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"

 

 

    • himawanprodugiecom's avatar
      himawanprodugiecom
      Copper Contributor

      HI JordanAlyse 

      using the ms graph client /users will return you list of user, however i cant find the ms teams user id (not sure what is the correct term).
      which is usually like 29:1XixdnHxkz23iu84OQnc0AuvDQRaKc3Aqd9-m5aVcB2vuac-SIoFza2n1uY_jZqPKkmiVMQ9ASHs3jxjNhJJMgw

      in the graph client /users, the user's id is like : ec6e7d43-699f-4660-b0b5-41248642d7ae, which is not the user id that i can use to send proactive message

  • Sendilm's avatar
    Sendilm
    Copper Contributor
    Hi,
    I just need the same as you said, I was totatly new to this , I was on google for past 2 days on this how to connect teams bot to Graph api, any help appreciated please.

Resources