Skip to content
This repository has been archived by the owner on Dec 2, 2017. It is now read-only.

Latest commit

 

History

History
61 lines (44 loc) · 2.54 KB

getting-started.md

File metadata and controls

61 lines (44 loc) · 2.54 KB

Getting started with OneDrive API

To get started, follow these steps.

1. Authenticate your app

OneDrive uses OAuth 2.0 for authentication. You get an access token that authenticates your app with a particular set of permissions for a user. You provide an access token through an HTTP header:

Authorization: bearer {token}

To obtain an access token and sign the user in, see OneDrive authentication or OneDrive for Business authentication.

2. Make calls against a URL root

Now that you've authenticated your app, you can call the OneDrive API with your access token against the URL root below, combined with one of the root resources. See Drive resource and Item resource for examples on how to make calls to the OneDrive API. OneDrive API URLs are relative to the following root unless otherwise noted.

Service URL Root
OneDrive https://api.onedrive.com/v1.0
OneDrive for Business https://{tenant}-my.sharepoint.com/_api/v2.0
SharePoint Online https://{tenant}.sharepoint.com/{site-relative-path}/_api/v2.0

Note: Throughout the documentation, only partial syntax such as: GET /drive/items/{item-id} is used for the sake of brevity. Prefix the path with the correct root URL and version number in order to obtain the full resource path or URL.

3. Keep going

Check out the OneDrive samples on GitHub to learn more about using the OneDrive API.

Read through the OneDrive API HTTP documentation to learn more about working with the drive and item resources in OneDrive API HTTP end point.

Learn how to address items in OneDrive using either path or item id syntax.

Questions or need support? You can find us on Stack Overflow and through the GitHub issues page for our documentation.