greg
greg

Reputation: 1204

Get shared OneDrive documents using Microsft Graph and OneDrive JS SDK

The Microsoft Graph can provide a List items shared with the signed-in user. I want to integrate this REST functionality with the OneDrive file picker for JavaScript v7.0 SDK. The goal of my integration is to use the OneDrive SDK to open a view of all documents shared with a signed in user.

As a first step I was hoping someone could give some guidance on what advanced options I can add to the following code in order to integrate Microsoft Graph calls into my OneDrive integration.

var odOptions = {
  clientId: "INSERT-APP-ID-HERE",
  action: "share | download | query",
  multiSelect: true,
  openInNewWindow: true,
  advanced: {},
  success: function(files) { /* success handler */ },
  cancel: function() { /* cancel handler */ },
  error: function(e) { /* error handler */ }
}

Upvotes: 0

Views: 562

Answers (1)

dabox
dabox

Reputation: 134

unfortunately, OneDrive JS SDK does not support showing all shared files in a view so far. Probably you want to build the view by yourselves depending on your story.

Assuming you have a valid graph access token, which means Files.Read is in scope, you can make request to https://microsoft.graph.com/v1.0/me/drive/view.sharedWithMe

more info about graph: http://graph.microsoft.io/en-us/docs/api-reference/v1.0/resources/drive about view.sharedWithMe: https://dev.onedrive.com/drives/shared_with_me.htm

Upvotes: 1

Related Questions