How do I create a new document in Zoho Writer? Any sample codes?

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" 
accept-charset="UTF-8">

<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="document_defaults" value='{"orientation":"portrait","paper_size":"Letter","font_name":"Lato","font_size":12,"track_changes":"disabled","margin": {"left":"1.5in","right":"1.5in","top":"0.25in","bottom":"0.25in"}}'>
<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://zylker.com/save.php","context_info":"Doc Info"}'>
<input type="hidden" name="document_info" value='{"document_name":"New Document", "document_id":"130003"}'>
<input type="hidden" name="user_info" value='{"user_id":"1000", "display_name":"Jack"}'>
<input type="submit" name="submit" value="Create New Document">
</form> 


Curl Sample Code:


curl -X POST \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F 'apikey=423s*****' \
  -F 'document_defaults={"font_size":"12","font_name":"Roboto","orientation":"portrait","paper_size":"A4","track_changes":"disabled","margin": 
       {"left":"1.5in","right":"1.5in","top":"0.25in","bottom":"0.25in"}}' \
  -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","save_url":"https://zylker.com/save.php%22,%22context_info%22:%22Value can be used during save callback" }' \
  -F 'document_info={"document_name":"New Document","document_id":130003}' \
  -F 'user_info={"user_id":"3001083","display_name":"Jack"}'


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


    • Related Articles

    • 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 ...
    • Sample Codes - Python SDK

      All of Zoho CRM's APIs can be used through the Python 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 ...
    • Sample Codes - C# SDK

      All of Zoho CRM's APIs can be used through the C# 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 ...
    • 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 presentation in Zoho Show? Any sample codes?

      To create a new presentation, please leave the "document" or "url" parameter in the  Edit API request  as blank. Zoho Show will create a new presentation by default if no content is provided in the Edit request. HTML Sample Code: <form method="POST" ...