Lock/Unlock Document

Purpose 

Using this API, you can either lock or unlock the document. Once the document is locked, the other users will not be able to edit the document unless you unlock it.

HTTP Request URL

https://{zohoapis_domain}/writer/api/v1/documents/{{document_id}}/meta

Path Parameters

ParameterData TypeDescription
Mandatory Parameters
document_idStringSpecify the unique id for the Writer document.

Body Parameters

ParameterData TypeDescription
Mandatory Parameters
operationsJSONObject

Pass a boolean value (either true or false) through 'lock' key inside the JSONObject.

1. If you would like to lock the document, pass the value as 'true'.

2. If you would like to unlock the document, pass the value as 'false'.

Note: You can also lock or unlock the document using this deluge task.

Sample Request

Copiedcurl -X POST \
  https://www.zohoapis.com/writer/api/v1/documents/h36bc2a6c50b2754a405880c1d1679a5f5be9/meta \
  -H 'Authorization: Zoho-oauthtoken xxx.yyy.zzz' \
  -H 'cache-control: no-cache' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F 'operations={"lock": true}'

Sample Response

Copied{
  "result": "success",
  "locked_by": {
    "email_id": "zylker@abc.com",
    "profile_photo": "https://contacts.zoho.com/file?t=user&ID=4579020&fs=thumb",
    "user_id": "4579020",
    "display_name": "Zylker"
  },
  "message": "Document lock operation has been completed successfully."
}