Forum Discussion
Create Sharepoint shortcut in Fabric lakehouse by code/API
Hi amaaiia,
The API you are trying to use is the correct one, https://learn.microsoft.com/en-us/rest/api/fabric/core/onelake-shortcuts/create-shortcut?tabs=HTTP
Note that your body has incorrect parameters, specifically there is no "displayName" property.
Here is the sharepoint example from the documentation:
{
"path": "Files",
"name": "MyOneDriveSharePoint",
"target": {
"oneDriveSharePoint": {
"location": "https://microsoft.sharepoint.com",
"subpath": "/Shared Documents/Test Folder",
"connectionId": "97e33458-1353-4911-96b1-6f4f4bbfd335",
"updateFabricItemSensitivity": false
}
}
}
The 403 error means whatever user is being used does not have permissions to do what you are trying to do. Can you confirm if you are using your account or a service principal to run the notebook? Can you confirm what workspace permissions you have on the workspace where the lakehouse you are trying to add a shortcut to is?