question

VishPothaganti-6173 avatar image
0 Votes"
VishPothaganti-6173 asked MichaelHan-MSFT commented

Using Migration API with OneDrive sites

I'm using the Migration API to get bulk of files from SharePoint sites and also to upload bulk files to SharePoint (https://docs.microsoft.com/en-us/sharepoint/dev/apis/migration-api-overview)

Can we use the same API to Import/Export files from OneDrive sites? Is there any special URL structure to build for OneDrive sites?

office-sharepoint-onlineoffice-onedrive-client-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered MichaelHan-MSFT commented

Hi @VishPothaganti-6173,

One Drive sites are also SharePoint sites. So yes, we could use the same API to Import/Export files from OneDrive sites.

The URL of One Drive sites in SharePoint Online should be like this: https://tenant-my.sharepoint.com/personal/username_tenant_onmicrosoft_com/

For example: the url of Documents library in my onedrive is: https://tenant-my.sharepoint.com/personal/michael_tenant_onmicrosoft_com/Documents



If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is "Documents" considered the root directory in your case? When I have 10 different folders once I log in to my OneDrive Site and I want to export files from FolderA, will the URL be https://tenant-my.sharepoint.com/personal/michael_tenant_onmicrosoft_com/FolderA ?

0 Votes 0 ·

Hi @VishPothaganti-6173,

Yes, the "Documents" is the root directory. In OneDrive sites, by default all the folders/files are under the "Documents" library. You could check the folders/files structure by clicking return to Classic Onedrive in the left bottom of the page.

69833-image.png

The folers should be under the "Documents" library, I think the URL should be https://tenant-my.sharepoint.com/personal/michael_tenant_onmicrosoft_com/Documents/FolderA


0 Votes 0 ·
image.png (30.1 KiB)