Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SharePlumRequestError: SharePlum HTTP Post Failed

Error Screenshot:

Error Screenshot

Hello Everyone,

I am trying to set up a connection to SharePoint list so I can read/write data to SharePoint. Below is the following code that I have ran to form a connection using SharePlum library. I am running the same exact code as the library suggests with my credentials and url but I get this error which I can't see to find online anywhere. I would really appreciate if you can help me fix this. Thanks.

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

sharepointUsername = '[email protected]'
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)
like image 516
Vatsal Patel Avatar asked Sep 15 '26 11:09

Vatsal Patel


1 Answers

It seems that you're trying to connect to SP online. Please specify Version parameter then try it again.

site = Site('https://xxxxxx.sharepoint.com/sites/sbdev/subtest01',version=Version.v365, authcookie=authcookie)

Full Code: https://github.com/kongmengfei/sharedproject/blob/master/PythonConsole-uploadfileSPO/PythonApplication2/addDocLib.py

I have tested above demo in my SPO environment, you may have a look.

BR

like image 188
Baker_Kong Avatar answered Sep 18 '26 16:09

Baker_Kong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!