Microsoft OneDrive API allows developers to access the OneDrive service, which enables users to store and share their personal data, such as files, photos, and OneNote notebooks, across all their devices.
With the Microsoft OneDrive API, developers can build a variety of applications and services that take advantage of the following features:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
microsoft_onedrive: {
type: "app",
app: "microsoft_onedrive",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://graph.microsoft.com/v1.0/me`,
headers: {
Authorization: `Bearer ${this.microsoft_onedrive.$auth.oauth_access_token}`,
},
})
},
})
Emit new event when a new file is added to a specific drive in OneDrive
Emit an event when a new file is added to a specific directory tree in a OneDrive drive
Emit an event when a new file of a specific type is created under a directory tree in a OneDrive drive
Emit new event when a new folder is created in a OneDrive drive
Emit an event when a new folder is created under a directory tree in a OneDrive drive
Download a file stored in OneDrive. See the documentation
Retrieve a table from an Excel spreadsheet stored in OneDrive See the documentation
Microsoft OneDrive uses OAuth authentication. When you connect your Microsoft OneDrive account, Pipedream will open a popup window where you can sign into Microsoft OneDrive and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Microsoft OneDrive API.
Pipedream requests the following authorization scopes when you connect your account:
User.Read
email
offline_access
openid
profile
Files.Read
Files.Read.All
Files.ReadWrite
GET
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://login.microsoftonline.com/common/oauth2/v2.0/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
&
scope={{oauth.space_separated_scopes}}
POST
https://login.microsoftonline.com/common/oauth2/v2.0/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}