Hello Ameya Nayak,
Thank you for contacting support!
Yes, it is possible to access a file shared with User A in Tenant A from Tenant B via delegated permissions using Microsoft Graph API. Here are the steps to achieve this:
- Share the File:
- User B in Tenant B needs to share the file with the user in Tenant A.
- Obtain Necessary Permissions:
- Ensure that the application accessing the file has the required delegated permissions. These permissions might include
Files.Read
, Files.Read.All
, Sites.Read.All
, etc.
- Access the Shared File:
- Use the Microsoft Graph API to access the shared file. Here is an example of how to do this:
GET https://graph.microsoft.com/v1.0/me/drive/sharedWithMe?allowexternal=true
This request retrieves the list of items shared with the authenticated user, including those from external tenants.
By following these steps, you should be able to access the file shared with User A in Tenant A from Tenant B using delegated permissions. https://learn.microsoft.com/en-us/graph/api/drive-sharedwithme?view=graph-rest-1.0&tabs=http#response
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.