Zoho - Trademark
Blogs
  Forums  Writer Home
  Toll Free : 888 900 9646

API Home >> Writer >> API Reference >> POST Method APIs



To save an existing document with a new version. (The old content will be replaced with new one)



Request URL POST Method

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

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


Request parameters :

To save an existing document with a new version in Zoho Writer we need to submit a form data to Writer with the following fields:

Field
Description
documentId
Unique ID of the existing document.
content
Specify the new content for the document. All the previous content will be replaced with the new one.


Sample Form (POST Method)


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

<input type="hidden" name="content" value="[Specify Doc content here]">

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

</form>



* It is mandatory to pass the apikey and ticket parameters to access the saveDocument 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 saved document.
documentName
Name of the saved document with a new version & content.
version
New version number of the saved 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/saveDocument/8892000000009037">
  <result>

     <documentId>
8892000000009037</documentId>
        <documentName>Invoice</documentName> 
        <version>1.9</version>

  </result>
</response>


Equivalent JSON response


{
  "response":
   {
        "uri": "/api/private/json/saveDocument/8892000000009037",
        "result":
        {
   
            "
documentId":"8892000000068007",
            "documentName":"Invoice",
            "version":"1.9"
        }
    }
}  


Errors

Saving a document with new version method may return general errors. Other HTTP error code may be 1404.