How to create a sharing link for user scope using createLink?

Ayush Jain 20 Reputation points
2024-01-19T06:56:52.98+00:00

https://learn.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0&tabs=http

This API takes scope parameter in the body, which is the scope for the sharing link. When we use scope as "users". Where do we specify what users are we sharing the link to?

There is no example for "users" scope in the documentation. Yet there is an example for "embed" which is not even in the scope types table.

Does this API take users as a parameter in body? Or is there any other way to give sharing link permissions to specific users.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,445 questions
0 comments No comments
{count} votes

Accepted answer
  1. Chen Li 160 Reputation points
    2024-01-19T08:43:03.8133333+00:00

    Hi @Ayush Jain,

    You can specify the corresponding user in the body, like this:

    {
        "type": "view",
        "scope": "users",
        "recipients": [
            {
                "objectId": "Someone's objectId"
            },
            {
                "objectId": "Someone's objectId"
            }
        ]
    }
    

    The response is as follows:User's image

    Hope this helps. If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful