Zoho Writer > Writer - REST API Methods > ZW - Rename a document

ZW - Rename a document

Tags:  



Rename an existing document in Zoho Writer.



Request URL  POST Method

                            XML : http://export.writer.zoho.com/api/private/xml/renamedocument?apikey=[API Key]&ticket=[Ticket]

 JSON : http://export.writer.zoho.com/api/private/json/renamedocument?apikey=[API Key]&ticket=[Ticket] 
 
Request parameters :

To rename an existing document in Zoho Writer, we need to submit a form data to Writer with the following fields:

Field
Description
documentName
Provide new name for the existing document
Note : Doc name should be a combination of characters (A-Z or a-z), numbers (0-9), hyphen (-) & underscore (_).
documentId
Id of the existing document


Sample Form (POST Method)


<form method="POST"    action="http://export.writer.zoho.com/api/private/xml/renamedocument?apikey=[APIKEY]&ticket=[Ticket]">

<input type="hidden" name="documentId" value="[Specify unique ID of the existing document]">

<input type="hidden" name="documentName" value="[New name of the existing document]">

<input type="submit" value="RenameDoc" class="divbutton" name="submit">

</form>



* It is mandatory to pass the apikey and ticket parameters to access the newDocument api.

Response fields

The schema document for the API response is located at: http://export.writer.zoho.com/schema/restapi/save.xsd

Field
Description
documentId
Unique ID associated with the existing document.
documentName
New name of the existing document.
version
New version of the document after rename and save.
document_name_url
Unique document url to differential multiple documents having similar name.
shared_users
Lists the Zoho IDs of the shared users, in case the document has been shared.
document_locked
Checks whether the document is locked for editing in case it is a shared one. Takes true or false as a value.
document_blogged
Checks whether the document has been posted to any of the blog services. Takes true or false as a value.
authorName
Displays the Zoho ID of the document owner - the account from which the document is created.
created_date
Displays the created date of the document.


Sample Response

The following is the sample XML response for the above method:


<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/api/private/xml/renamedocument">
  <result>

    <documentId>
8892000000068007</documentId>
        <documentName>Help Center</documentName>
        <version>1.4</version>
        <document_name_url>ZW Help</document_name_url>
        <shared_users>[kate, mick]</shared_users>
        <document_locked>false</document_locked>
        <document_blogged>false</document_blogged>
        <authorName>bob</authorName>
        <created_date>1224050060059</created_date>

  </result>
</response>


Equivalent JSON response


{
  "response":
   {
        "uri": "/api/private/json/renamedocument",
        "result":
        {
 
            "
documentId":"8892000000068007",
            "documentName":"Help Center",
            "version":"1.4",
            "document_name_url":"ZW Help",
            "shared_users":"[kate, mick]",
            "document_locked":"false",
            "document_blogged":"false",
            "authorName":"bob",
            "created_date":"1224050060059",
        }
    }
}  



Errors


Creating a new document method may return general errors. Other HTTP error code may be 1401, 1404, 1832 & 1833.    


 RSS of this page