List shared

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.

Calculated insight that returns the list of files shared with a user.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Sites.Read.All, Sites.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application Sites.Read.All, Sites.ReadWrite.All

HTTP request

GET /me/insights/shared

Request with a 'user id' or 'userPrincipalName' is only accessible by the user, not by anyone else:

GET /users/{id | userPrincipalName}/insights/shared

Optional query parameters

This method supports the OData Query Parameters to help customize the response.

You can use the $filter query parameter to filter shared items. For example, based on Type:

https://graph.microsoft.com/beta/me/insights/shared?$filter=ResourceVisualization/Type eq 'PowerPoint'

See the available Container Types and Types you can filter by in resourceVisualization.

You can also retrieve files shared by a specific user. For example, by specifying the lastshared/sharedby/address property:

https://graph.microsoft.com/beta/me/insights/shared?$filter=lastshared/sharedby/address eq 'kellygraham@contoso.com'

See the sharingDetail complex type.

Request headers

Header Value
Authorization Bearer {token}. Required.
Accept application/json

Request body

Do not supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a list of shared items in the response body.

Example

Request

Here is an example of the request.

GET https://graph.microsoft.com/beta/me/insights/shared
Response

Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.

{
    "value": [
        {   
            "id": "id-value",
            "lastShared" : { 
                "sharedDateTime" : "sharedDateTime-value",  
                "sharingSubject" : "sharingSubject-value",
                "sharingType" : "sharingType-value", 
                "sharedBy" : { 
                    "displayName" : "displayName-value", 
                    "id": "id-value" 
                }
                "sharingReference" : { 
                    "webUrl" : "webUrl-value",
                    "type: "type-value", 
                    "id": "id-value"
                } 
            },
            "resourceVisualization": { 
                "title" : "title-value, 
                "type"  : "type-value",
                "mediaType" : "mediaType-value",
                "previewImageUrl" : previewImageUrl-value, 
                "previewText" : "previewText-value", 
                "containerWebUrl" : "containerWebUrl-value", 
                "containerDisplayName" : "containerDisplayName-value", 
                "containerType" : "containerType-value" 
            }, 
            "resourceReference" : { 
                "webUrl" : "webUrl-value", 
                "id": "id-value", 
                "type: "type-value" 
}

Expanding resource

The resource referenced by a shared insight can be expanded.

GET https://graph.microsoft.com/beta/me/insights/shared/{id}/resource