PUT api/2.0/files/file/{fileId}/lock This function requires authentication

Description

Locks a file with the ID specified in the request.

Parameters
Name Description Type Example
fileId
sent in url
File ID number 1234
LockFile
sent in body
Specifies whether to lock a file or not Bool value true
Example
PUT api/2.0/files/file/1234/lock
Host: yourportal.onlyoffice.com
Content-Type: application/json
Accept: application/json

{
  "LockFile": true
}
Returns

Locked file information

Example Response
{
  "status": 0,
  "response": {
    "FolderId": 1234,
    "Version": 1234,
    "VersionGroup": 1234,
    "ContentLength": "some text",
    "PureContentLength": 1234,
    "Mute": true,
    "ViewUrl": "some text",
    "WebUrl": "some text",
    "FileExst": "some text",
    "Comment": "some text",
    "Encrypted": true,
    "ThumbnailUrl": "some text",
    "Locked": true,
    "LockedBy": "some text",
    "DenyDownload": true,
    "HasDraft": true,
    "DenySharing": true
  }
}