Unreserve File

post

/documents/api/1.1/files/{fileId}/unreserve

Remove the reservation from the specified file. A file reservation lets other users (or processes) know that the file is in use.

Request

Supported Media Types
  • application/json
  • application/xml
Path Parameters
fileId
Type: string
Required: true

Globally unique identifier (GUID) for the file.

Header Parameters
dAccessCode
Type: string

Access code needed to use protected public links. It needs to be sent as part of a Cookie header in the following format: dAccessCode-<linkID>=<passcodeValue>

linkID
Type: string

Public link ID of a public link authorizing the current user to access this file. To work, this public link must have the contributor role granted. It can be used as linkID or LinkID.

Body Parameter

The request body defines details of the unreserve file request. Bold indicates a required value.

Root Schema : FileUnreserveBody

The request body defines details of the unreserve file request. Bold indicates a required value.

Example application/json

{
    "reservedByUserID":"U0EAA20910FAF3052ACB79E4T00000000001"
}

Response

Supported Media Types
  • application/json
  • application/xml
200 Response

The request was fulfilled.

Body
The response body includes information about the unreserve operation.
Root Schema : FileUnreserveResponse
The response body includes information about the unreserve operation.
Example application/json

{
    "id":"D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD",
    "type":"file",
    "errorCode":"0"
}
403 Response

Forbidden if the user does not have read permission.

404 Response

File ID is not found.

Examples

The following example removes the reservation from the specified file.

POST .../files/D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD/unreserve

Request Header

None.

Request Body

{
    "reservedByUserID": "UC2E53B19A37A58B8CE28F3B1212FF6185DE"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "errorCode": "0",
    "id": "D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD",
    "type": "file"
}

Example 2

The following example removes the reservation from the specified file. The example uses a public link ID because this file is under a folder structure not owned by or shared with the current user.

POST .../files/D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD/unreserve

Request Header

LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518

Request Body

{
    "reservedByUserID": "U6A0B35B0548F250914D18FDB5D17B95F470"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "errorCode": "0",
    "id": "D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD",
    "type": "file"
}

Example 3

The following example removes the reservation from the specified file. The example uses a public link ID protected by an access code because this file is under a folder structure not owned by or shared with the current user. an access code (test12345) is submitted as part of a Cookie in the request header.

POST .../files/D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD/unreserve

Request Header

LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518
Cookie: dAccessCode-LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518=test12345

Request Body

{
    "reservedByUserID": "U6A0B35B0548F250914D18FDB5D17B95F470"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "errorCode": "0",
    "id": "D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD",
    "type": "file"
}

Example 4

The following example requests removal of the reservation from the specified file. Because this file is under a folder structure not owned by or shared with the current user, an access denied error message is returned.

POST .../files/D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD/unreserve

Request Header

None.

Request Body

{
    "reservedByUserID": "U6A0B35B0548F250914D18FDB5D17B95F470"
}

HTTP Status Code

HTTP_STATUS = 403

JSON Response

{
    "errorCode": "-20",
    "errorKey": "!csFldCouldNotClearReservation!csCloudItemInsufficientPrivileges,User BB,fFileGUID:D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD,FLD_CLEAR_RESERVATION",
    "errorMessage": "Could not clear reservation. User 'User BB' has insufficient privilege to access fFileGUID:D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD with service FLD_CLEAR_RESERVATION.",
    "id": "D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD",
    "title": "Could not clear reservation. User 'User BB' has insufficient privilege to access fFileGUID:D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD with service FLD_CLEAR_RESERVATION.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 5

The following example requests removal of the reservation from the specified file. This file is under a folder structure not owned by or shared with the current user, and only a public link protected by an access code is available. An error is returned because the access code was not submitted as part of the request.

POST .../files/D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD/unreserve

Request Header

LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518

Request Body

{
    "reservedByUserID": "U6A0B35B0548F250914D18FDB5D17B95F470"
}

HTTP Status Code

HTTP_STATUS = 403

JSON Response

{
    "errorCode": "-18",
    "errorKey": "!csFldCouldNotClearReservation!csAccessCodeRequiredForLinkAccess",
    "errorMessage": "Could not clear reservation. The access code must be provided to access the link.",
    "id": "D5B8B54BA8C121BEDB91A1341212FF6185DEA5EFC0BD",
    "title": "Could not clear reservation. The access code must be provided to access the link.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}