connect to sharepoint REST API with username and password

242 views Asked by At

I don't have any experience with Sharepoint. I need to download a file from a Sharepoint server in Python. I have a couple of different URLs that supposedly both point to the same file on Sharepoint:

https://connect.[our-partner].com/sites/ftp/[i think an FTP site name]/[path-to-file]

and

https://connect.[our-partner].com/sites/ftp/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/ftp/[i think an FTP site name]/[path-to-file]')

My #1 preference would be to download it via REST. If I can't do that, I guess FTP would be OK.

I only have a username and password. Am I correct to understand that it will never work for me and that I need to get some other sort of credentials?

The only other option is logging in w/ Selenium and downloading it, which I am really trying to avoid.

1

There are 1 answers

0
RaytheonXie-MSFT On

I would recommend you to register a sharepoint app only and request an accesstoken to use rest. Please refer to the steps in following article

https://anoopt.medium.com/accessing-sharepoint-data-using-postman-sharepoint-rest-api-76b70630bcbf