gpt4 book ai didi

python - SharePlumRequestError : SharePlum HTTP Post Failed

转载 作者:行者123 更新时间:2023-12-04 04:01:05 28 4
gpt4 key购买 nike

错误截图:
Error Screenshot
大家好,
我正在尝试建立到 SharePoint 列表的连接,以便我可以将数据读/写到 SharePoint。下面是我运行以使用 SharePlum 库形成连接的以下代码。我正在使用我的凭据和 url 运行与库建议的完全相同的代码,但是我收到此错误,我无法在任何地方在线找到该错误。如果您能帮我解决这个问题,我将不胜感激。谢谢。

ShareplumRequestError: Shareplum HTTP Post Failed : 403 Client Error: Forbidden for url: https://abc.sharepoint.com/
from shareplum import Site
from shareplum import Office365

sharepointUsername = 'user@abc.com'
sharepointPassword = 'password!'
sharepointSite = 'https://abc.sharepoint.com/sites/MySites/'
website = 'https://abc.sharepoint.com/'

authcookie = Office365(website, username=sharepointUsername,
password=sharepointPassword).GetCookies()
site = Site(sharepointSite, authcookie=authcookie)

最佳答案

您似乎正在尝试在线连接到 SP。请注明版本参数然后再试一次。

site = Site('https://xxxxxx.sharepoint.com/sites/sbdev/subtest01',version=Version.v365, authcookie=authcookie)
完整代码:
https://github.com/kongmengfei/sharedproject/blob/master/PythonConsole-uploadfileSPO/PythonApplication2/addDocLib.py
我已经在我的SPO环境中测试过上面的demo,你可以看看。
BR

关于python - SharePlumRequestError : SharePlum HTTP Post Failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63056166/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com