Programmatically upload documents to shared folders from an external account

Copper Contributor

I am having this use case:

- Account A in tenant-1

- Account B in tenant-2

- B shares a folder within a SharePoint site of tenant-2 to A, with write permission.


A then can see the shared folder within Shared tab of OneDrive for business. A can access the shared folder from that or from the link in A's Outlook inbox. By opening the link, A can then create folders, upload documents,... within that folder.


Now my question is, whether it is possible to do those actions (create folders, upload documents,..) inside that shared folder programmatically, e.g using SharePoint REST API, Microsoft Graph API,...?


I read through some documents related to SharePoint REST API, Microsoft Graph API,.. and it seems like those API are used only for accessing SharePoint sites' documents within user's tenant, not from a remote tenant. Am I correct?


Please let me know if you have any information about this, many thanks!

0 Replies