Return the shared items that exist in the target drive.
Note: this API is only available on OneDrive Personal.
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) | Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All |
| Delegated (personal Microsoft account) | Files.Read.All, Files.ReadWrite.All |
| Application | Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All |
HTTP request
GET /drive/shared
Response
This returns a collection of driveItem resources that enumerates the set of items that have been shared by the current user.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{ "id": "1231abc", "name": "shared-file1.txt" },
{ "id": "1231abd", "name": "shared-file2.txt" },
{ "id": "1231abf", "name": "shared-file3.txt" },
]
}
Error Responses
Read the Error Responses topic for more information about how errors are returned.
Remarks
- Shared By Me is not supported on:
- SharePoint Server 2016
- SharePoint online
- OneDrive for Business