Search code examples
onedriveoffice365-appsoffice365api

Get error trying to create a share link with action.createLink with onedrive for business but can retrieve existing link if created in the portal


I'm getting an Internal Server Error 500 with error message "host web isn’t a personal site" when trying to create a share link with the OneDrive for Business root url - https://{tenant}-my.sharepoint.com/_api/v2.0

I can upload / create files via the above API but I cannot create a shared link. If I create the link using the Office365 OneDrive portal I can then retrieve the link with action.createLink.

using the Office 365 Developer Pack subsciption but the file that I can upload and update but not create a link for is definitely in OneDrive and not the team site.

Anyone else getting the same problem and have answers? Not sure what extra detail I can provide here.

Any help is greatly appreciated. This has stumped me for a couple of days now.


Solution

  • Microsoft have confirmed that this is a bug in the OneDrive api with the 'createLink' function.

    Refer this: https://github.com/OneDrive/onedrive-api-docs/issues/237#issuecomment-152639588

    Apparently the fix is a few days away. Hope that helps somebody.

    Cheers