python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

SharePoint access site issue.

Open thsheep opened this issue 9 months ago • 2 comments

https://github.com/O365/python-o365/blob/705e676ca10055b41448d0b7e5c199a1ce9407af/O365/sharepoint.py#L665C1-L665C60

It caused the site to be inaccessible.

Changing it to: site = '{}:/sites{}'.format(host_name, path_to_site) works fine.

Is my code still incorrect?

` o365 = Account(credentials=(client_id, client_secret), auth_flow_type='credentials', tenant_id=MicroSoftGraphTenantId) o365.authenticate()

o365.sharepoint().get_site('xxxxxxx.sharepoint.com', 'xxxxxx')

` error:

` requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://graph.microsoft.com/v1.0/sites/xxxxxxx.sharepoint.com:/xxxxxx: | Error Message: The provided path does not exist, or does not represent a site

`

thsheep avatar Feb 25 '25 07:02 thsheep

Seems legit

I'will change this

alejcas avatar Mar 18 '25 15:03 alejcas

No, seems like it's ok as it is:

https://learn.microsoft.com/es-es/graph/api/site-get?view=graph-rest-1.0&tabs=http#access-a-site-by-server-relative-url

GET /sites/{hostname}:/{server-relative-path}

alejcas avatar Mar 18 '25 15:03 alejcas