question

BipalShakya-7709 avatar image
0 Votes"
BipalShakya-7709 asked saldana-msft edited

Get information about permission change for a resource in Microsoft Graph API

Hi!
This is regarding Microsoft Graph API.

So I'm trying to check and track any changes in permissions of files/folders -- Especially permissions where a file/folder will have access via a publicly shared link.

Basically, if I add a public shared link to a file, I'd like to see that change in my delta API.



Currently,
I am querying a delta API, something like this:

 https://graph.microsoft.com/v1.0/drives/<drive-id>/root/delta

And I pass a Prefer header as following when I query the API:

 {'Prefer': 'deltashowremovedasdeleted, deltatraversepermissiongaps, hierarchicalsharing, deltashowsharingchanges'}

Now, I add a shared link to a file/folder under the given drive-id.

And after adding a shared link, I query the delta API,
https://graph.microsoft.com/v1.0/drives/b!oOa8Yc5LBUu9VsHT9viE-ckvClPsxx1Pugfyv6jx1ww74Z7fbOA7RK_2ID_p-2xH/root/delta?token=<delta_token>;



The problem is, in my response,
I don't get the exact name of the file/folder to which the shared link has been added. Instead, I only get some basic information about the root folder:

 {
     "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
     "@odata.deltaLink": "",
     "value": [
         {
             "@odata.type": "#microsoft.graph.driveItem",
             "createdDateTime": "",
             "id": "",
             "lastModifiedDateTime": "",
             "name": "root",
             "webUrl": "",
             "size": 1235690,
             "parentReference": {
                 "driveId": "",
                 "driveType": "documentLibrary"
             },
             "folder": {
                 "childCount": 21
             },
             "root": {},
             "shared": {},
             "sharepointIds": {
                 "listId": "",
                 "listItemUniqueId": "",
                 "siteId": "",
                 "siteUrl": "",
                 "tenantId": "",
                 "webId": ""
             }
         }
     ]
 }

What am I missing out on here?

microsoft-graph-filesmicrosoft-graph-explorer
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

After testing, I can return the correct result, I will try to reproduce your problem and solve it, please wait a moment.

0 Votes 0 ·

1 Answer

CarlZhao-MSFT avatar image
0 Votes"
CarlZhao-MSFT answered

You need to modify your api: https://graph.microsoft.com/v1.0/drives/b!oOa8Yc5LBUu9VsHT9viE-ckvClPsxx1Pugfyv6jx1ww74Z7fbOA7RK_2ID_p-2xH/root/delta(token='{delta_token}').

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.