0

We want to integrate People API for our cloud application. Our application can be used by anyone who signs up. Once they sign up they will be able to add users to their network. We have an option to add users manually.

We also want to use People API to fetch a list of relevant people for the logged-in user.

With my client id I'm able to search my list of relevant people:

People.Read.all & User.Readbasic.all & User.Read

All have all been enabled on our side.

How can I enable this option for other logged in users? Do I need to get permission? If so from who?

Using this for guidance: https://learn.microsoft.com/en-us/graph/people-example

somebadhat
  • 744
  • 1
  • 5
  • 17
Billy
  • 31
  • 3

1 Answers1

0

If your application has People.Read.All permission and admin permission consented, it allows the app to read a scored list of people relevant to the signed-in user or other users in the signed-in user's organization.

You may also refer to People permissions for more details.

Nishant
  • 623
  • 4
  • 10
  • Hi Nishant, Thanks for reaching out. The application has People.Read.All permission. But now, it works only for a our tenant id. It does not work for other tenant ids. Let me explain better: I created the application with ...@pipe9consulting.com - when i login with an @pipe9consulting.com - the application pulls the list. When I login with lets say 123@abc.com - it does not pull that organizations list. It says 'The remote server returned an error: (401) Unauthorized' Can you please let me know how we can fix this? Massive thanks, Billy – Billy May 12 '20 at 07:04
  • Query used: https://graph.microsoft.com/v1.0/users/(123@abc.com)/people" – Billy May 12 '20 at 07:16
  • Hello Billy, People.Read.All requires Admin Consent (https://learn.microsoft.com/en-us/graph/permissions-reference#people-permissions). So in your case, the tenant admin for abc.com needs to grant permission. – Nishant May 12 '20 at 07:36
  • The Azure AD tenant administrator MUST explicitly grant the permissions to the application. This must be done per tenant and must be performed every time the application permissions are changed in the application registration portal. (https://learn.microsoft.com/en-us/graph/security-authorization#manage-authorization-in-security-api-client-applications) . I hope this helps and do let me know if you need any further help. – Nishant May 12 '20 at 07:38
  • Thank you very much Nishant. I have one more question on Topic search: When I search for graph.microsoft.com/v1.0/me/people/?$search="topic:design" I dont get a proper response. here's what I get: { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('2e818564-4858-4ff5-a0be-98c56ef5d792')/people", "value": [] } Can you please help me out with this? – Billy May 14 '20 at 01:23
  • Hello @Billy, I will try to check on this, however it would be best to post this as a new question so that it can get attention of the community as well. – Nishant May 14 '20 at 11:11
  • Yes I did. Yet to get a solution. https://stackoverflow.com/questions/61678758/microsoft-graph-people-api-topic-search – Billy May 15 '20 at 11:48