【问题标题】:Access SharePoint Online via REST API通过 REST API 访问 SharePoint Online
【发布时间】:2019-10-23 05:32:47
【问题描述】:

通过 rest api 访问共享点时遇到问题。

嗨!

我正在尝试使用 REST API 在 Python 中访问公司 SharePoint Online。

例如,我要访问的 SharePoint 文件夹是:https://company.sharepoint.com/sites/sitename/foldername。我可以访问网站和文件夹,但无法访问公司根目录。

我尝试了两种方法:

选项 1:HttpNtlmAuth

域 = 'https://company.sharepoint.com/'

url = ' https://marvell.sharepoint.com/sites/sse/_api/web/lists/GetByTitle(\'Sandbox\')/items'

actual_username = domain + username

response = requests.get(sharePointUrl,auth= HttpNtlmAuth(actual_username,password))

选项 2:sharepy

s = sharepy.connect("company.sharepoint.com")

但他们都失败了,我得到403, Forbidden401 Client Error: Unauthorized for url

谁能帮忙看看这里可能是什么问题?

提前致谢!

C.

【问题讨论】:

    标签: python sharepoint sharepoint-rest-api


    【解决方案1】:

    以下解决方案带有来自 GitHub 的源代码供您参考。

    Office 365 API SDK for Python

    SharePy - Simple SharePoint Online authentication for Python

    【讨论】:

      猜你喜欢
      • 2016-03-12
      • 1970-01-01
      • 1970-01-01
      • 2017-02-28
      • 2014-07-25
      • 2021-11-10
      • 2017-05-31
      • 2019-07-08
      • 1970-01-01
      相关资源
      最近更新 更多