简体   繁体   中英

how to get all users in a company using office 365

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM