1
votes

I want to get all people in a company using office365 API but i am unable to get all the users.
I used the below API.
https://outlook.office365.com/api/beta/me/people/?%24top=100000
Here i am getting only those person name which ever i or his/her contacted through mails

https://outlook.office365.com/api/v1.0/me/contacts
here i am only getting cantacts users

I am using c# code for validating the user credential and i can change my approach for getting the all users.

1
Show us your code. What have you tried so far.JDurstberger
if you go through the give url then it asked user name and password of your office 365 account and in return it gives json data. I tried with these urls using c# code.vikram
Did you try powershell ?srg

1 Answers

1
votes

First of, i think you need to use the Graph API, and build your app on that, that is the new unified api, you can find all the documentation here http://graph.microsoft.com.

To get the company contacts you need to use the /beta endpoint. Otherwise you only get, as you wrote, your own contacts.

So the REST call you have to make is to https://graph.microsoft.com/beta/contacts, this will give you all of the organizational contacts.

You can read more about that here https://graph.microsoft.io/docs/api-reference/beta/api/orgcontact_list.