Open HakjunMIN opened 1 year ago
I can confirm that this is a bug in the way url for this call is being built. Here's an example python code:
await (
client.sites.by_site_id("root")
.get_by_path_with_path("/sites/MY_SITE_NAME")
.get()
)
which executes this call -https://graph.microsoft.com/v1.0/sites/root/getByPath(path='%2Fsites%2FMY_SITE_NAME')
and doesn't work.
Based on Graph explorer, this should map to a request looking like this instead - https://graph.microsoft.com/v1.0/sites/root:/sites/MY_SITE_NAME
I'm not trying to open a pull request for this as this repo is generated, but accessing sharepoint sites by name is a very basic functionality which was present in legacy sharepoint api so I'm hoping this could get fixed fast.
To make the request https://graph.microsoft.com/v1.0/sites/root:/sites/MY_SITE_NAME
You can do this
client.sites.by_site_id("root:/sites/MY_SITE_NAME")
.get()
The getByPath
requestbuilder should probably be removed from the metadata as this path is invalid.
Client id and secret was made with having API permission as below.
What I want to download file of URL is https://mngenvmcap115298.sharepoint.com/sites/sampleteam/Shared%20Documents/general/PDF-ER.docx
error is here
How can I resolve?
Using msgraph-core 1.0.0a4, msgraph-sdk 1.0.0a13 which might be latest since I installl it today. WSL2, Python 3.10.12