Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get file drive item via /shares/{encoded_webUrl} after listing children #2604

Closed
Kizuto3 opened this issue Jul 31, 2024 · 3 comments

Comments

@Kizuto3
Copy link

Kizuto3 commented Jul 31, 2024

I encountered an issue when getting a drive item via /shares endpoint. After listing drive items via /me/drive/root/children and using encoded webUrl in /shares endpoint (as described here ) graph api returns "invalidRequest: Invalid shares key." error. After some investigation I found that webUrl of drive items changed about 2-3 weeks ago. Before, listing drive items (like xlsx files) would return webUrl similar to:
https://onedrive.live.com/personal/946c98d07c563ce7/_layouts/15/doc.aspx?resid=946C98D07C563CE7!381&cid=946c98d07c563ce7

Now, however, webUrl looks similar to:
https://onedrive.live.com/personal/946c98d07c563ce7/_layouts/15/doc.aspx?resid=7c563ce7-98d0-206c-8094-7d0100000000&cid=946c98d07c563ce7

So only resid is different, and after encoding current webUrl and using it in /shares endpoint graph api returns an error.
I tested this with Postman, so it doesn't seem like SDK issue, but it is weird that webUrl changed, yet I am unable to find any change logs regarding this. To access graph api I am using OAuth2.0 access token with "Files.ReadWrite offline_access" scopes. Is there some changes I need to make to my Entra application that I am using in OAuth2.0 flow to return webUrl as it was before? If not, how can I use the new webUrl in the /shares endpoint without manually editing it? It is vital for me to use /shares endpoint.
Thank you.

@Kizuto3 Kizuto3 added the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Jul 31, 2024
@andrueastman
Copy link
Member

Thanks for raising this @Kizuto3

Any chance you can post the question at the link below to get feedback from the API owners? As this repo is mainly intended for SDK related issues, we may not be best placed if the change was intended. It would be great if you could post back the link of the query as a comment so that anyone who comes across this may find it as well.

https://aka.ms/askGraph

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close Service issue and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Aug 5, 2024
@Kizuto3
Copy link
Author

Kizuto3 commented Aug 5, 2024

Hello @andrueastman
Thanks for answering!
I posted the question, you can find at the link bellow:
https://learn.microsoft.com/en-us/answers/questions/1855033/unable-to-get-file-drive-item-via-shares-((encoded

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Aug 5, 2024
@andrueastman
Copy link
Member

Closing this for now as this is followed up in Q/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants