How do I edit documents in Zoho Writer? Any sample codes?

How do I edit documents in Zoho Writer? Any sample codes?

To edit an existing document from your web application, you need to make use of Zoho Writer's Edit Document API.

HTML Sample Code:


<form method="POST" action=" https://writer.zoho.com/writer/officeapi/v1/document" enctype="multipart/form-data" target="_self" 
accept-charset="UTF-8">

Upload Document for Edit: <input type="file" name="document" size="38"> <br><br>

<input type="hidden" name="apikey" value="423s*****">
<input type="hidden" name="permissions" value='{"document.export":true,"document.print":true,"document.edit":true,"review.comment":true,"collab.chat":true}'>
<input type="hidden" name="editor_settings" value='{"unit":"in", "language":"en","view":"pageview"}'>
<input type="hidden" name="callback_settings" value='{"save_format":"docx","save_url":"https://yourdomain.com/save.php","context_info":"Doc Info"}'>
<input type="hidden" name="document_info" value='{"document_name":"Sample", "document_id":"138859911"}'>
<input type="hidden" name="user_info" value='{"user_id":"1000", "display_name":"James"}'>
<input type="submit" name="submit" value="Edit Document">
</form> 


Curl Sample Code:


curl -X POST \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F apikey=423s***** \
  -F  document=@/Users/username/Documents/Sample.docx \
  -F 'editor_settings={'\''unit'\'':'\''in'\'','\''language'\'':'\''en'\'','\''view'\'':'\''pageview'\''}' \
  -F 'permissions={'\''document.export'\'':true,'\''document.print'\'':true,'\''document.edit'\'':true,'\''review.changes.resolve'\'':false,'\''review.comment'\'':true,'\''collab.chat'\'':true}' \
  -F 'callback_settings={'\''save_format'\'':'\''docx'\'','\''context_info'\'':'\''doc or user info'\'','\''save_url'\'':'\''https://yourdomain.com/save.php/'/''}' \
  -F 'document_info={'\''document_name'\'':'\''Sample'\'', '\''document_id'\'':138859911}' \
  -F 'user_info={'\''user_id'\'':'\''1000'\'','\''display_name'\'':'\''James'\''}'

You can also build and test Edit Document requests right from your browser with Office Integrator Postman Collection.

    • Related Articles

    • How do I compare two documents in Zoho Writer? Any sample codes?

      To compare two versions of a document, you need to make use of Zoho Writer's Comparison API. HTML Sample Code: <form method="POST" action="https://writer.zoho.com/writer/officeapi/v1/document/compare" enctype="multipart/form-data" ...
    • How do I preview a document in Zoho Writer? Any sample codes?

      To preview a document or open it in read-only mode, you need to make use of Zoho Writer's Preview Document API. HTML Sample Code: <form method="POST" action="https://writer.zoho.com/writer/officeapi/v1/document/preview" enctype="multipart/form-data" ...
    • How do I create a new document in Zoho Writer? Any sample codes?

      To create a new document from scratch, you need to make use of Zoho Writer's Create Document API. HTML Sample Code: <form method="POST" action="https://writer.zoho.com/writer/officeapi/v1/document" enctype="multipart/form-data" target="_self"  ...
    • How do I save documents locally using "save_url" method? Any sample codes available?

      A "save_url" is a publicly accessible Web hook or a Web URL to which Zoho will push the updated document content from its Office editors (Writer, Sheet, Show) to your storage server. In order to make use of "save_url" method and save document ...
    • Sample Codes - Java SDK

      All of Zoho CRM's APIs can be used through the Java SDK, to enable your custom application to perform data sync to the best degree. Here are the sample codes for all the API methods available in our SDK. Rest Client Operations These methods involve ...