How do I get user_id and email in workspace from API?

Copper Contributor

I can get user's id in messages via API and

I can see email in APP (like in picture)

 

but email is not included,

and I couldn't find any API to get user's id - email mapping.

 

does anyone knows how to get user's id - email mapping?

(like users.json in slack)

2 Replies

@shunsuke 

 

Are you looking for the below API ?:

https://graph.microsoft.com/v1.0/users/UserId

https://graph.microsoft.com/v1.0/users/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?$select=mail

--or---

https://graph.microsoft.com/v1.0/users/username@domain.com?$select=id

@Kevin Morgan 

thank you for your response.

I tried as you said.

 

what I want exactly is getting 'aadObjectId' of Mentioned user ID

like following

 

    "from": {
       "id": "29:*****",
       "name": "****",
       "aadObjectId": "********-****-****-****-************"
   },
...
       {
           "mentioned": {
               "id": "hoge:****",
               "name": "****"
           },
           "text": "<at>****</at>",
           "type": "mention"
       },

i want to get mentioned email or aadObjectId