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


API Home >> Sheet >> API Reference >> books



Save an existing workbook with a new version.



Request URL : POST

                                XML : http://sheet.zoho.com/api/private/xml/savebook/[BookID]?apikey=[API Key]&ticket=[Ticket]

                                JSON : http://sheet.zoho.com/api/private/json/savebook/[BookID]?apikey=[API Key]&ticket=[Ticket]

Request parameters
:

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

Field
Description
content
Content of the file.
updateLock
[string] - Advisory lock for update operation
contentType [optional]
[booktype - (xls|sxc|csv)] -- contentType will be derived from the attached file name by default. Use this parameter, if you want to override this.
isOverwrite [optional]
[boolean] - Forcibly overwrite in case of update conflict. False by default.


Sample Form (
POST Method)



<form method="POST"    action="http://sheet.zoho.com/api/private/xml/savebook/15265000000006067?apikey=[APIKEY]&ticket=[Ticket]" enctype="multipart/form-data" target="_self">

File: <input name="file" name="content" size="38"> <br>

<input type="hidden" name="contentType" value="xls">

<input type="hidden" name="updateLock" value="[updatelock value]">

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

</form>




Response fields


Field
Description
workbookId
Unique ID associated with the workbook that is being saved with new version.
workbookName
Name of the saved workbook.
modifiedTime
Number of milliseconds between the last modified time and midnight, January 1, 1970 UTC.
updateLock
Advisory lock for update operation. Ensures that updates made to workbook are consistent.


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/savebook/15265000000006067">
  <result>

     <workbookId>
15265000000006067</workbookId>
        <workbookName>MonthlySales</workbookName>
     <modifiedTime>1174374756812</modifiedTime>
     <updateLock>1174374756812</updateLock>

  </result>
</response>


Equivalent JSON response


{
  "response":
   {
        "uri": "/api/private/json/savebook/15265000000006067",
        "result":
        {
   
            "
workbookId":"15265000000006067",
            "workbookName":"MonthlySales",
            "lastModifiedTime":1174374756812,
            "updateLock":"1174374756812"
        }
    }
}  



Errors


Saving an existing workbook with new version method may return general & input errors. Other specific HTTP error codes include 2851, 2852, 2853, 2854 & 2855.