I'm having trouble creating a sharing link using the MS Graph application.
The process is as follows
- Create a SharePoint folder (DriveItem) on a specific Sharepoint site/ParentFolder (This action is currently working like a charm).
- When a folder is created, then generate an "Anyone" link for unauthenticated People outside the organization.
I confirm this is possible using the sharepoint UI
But using my Graph application with the following documentation permissions: Create a sharing link for a DriveItem
I'm not able to generate the "Anyone" Sharing Link for my folders
Below is the sharing settings of my SharePoint site:
Sharing: Anyone
Advanced settings for external sharing: Unchecked
Default Sharing Link Type: Anyone with the Link
Default Link Permission: Edit
When calling the createLink endpoint: POST /sites/{siteId}/drive/items/{itemId}/createLink
With the following payload:
{
"type": "edit",
"scope": "anonymous",
"retainInheritedPermissions": false
}
Server reply with the following:
{
"error": {
"code": "generalException",
"message": "Operation is not valid due to the current state of the object.",
"innerError": {
"date": "2024-06-14T18:46:41",
"request-id": "bccb5483-915a-47f6-8fb7-71cda1256ce0",
"client-request-id": "bccb5483-915a-47f6-8fb7-71cda1256ce0"
}
}
}
I build my app following MS Graph documentation, I'm pretty sure everything is aligned.
I'll appreciate your help.