Hi Mustafa Salihi,
As per Microsoft documentation, you can grant users access to a link represented by a permission using the following API:
POST https://graph.microsoft.com/v1.0/shares/{encoded-sharing-url}/permission/grant
Content-type: application/json
{
"recipients": [
{
"email": ******@contoso.com
},
{
"email": ******@external.com
}
],
"roles": ["read"]
}
This API allows you to specify the recipients and the roles (e.g., "read") to grant access to the shared link. The action to grant access to the shared file should be performed by the owner of the file or someone who already has the necessary permissions to manage access to the file. This ensures that the correct permissions are set and that the file is securely shared with the intended recipients.
Additional reference: List permissions
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.