How do I get a File that is shared to me via sharepoint through a different tenant show up under the shared directory of my OneDrive

RPA Admin 1 Reputation point
2021-09-07T10:05:37.64+00:00

Supposing my account is under tenant A and another external account from a different tenant (Say tenant B) has shared a folder with me via SharePoint or OneDrive for Business, I want to access this shared folder through an API call or at least have it show up under the "Shared with me" section of my own OneDrive as it would when someone from my own organization shares a file with me. How do i achieve this?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,126 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,767 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,816 Reputation points Microsoft Employee
    2021-09-07T14:35:00.46+00:00

    You can use MS Graph List items shared with the signed-in user with the query option allowexternal=true which will return a remote item. You can the use the remote item to interact with the folder using the Drive Items API like upload files.

    For example GET /drives/{remoteItem-driveId}/items/{remoteItem-id} will give you the file.

    0 comments No comments