Accessing Shared Items using Sites.Selected Application

Ankitha Kini 1 Reputation point
2022-09-01T09:38:50.327+00:00

We are using an Azure App with Sites.Selected level permission which will have access to different O365 groups/Sharepoint Sites.
Users will be sharing the doc with this Group Email ID, how can we access it using MS Graph APIs.
Currently it is able to access the files in the Site, not the ones shared with the mail ID that appear in the Shared With Us part of the Sharepoint Site.
Error :
{
"error": {
"code": "unauthenticated",
"message": "The caller is not authenticated."
}
}

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,897 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,716 Reputation points Microsoft Vendor
    2022-09-01T16:37:56.17+00:00

    Hi @Ankitha Kini ,

    You can use the following endpoint to get files shared with a group.

    GET /groups/{groupId}/drive/sharedWithMe  
    

    Refer to the documentation drive-sharedwithme.

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.