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

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




To restore a particular document from trash.



Request URL POST Method

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

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


Request parameters :

To restore a trashed document to My Docs folder 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.


Sample Form (POST Method)


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

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

</form>



* It is mandatory to pass the apikey and ticket parameters to access the restoreDocument 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 document that is being restored from trash folder.
documentName
Name of the document that is restored to the My Docs folder.


Sample Response

The following is the sample response for the above method:


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

     <documentId>
8892000000009037</documentId>
        <documentName>Invoice</documentName> 

  </result>
</response>


Equivalent JSON response



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


Errors


Restoring a document from trash method may return general errors. Other HTTP error code may be 1404.