Rename Document in Zoho Writer

Note:

  • Each time the zoho.writer.documents.setName 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.setName 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.setName task allows you to rename a document. This task is based on the Zoho Writer Rename Document API.

Note: Applicable to all services except Zoho Creator.

Syntax

<response> = zoho.writer.documents.setName(<document_id>, <name>, <connection>)

where:

ParamsData typeDescription
<response>KEY-VALUEThe response returned by Zoho Writer. It represents the status of the document rename.
<document_id>TEXT

The ID of the document which needs to be renamed.

The document ID can be obtained from the URL of the document which needs to be renamed.

The URL is in the following format: https://writer.zoho.com/writer/open/<document_id>

<name>StringPass a String value through the name key inside the JSONObject.
<connection>TEXT

The connection's link name.

Note:

  • To prevent new authtoken generation and ensure new integration tasks (created after the deadline specified in the post) work as expected, a Zoho OAuth connection with appropriate scopes is mandatory. Existing integration tasks will continue to work, with or without the connections parameter, until you manually delete the authtoken from Zoho Accounts.

  • Add relevant scopes from the Zoho Writer API when creating the connection.

  • Refer to this post for a list of Zoho services that support the Connections page.

  • Learn more about connections

Example

The following script renames the given document with given name.

document_id = "h36bc2a6c50b2754a405880c1d1679a5f5be9";
name = "Online Word Document";
response = zoho.writer.documents.setName(document_id, name, "writer_oauth_connection");
info response;

where:

response
The KEY-VALUE response returned by Zoho Writer. It represents whether the document has been renamed or not.
"h36bc2a6c50b2754a405880c1d1679a5f5be9"
The TEXT that represents the ID of the document in Zoho Writer.
"Online Word Document"
The STRING that represents the new name of the document.
"writer_oauth_connection"
The TEXT that represents the name of the connection.

Response Format

{
  "result": "success",
  "name": "Online Word Document",
  "message": "Document has been renamed successfully."
}

Related Links