The OneDrive API now works with OneDrive for Business!
We're still working on fully converging the developer experience for OneDrive and OneDrive for Business, but the OneDrive API now supports a common set of API calls that can be used with OneDrive, OneDrive for Business, and SharePoint document libraries.
We'll continue to release updates to align the implementation of the OneDrive API between OneDrive and OneDrive for Business. To ensure that your application maintains functionality you must develop your OneDrive API integration based on this documentation. Do not assume that undocumented behavior will remain functional as we make these updates.
While our end goal is that the OneDrive API works uniformly for OneDrive and OneDrive for Business, we're not there yet. There are several important differences you'll need to be aware right now.
Differences in the OneDrive API between OneDrive and OneDrive for Business are listed below:
To connect to OneDrive for Business, you'll need to use the Azure Active Directory common consent authentication. While this is still OAuth 2.0, it uses different authentication and token end points other than Microsoft accounts.
Additionally, OneDrive for Business requires that the access_token is provided using the Authorization header. The access_token can't be provided in the query string.
For more information on authentication, see Authentication for OneDrive API.
To use the OneDrive API with OneDrive for Business, your app needs to discover the tenant specific root URL to use. You can use the Office discovery service API to find the correct root URL for the signed-in user.
The cTag property of an item in OneDrive for Business returns only files and not folders.
Setting a custom thumbnail for an item is not available in OneDrive for Business.
Certain calls that expand the thumbnails collection or refer to it directly, including custom uploaded thumbnails will fail:
However, you can access the thumbnails directly for a single item at a time:
Search will not return the following properties in OneDrive for Business:
OneDrive for Business currently supports filtering by
In OneDrive for Business, the orderby query string only works with
lastModifiedDateTime works only with OneDrive consumer.
The view.delta action is currently only supported on the
root folder, not on other folders. Also, the view.delta action does not return the following properties:
When requesting the
/content property of an item to download the file, you
must provide the Authorization header, in order to be granted access to
download. The response will always return a
302 redirect to the URL where the
file can be downloaded from. This URL is pre-authenticated and does not require
the Authorization header. If you specify an authorization header to this
download URL when downloading an item's content from OneDrive for Business, you
will receive a
The collection of special folders for a drive (
/special) is not supported.
OneDrive for Business does not yet support upload from URL or multipart upload for item uploads.
The @name.conflictBehavior property does not support the rename value in OneDrive for Business.
SHA1 and/or CRC32 hash values are not returned for files stored in OneDrive for Business.
The OneDrive API currently returns all available OData v4.0 metadata for an item on OneDrive for Business. You can reduce the metadata returned, if it is not useful, by using the Accept header:
Accept: application/json; odata.metadata=none
OneDrive for Business and SharePoint online block several file extensions from being uploaded to the server.
See Types of files that cannot be added to a list or library for more information on blocked file extensions.
OneDrive for Business has a subset of information about images and photos
available compared to OneDrive personal. The
photo facet only provides the
image facet is returned on items that are expected to be images, but has
OneDrive for Business does not yet support sharing links for folders, or permissions on an item.
The OneDrive pickers and savers support OneDrive and OneDrive for Business on these platforms:
Picking and saving files to OneDrive only, is supported on these platforms:
In OneDrive for Business, using
/drives to enumerate all drives available to the user is not supported.
Please use the community links at the bottom of our website to send us feedback either through UserVoice or by posting issues in GitHub. We want to hear more from you about the OneDrive API for OneDrive for Business.