The onedrive connector reads the files in one OneDrive or one SharePoint document library through Microsoft Graph: names, sizes, folders, who created and changed them and when, and the saved versions of each changed file. It never downloads a file.
| Connector name | onedrive |
| Products | Records, episodes |
| Credentials | The portal's Connect button, or an Entra ID app's client id and secret and a refresh token |
| Permissions | Delegated Files.Read.All and Sites.Read.All |
| Status | Preview: tested against Microsoft's documented responses, not yet on a live account |
What it pulls
| Object | Contents |
|---|---|
item |
Name, size, folder path, file type or folder child count, created and modified times, created by and modified by, web link, deleted flag |
version |
File, version id, time, size, the person who saved it |
Choose a subset with objects (item, version).
Episodes. One per file changed in the window: its saved versions in order, with who saved each.
Credentials
Register an app in Microsoft Entra ID with the delegated permissions above, sign in once to get a refresh token, and give the SDK clientId, clientSecret, refreshToken and tenantId. Microsoft issues a new refresh token on use; the SDK saves it.
Or skip the tokens: click Connect next to OneDrive in the portal (Settings → Connected systems), then run datayield connect onedrive --broker.
Connect
datayield connect onedrive -o clientId=<app id> -o clientSecret=env:MS_CLIENT_SECRET \
-o refreshToken=env:MS_REFRESH_TOKEN -o tenantId=contoso.onmicrosoft.com -o drive=sites/<site id>/driveOptions
| Option | Required | Meaning |
|---|---|---|
clientId, clientSecret, refreshToken |
yes, or accessToken |
The app and a refresh token |
accessToken |
instead of the above | A current access token, for a one-off run. It expires within an hour. |
tenantId |
no | Directory id or domain. Default common. |
drive |
no | me/drive (default, the signed-in user's OneDrive), drives/<drive id>, or sites/<site id>/drive for a SharePoint library |
objects |
no | Record types to pull |
New records on each run
Graph lists the whole drive on every run; items not modified since the last successful run are dropped on your machine before anything else happens. Versions are read only for files changed in the window, one request per file.