Permissions required for /invite endpoint vs /createLink in Sharepoint via Graph API

Christopher Wilson 21 Reputation points
2021-09-16T15:16:37.953+00:00

I can create a sharing link via the POST /sites/{siteId}/drive/items/{itemId}/createLink endpoint, which works correctly. This allows editing by all members of our organization with the link however, whereas I would like only for specific users to be able to do so.

When I attempt to use the POST /sites/{siteId}/drive/items/{itemId}/invite endpoint, which appears to accomplish what I am after, I receive a 403 response with the following message:

{'code': 'notAllowed', 'message': 'The feature has been disabled. Please contact your admin to get it enabled.'}

Is anyone able to point me to the correct configuration that will enable me to use this endpoint? I am able to perform this action in the UI, so do not believe it to be an issue with settings on the site itself. I am also confused as to why I am able to share with the entire organization, but not specific members!

Kind regards,

Christopher Wilson

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author
MichaelHan-MSFT 18,136 Reputation points
2021-09-17T02:14:40.753+00:00

Hi @Christopher Wilson ,

Try to set requireSignIn parameter to true in the body as the below, check if it works for you.

{  
    "requireSignIn": true,  
    "sendInvitation": true,  
    "roles": [  
        "write"  
    ],  
    "recipients": [  
        {  
            "email": "******@contoso.onmicrosoft.com"  
        }  
    ],  
    "message": "test message"  
}  

If an Answer is helpful, please click "Accept Answer" and upvote it.
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.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.