使用REST从外部Web应用程序从SharePoint(本地/在线)连接和获取数据.

问题描述:

我正在开发一个Web应用程序,我想通过该Web应用程序连接到我的客户SharePoint网站并从中获取数据.我无法确定应该使用哪些API,以及如何获取身份验证令牌来访问REST API.请指导我.谢谢

I am developing a web application through which I want to connect to my customers SharePoint sites and fetch data from it. I am unable to figure out which APIs I should use and also how to get auth tokens to access REST APIs. Please guide me. Thanks in advance.

对于SharePoint Online,有2种推荐的通过REST访问数据的方法.您可以创建SharePoint加载项,也可以创建Azure AD应用程序以请求安全令牌.请参阅: https://docs.microsoft.com/zh-cn/azure/active-directory/develop/active-directory-authentication-scenarios . 不建议使用的另一种方法是致电安全令牌服务,请参阅:

For SharePoint online, there are 2 recommended methods for accessing data via REST.  You can create a SharePoint add-in, or you can create a Azure AD app to request a secure token. See: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-authentication-scenarios.  Another method which is not recommended is to make a call to the security token service, see: https://pholpar.wordpress.com/2013/05/11/accessing-office-365-sharepoint-sites-using-rest-from-a-local-html-javascript-host/