A community member has associated this post with a similar question:
Share a file with external users using anonymousAccess by using sharepoint REST API

Only moderators can edit this content.

Using SharePoint REST API can we create a share link for specific external users

john john 1,026 Reputation points
2023-05-12T03:04:53.55+00:00

Using SharePoint REST API, i can do the following POST request to create an anonymous sharing link with password:-

1- Method:- POST

2- URL:- _api/web/Lists('ListGUID')/GetItemByID('1')?['ID']}')/Sharelink

3- Body:-

{
"request":{
    "createLink":true,
    "settings":{
        "allowAnonymousAccess":true,
        "linkKind":6,
        "role":1,
        "restrictShareMembership":false,
        "updatePassword":true,
        "password":"***",
        "scope":0
    }
}
}

this mimic this UI action for creating anonymous sharing link-

enter image description here

but how i can modify the Body parameters to create a link for specific users instead, which can be achieved from the UI using this action: -

enter image description here

any advice please?

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes