Writing a simple microsoft graph client without using a web server

徘徊边缘 提交于 2019-12-11 01:58:28

问题


I'm looking to write a script to update a Distribution List in Office365. I'm in the process of learning the MS Graph API and have gotten the python REST sample to work. It appears that all the sample Graph API code, regardless of language or platform, has an assumption that I'm coding from a web user interface in one way or another.

Is it possible to write a simple client that runs from a Linux box and allows me to specify my Office 365 id in my code, without having to select it from a browser? My goal is to have this run as a cron job which updates the Distribution List nightly. Python is not a requirement, it's just where I chose to start in learning Graph.


回答1:


The Graph API is not restricted to web apps and can be used in native/desktop apps as well. Essentially you have to start by registering your app to get your app ID, then use whatever REST APIs you want to implement the Auth Code Grant flow to get access. When you first issue a request the user will be prompted to sign in with their Office 365 account to grant access to your app, and away you go.

https://graph.microsoft.io/en-us/docs/get-started/rest



来源:https://stackoverflow.com/questions/42003964/writing-a-simple-microsoft-graph-client-without-using-a-web-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!