I’m working on a personal project that integrates with Microsoft Graph to inspect sharing permissions for OneDrive/SharePoint DriveItems.
Previously, when retrieving permissions for a DriveItem using:
GET /drives/{drive-id}/items/{item-id}/permissions
the response for a sharing-link permission included the link.webUrl property, for example:
{
"id": "...",
"roles": ["read"],
"link": {
"scope": "anonymous",
"type": "view",
"webUrl": "https://..."
}
}
Recently, I started receiving the link object with properties such as scope and type, but webUrl is no longer returned, even though I know that the sharing link exists and is accessible through the DriveItem.
For example, I now receive something similar to:
{
"id": "...",
"roles": ["read"],
"link": {
"scope": "anonymous",
"type": "view"
}
}
According to the Microsoft Graph documentation, link.webUrl is supposed to contain the URL that opens the item in OneDrive/SharePoint.
Was there a recent change in Microsoft Graph that causes link.webUrl to be omitted in some circumstances?
If so:
- What permissions or authorization conditions are required for
link.webUrl to be returned?
- Is this behavior different between delegated and application permissions?
- Is there an alternative Microsoft Graph API that can be used to retrieve the actual sharing URL for an existing permission?
- Is there a supported way to retrieve all sharing links associated with a DriveItem, including their URLs, scope, and type?
I’m particularly interested in retrieving all existing sharing links for a DriveItem for my personal project, rather than creating new sharing links.