Hi @Akshith Reddy Thalla,
To share a folder, you can use the POST /drives/{drive-id}/items/{item-id}/invite
endpoint, where {drive-id}
is the ID of the drive where the folder is located, and {item-id}
is the ID of the folder you want to share. To get {drive-id} and {item-id}, you can take a reference to this article: How to Find Site Id, Drive Id and Item Id using Microsoft Graph API.
Reference: Send a sharing invitation.
For example,
https://graph.microsoft.com/v1.0/drives/b!fIIel_ckvEGuCEQKxsYKyUPocDuiXE5PpCID5WtvTNY2aGNaWsxbQ5_grpudLNED/items/0144RNNBG2JCXTFGLWHRFYFQ6XRSSVMCXM/invite
{
"recipients": [
{
"email": "user@xxx.onmicrosoft.com"
}
],
"message": "Here's the file that we're collaborating on.",
"requireSignIn": true,
"sendInvitation": true,
"roles": [
"write"
],
"password": "password123"
}
If the answer is helpful, please click "Accept as Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.