how to access the user's OneDrive data by using Office 365 API and Administrator OAuth token of the particular domain?
1 Answer
You can use the Microsoft Graph to get data from various Office 365 services with a single REST end point.
Here's the reference for OneDrive
An example REST URL, to get the files at the root of the signed in user's OneDrive, would be:
https://graph.microsoft.com/v1.0/me/drive/root/children
And the resulting JSON might look like:
{
"value": [
{"name": "myfile.jpg", "size": 2048, "file": {} },
{"name": "Documents", "folder": { "childCount": 4} },
{"name": "Photos", "folder": { "childCount": 203} },
{"name": "my sheet(1).xlsx", "size": 197 }
],
"@odata.nextLink": "https://..."
}