Lock or Unlock Documents in Zoho Writer
Table of Contents
Note:
- Each time the zoho.writer.documents.lock integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.writer.documents.lock integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Description
The zoho.writer.documents.lock task locks or unlocks the specified document. This task is based on the Zoho Writer Lock/Unlock Document API.
Syntax
<response> = zoho.writer.documents.lock(<document_id>, <enableLock>, <connection>);
where:
| Params | Data type | Description |
| <response> | KEY-VALUE | The response returned by Zoho Writer. It represents the status of the lock along with the detail of the user who locked/unlocked it. |
| <document_id> | TEXT | The ID of the document to be locked/unlocked. The document ID can be obtained from the URL of the document which needs to be locked/unlocked. The URL is in the following format: |
| <enableLock> | TEXT | 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. |
| <connection> | TEXT | The connection's link name. Note:
|
Example
The following script locks the given Writer document.
document_id = "h36bc2a6c50b2754a405880c1d1679a5f5be9"; enableLock = "true"; //true|false response = zoho.writer.documents.lock(document_id, bool enableLock, "writer_oauth_connection"); info response;
where:
response"h36bc2a6c50b2754a405880c1d1679a5f5be9""true""writer_oauth_connection"Response Format
{ "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." }