0
votes

I have utilized the OneDrive JS picker and after the user selects an item, it will query for the permissions, using the route below, per the permissions reference.

GET: https://graph.microsoft.com/v1.0/drive/items/{item-id}/permissions

This works fine for items in personal OneDrive, but when working with items from OneDrive for business/sharepoint, the resulting HTTP response code is a 404.

I tried using the domain of the sharepoint file (e.g. https://sample-my.sharepoint.com) but that didn't work either. Is there a different domain that can be used?

I realize this is similar to Hanan Levy's question Get items permissions in OneDrive for Business using microsoft Graph API except that the response code I receive is 404 (File not found) while he reports the response has an error code and message (perhaps in response body).

EDIT: Per the request of Brad, below are the response headers Date and request-id, along with a screenshot containing the Request with response headers:

Date:Thu, 08 Dec 2016 19:02:47 GMT
request-id:3b2fe7b5-7ffc-4cc6-9853-e13150297186

screenshotOfRequestWithResponseHeaders

1
Are you still seeing this behavior? If so, if you can provide the value of the request-id header in the response along with the value of the Date header we can take a closer look.Brad
@Brad : Yes - I have edited the post to include the response headers you requested, along with a screenshot from the browser consoleSᴀᴍ Onᴇᴌᴀ

1 Answers

0
votes

It looks like the call you're making is to https://tenant.sharepoint.com so I'm guessing you're trying to access the default document library for the tenant. However, the scopes you requested only include Files.ReadWrite which will only provide access to items in the caller's mysite. To access files outside of the caller's mysite you'll want to make sure to include Files.ReadWrite.All scope when you're creating the access token.