A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Hi @GSH-1402,
Thanks for reaching out to us. We are very pleased to assist you.
According to the information you provided and the research I have done, I may understand that you try to get the files in a site's default Shared Document library. If there is anything wrong, please correct me.
If there is not anything wrong, then we need to check the following areas to troubleshoot the problem:
1.Document Location & Site ID and Document Path:
I know you've probably checked this many times, but I'd still recommend checking the site id and document path again (if the file is in a folder, then the path should include the folder). Confirm that the document is indeed located at the specified path. It might have been moved or deleted.
2.Permissions:
Verify that the user in question have the necessary permissions to access the document. Even if you have access to the file through other means, the API call requires specific permissions. According to this official documentation, user may need these permissions to use the request:
3.Permissions for documents in SharePoint:
Please try removing the user's SharePoint access to the document and then re-granting it. Sometimes regranting the permissions will solve the problem.
4.Gets all the documents in the Shared Document library.
If the problem still exists, try using the following request to get all the files in the Shared Document library and see if the returned result contains the target document.
YAMLCopy
https://graph.microsoft.com/v1.0/sites/{site-id}/drive/root/children
If you have any questions, please do not hesitate to contact me.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. It will be beneficial to more community members reading here. Your contribution will be highly appreciated.