Edit Fillable Template
Purpose
To edit a fillable template in Zoho Writer. Users can upload an existing fillable template from their local drive or a publicly accessible Web URL and edit online.
HTTP Request URL
https://writer.zoho.com/writer/officeapi/v1/fillabletemplates
Request Parameters
Parameter | Value | Description |
Mandatory Parameter | ||
apikey | 423s***** | Uniquely identifies the web application in which the Writer editor is integrated. |
document or url | File or String | Method of providing the input file depending on its location. Supported file formats during import: zfdoc, zdoc, doc,docx, rtf, odt, htm, html, txt and pdf. |
callback_settings | { "save_url":<Your Save URL>, "http_method_type": "post", "retries": <Integer>, "timeout": <Integer>, "save_url_params": { .... } } | Using this param, you will be able to specify the following; save_url -> Provide your server location to which the latest content needs to be pushed back when the 'Save' is performed. Note: By default, the created fillable template will be saved in 'zfdoc' format. The below key values are optional; http_method_type -> Specify the http method in which the save request has to be triggered. retries -> Specify the number of retries required when the 'Save' fails. timeout -> Specify the timeout for the given saveurl. save_url_params -> To customize the output parameters in which the document details will be pushed from our end. |
Optional Parameters - Editor Customization | ||
document_defaults | { "orientation":"portrait", "paper_size":"Letter", "font_name":"Lato", "font_size":14, "track_changes": "disabled", "margin": {"left":"1.5in","right":"1.5in","top":"0.25in","bottom":"0.25in"}, "date_format":"MM/DD/YY" } | Set document defaults such as font name and size, custom date format, paper size / orientation, enable/disable track changes and apply custom margins. |
editor_settings | { "unit":"in", "language":"en", "view":"webview" } | Set Editor preferences like Unit in inch/mm, interface language and view as pageview/webview for new documents. |
permissions | { "document.export":true, "document.print":true, "document.edit":true, "review.changes.resolve":false, "review.comment":true, "collab.chat":true, "document.pausecollaboration":false, "document.fill":true } | Define document permissions for the users. |
document_info | { "document_name":"New", "document_id":"1349" } | Set a unique id and specify display name of the new document. |
user_info | { "user_id":"9173", "display_name":"Ken" } | Identify the user in the document with "user_id" and "display_name". |
ui_options | { "save_button":"show", "chat_panel":"show" } | Specify whether the "Save button" and the "Chat panel" needs to be shown or hidden. |
Note:
Editor customization parameters and their values are case-sensitive.
Custom margin is applicable to new documents only.
Editor Customization Parameters
document_defaults
Parameter | Type | Possible Values | Default Value |
font_name | string | Trebuchet | Arial |
font_size | integer | 9 / 10 / 11 /13 / 16 / 18 (in pixels) | 12 (in pixels) |
orientation | string | portrait / landscape | portrait |
paper_size | string | Letter, A4, Legal, Executive | Letter |
track_changes | boolean | enabled / disabled | disabled |
margin | string | in / mm | 1in |
date_format | string | For example: EEEE, MMMM DD, YYYY at HH:mm Output: Monday, July 15, 2024 at 21:06 | Date format will be displayed based on the document language value. |
editor_settings
Parameter | Type | Possible Values | Default Value |
unit | string | in/mm | in (inch) |
language | string | en / de / es / fr / ja / nl more... | en |
view | string | webview / pageview | pageview ("view" param is applicable to new documents only) |
permissions
Parameter | Type | Possible Values | Default Value | Description |
document.export | boolean | true / false | true | To enable or disable document download option |
document.print | boolean | true / false | true | To enable or disable document print option |
document.edit | boolean | true / false | false | Provide option to allow edit access to the document |
review.comment | boolean | true / false | false | Provide option to manage comments |
review.changes.resolve | boolean | true / false | false | Provide option to resolve track changes |
collab.chat | boolean | true / false | true | To enable or disable chat panel for the collaborators |
document.pausecollaboration | boolean | true / false | false | Provide option to manage collaboration |
document.fill | boolean | true / false | true | Provide option to allow edit access for the fillable fields |
callback_settings
Parameter | Type | Possible Values | Default Value |
Mandatory Keys | |||
save_url | string | URL - Maximum length -> 65535 | URL |
Optional Keys | |||
save_url_params | JSON |
| |
http_method_type | string | post / put | post |
retries | integer | 0 to 3 | 0 |
timeout | integer | 1 to 120000 milliseconds | 120000 |
document_info
Parameter | Type | Possible Values | Default Value |
document_id | string | 24eru24960v | |
document_name | string | Sample | Untitled |
user_info
Parameter | Type | Possible Values | Default Value |
user_id | integer | 03588563264 | |
display_name | string | Ken/James/Adam | Guest |
ui_options
Parameter | Type | Possible Values | Default Value |
save_button | string | show/hide | show |
chat_panel | string | show/hide | show |
save_url usage:
Zoho Office Integrator allows partners and businesses to save the document content back to their specified storage server through "saveurl" method.
A saveurl is a publicly accessible web URL/Service to which Zoho will push the updated document content from Writer editor to the partner's server.
In order to use the saveurl method, partners should fulfill the below requirements:
- Partner's remote servers need to expose one of their ports - port 443 (https) or port 80 (http) - from their location, for Zoho Writer to push the data back.
- The saveurl value specified in the HTTPS/HTTP POST request should be a proper domain name and publicly accessible over the web. Example: https://yourdomain.com/save.php
save_url_params usage:
By default, when the 'Save' is performed, we will be pushing back the information with the following key names:
Key Name | Type | Description |
content | File | Document content will be pushed back in the form of bytes. |
filename | String | Document name |
format | String | Specifies the format in which the document has been exported. |
If you wish to customize the above key names that you need to send back during save call, you can make use of the 'save_url_params' key inside 'callback_settings' parameter.
Once the 'save_url_params' key is configured, only the key values defined inside will be pushed back to your server. The default key names (like filename and format) will not be included. To include them, you need to define your own keys for format and filename by using the system variable $format and $filename respectively.
If the 'save_url_params' is passed as an empty JSON or the system variable $content is not configured, the document bytes will be pushed back with the multipart name 'content' by default.
Syntax:
"save_url_params": {
<custom_content_key>: $content,
<custom_format_key>: $format,
<custom_filename_key>: $filename,
<additional_user_key>: <value>,
<additional_user_key>: <value>,
....
<additional_user_key>: <value>
},
Example:
"save_url_params": {
file: $content,
extension: $format,
document_name: $filename,
<additional_user_key>: <value>,
<additional_user_key>: <value>
},
In the above example, the document bytes will be pushed back in the multipart name 'file', document format in the key name 'extension' and document filename in the key name 'document_name'.
To know about the list of error handling cases in Edit Fillable Template, refer here.
Sample Request
Copiedcurl -X POST \
https://writer.zoho.com/writer/officeapi/v1/fillabletemplates \
-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'\'':'\''webview'\''}' \
-F 'permissions={'\''document.export'\'':true,'\''document.print'\'':true,'\''document.edit'\'':true,'\''review.changes.resolve'\'':false,'\''review.comment'\'':true,'\''collab.chat'\'':true,'\''document.pausecollaboration'\'':false,'\''document.fill'\'':true }' \
-F 'callback_settings={'\''save_url'\'':'\''https://domain.com/save.php/'\'}' \
-F 'document_info={'\''document_name'\'':'\''New'\'', '\''document_id'\'':1349}' \
-F 'user_info={'\''user_id'\'':'\''1973'\'','\''display_name'\'':'\''Ken'\''}' \
-F 'ui_options={"save_button":"show","chat_panel":"show"}'
Sample Response
Copied{
"document_url": "https://writer.zoho.com/writer/officeapi/v1/fillabletemplates/d26aa7b8029bf4f8d34c7dd0013939234a6e15dac88646f02a69582375b8da130efffac249d0erouae4667dcbcfb7ac1d/edit,
"document_id": "1349",
"save_url": "https://writer.zoho.com/writer/officeapi/v1/fillabletemplates/d26aa7b8029bf4f8d34c7dd0013939234a6e15dac88646f02a69582375b8da130efffac249d086aae4667dcbcfb7ac1d/save",
"session_id": "axxrd26aa7b8029bf4f8d34c7dd0013939234a6e15dac88646f02a69582375b8da130efffac249d086aae4667dcbac9p",
"session_delete_url": "https://writer.zoho.com/writer/officeapi/v1/session/d26aa7b8029bf4f8d34c7dd0013939234a6e15dac88646f02a69582375b8da130efffac249d086aae4667dcbcfb7ac1d",
"document_delete_url": "https://writer.zoho.com/writer/officeapi/v1/fillabletemplates/1349",
}