Skip to content

Latest commit

 

History

History
120 lines (79 loc) · 4.32 KB

File metadata and controls

120 lines (79 loc) · 4.32 KB
title driveItem: discardCheckout
description Discard a previously checked out driveItem.
author javieralvarezchiang
ms.localizationpriority medium
ms.subservice sharepoint
doc_type apiPageType
ms.date 12/10/2024

driveItem: discardCheckout

Namespace: microsoft.graph

Discard the check out of a driveItem. This action releases a driveItem resource that was previously checked out. Any changes made to the item while it was checked out are discarded.

The same user that performed the checkout must discard it. Another alternative is to use application permissions.

[!INCLUDE national-cloud-support]

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

[!INCLUDE app-permissions]

HTTP request

POST /drives/{driveId}/items/{itemId}/discardCheckout
POST /groups/{groupId}/drive/items/{itemId}/discardCheckout
POST /me/drive/items/{item-id}/discardCheckout
POST /sites/{siteId}/drive/items/{itemId}/discardCheckout
POST /users/{userId}/drive/items/{itemId}/discardCheckout

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this action returns a 204 No Content response code.

The request returns 400 Bad Request if the file isn't checked out. Requests made with delegated access return 423 Locked if another user has the file checked out. Requests made with application access can discard any checkout.

For more information about how errors are returned, see Error responses.

Examples

Request

The following example shows a discard checkout request on a file identified by {item-id}.

POST https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{item-id}/discardCheckout

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]



Response

The following example shows the response.

HTTP/1.1 204 No content