shtrule
shtrule

Reputation: 658

Connection between Users and People in Microsoft Graph API

Using the Microsoft Graph API I'm fetching a list of users using the following endpoint:

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

After that, I want to check if a user is an actual person. For that, I'm planning to use People endpoint.

However, I can't find a method that will return all people in the organization. Users can also represent a room or a group and I want to be able to differentiate them. The only options that I could see are:

https://graph.microsoft.com/v1.0/me/people
https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/people

But they only return people that are related to a user with the provided id.

Is there a solution for getting a corresponding Person object for every User in the organization?

Upvotes: 1

Views: 1048

Answers (1)

Marc LaFleur
Marc LaFleur

Reputation: 33124

The /people endpoint can only return a person object if there is a connection between the person and the user.

Consider what a person represents:

An aggregation of information about a person from across mail, contacts, and social networks. People can be local contacts, contacts from social networking or your organization's directory, and people from recent communications (such as email and Skype).

If the user and the person are not connected in some way, there aren't enough sources to aggregate for a response. More importantly, the sources for [email protected] will be different between two user records (i.e. I'm connected with them on Skype and LinkedIn, you've only emailed them once a while back).

Also note that to pull a single person, you need to provide that person's id:

`/me/people/{id}`

Upvotes: 2

Related Questions