why /me/drive/SharedWithMe Returns "value": []

Lucas Matheus Rodrigues Brum 0 Reputation points
2023-01-18T19:29:09.71+00:00

I'm getting it:

R
R
I'm getting it	
"error": {
		"code": "accessDenied",
		"message": "Access denied",
		"innerError": {
			"date": "2023-01-17T18:28:01",
			"request-id": "a96ef046-8d91-43d6-9092-f1cde276d736",
			"client-request-id": "a96ef046-8d91-43d6-9092-f1cde276d736"
		}
	}
}

When I make a request for this url:

https://graph.microsoft.com/v1.0/me/drive/sharedWithMe

But there are several files shared with me, I have tried these solutions, but I have not been successful:

https://stackoverflow.com/questions/54714498/get-me-drive-sharedwithme-returns-empty-list#new-answer

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,013 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,328 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
732 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,211 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bhanu Kiran 3,526 Reputation points
    2023-01-18T23:46:00.69+00:00

    Hello @Lucas Matheus Rodrigues Brum,

    I was able to reproduce this issue when I have only provided files.read permission in the token.

    User's image

    But as per the documentation, while the /sharedWithMe request will succeed with Files.Read or Files.ReadWrite permissions, some properties may be missing. Additionally, without one of the All permissions, shared items returned from this API will not be accessible.

    So after giving the necessary permission as instructed in the document, I was able to get the results:

    User's image

    Please check and validate the same.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.