JonathanHolvey / sharepy

Simple SharePoint authentication for Python
GNU General Public License v3.0
175 stars 52 forks source link

Accessing data on subsite #44

Closed JonathanHolvey closed 4 years ago

JonathanHolvey commented 4 years ago

@alex00321 said:

Hi I'm new to this case, but I'm trying to use sharePy to post file. The problem I got here is I don't have the main site like company.sharepoint.com. I only could access the sub site like company.sharepoint.com/sites/mine. So is there any way you could help? Thanks!

Copied from https://github.com/JonathanHolvey/sharepy/issues/42#issuecomment-643986524

JonathanHolvey commented 4 years ago

You can access pages on a subsite by passing the full URL when making a request. Something like:

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

r = s.get("https://company.sharepoint.com/sites/mine/")
alex00321 commented 4 years ago

Thanks for the feedback @JonathanHolvey but this is still returning with"Authentication Failure: AADSTS50126: Error validating credentials due to invalid username or password"

JonathanHolvey commented 4 years ago

Ok, I'll close this issue in that case. I'll see if I can have a look at #42 now that the XML data I need has been provided.