Hi Jurgen,
Maybe you can follow below steps to simulate creating the share link
Steps:
1. Get the drive Id
Use this endpoint https://graph.microsoft.com/v1.0/sites/1cpzfr.sharepoint.com,f0f575b8-513a-4d29-aced-944665acb461,60b419f0-5b77-4e7e-bb8b-d0c29288316b/drives
2. Copy the the drive id (for e.g id : b!uHX18DpRKU2s7ZRGZay0YfAZtGB3W35Ou4vQwpKIMWs3eEZky_dsSKJQhHoBQ80i) from the response object
Then request another call from this endpoint https://graph.microsoft.com/v1.0/sites/1cpzfr.sharepoint.com,f0f575b8-513a-4d29-aced-944665acb461,60b419f0-5b77-4e7e-bb8b-d0c29288316b/drives/b!uHX18DpRKU2s7ZRGZay0YfAZtGB3W35Ou4vQwpKIMWs3eEZky_dsSKJQhHoBQ80i/items?$filter=id ne ' '
This to get either folder id or files id, you can see it from response object
3. Copy the id (for my case i'm copying folder id : 01GJ2FQ63XXLW55ZYBN5BLL2VMNIEA5UWM)
4. Now request a create link endpoint
https://graph.microsoft.com/v1.0/sites/1cpzfr.sharepoint.com,f0f575b8-513a-4d29-aced-944665acb461,60b419f0-5b77-4e7e-bb8b-d0c29288316b/drives/b!uHX18DpRKU2s7ZRGZay0YfAZtGB3W35Ou4vQwpKIMWs3eEZky_dsSKJQhHoBQ80i/items/01GJ2FQ63XXLW55ZYBN5BLL2VMNIEA5UWM/createLink
with Http Method POST and below payload or request body. Btw u can remove the password attribute to open share without entering password
{
"type": "view",
"scope": "anonymous",
"retainInheritedPermissions": false
}
Here is the expected response. The webUrl is the shared link
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".