0
votes

I am referring : https://docs.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http and this url : https://graph.microsoft.com/v1.0/me -- works fine.

and trying to get the required user details.

My question is, how to get the field details (sbx,cn,uid,mail,jobtitle) for any specific user ID?

The idea is to find any user details ( any field above, if not all) using MS graph API.

I tried this :

     https://graph.microsoft.com/v1.0/ID1234?$select=sbx,cn,uid,mail,jobtitle

However, getting error:

      "error": { 
             "code" : "BadRequest",
             "message":"Resource not found for the segment 'ID1234'.",
              --------------------------------------------
              -------------------------------------------
               }

What is the correct way of getting user details using MS graph API ? Any example please?

Thanks

1
Could you specifiy what do you mean by sbx, cn and uid?user2250152
Its the details people usually get while trying to find details from LDAP. cn = common name, uid is user id. stackoverflow.com/questions/18756688/…AskMe
Could you pls give me a mark if you feel my post is helpful to you? And if you met further error on it, pls feel free to update here. Thanks in advance : )Tiny Wang

1 Answers

1
votes

Use this api instead, graph user api can provide these properity, and I don't know what is sbx:

https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}?$select=displayName,id,mail,jobTitle

enter image description here

==============================================

By the way, you can use this api to query user information of all the users in your tenant:

https://graph.microsoft.com/v1.0/users?$select=displayName,id,mail,jobTitle