sharepy icon indicating copy to clipboard operation
sharepy copied to clipboard

Recent 403-Forbidden when uploading files (using Files/Add)

Open cesarvegamx opened this issue 1 year ago • 2 comments

I've been using this library for a couple of years in my organization. We use it to get and put files in sharepoint for further processing by an ETL.

Since a last week all the Files/add operation stopped to work in our three environments: dev, staging, prod. Reading files from sharepoint still works everywhere.

full_url = "https://mycompany.sharepoint.com/sites/"+p_site+"/_api/web/GetFolderByServerRelativeUrl('/sites/"+p_site+"/Shared Documents/"+p_remote_folder+"/')/Files/add(url='"+p_file_name+"',overwrite=true)"; We're getting a 403-forbidden response.

I must clarify that the account used for our connection has full permissions on the sharepoint (remember it was working, its not a new development).

I tried the same operation using postman: same url, same account, and there, I could succesfully add the file to sharepoint.

It seems like a recent change in sharepoint broke the Files/add method.

cesarvegamx avatar Feb 27 '24 08:02 cesarvegamx