Create Fillable Link
Purpose
To create a fillable link for a given document to fill and submit it as a form.
HTTP Request URL
https://{api.office-integrator_domain}/writer/officeapi/v1/fillabletemplates/fillablelink
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, docx and pdf. |
submit_settings | { "callback_options": { "url": <Your Save URL>, "output": { format: 'pdf', <filename>: '${filename}' }, "http_method_type": "post", "retries": <Integer>, "timeout": <Integer>, }, "redirect_url":<URL>, "onsubmit_message":<String> } | Using this param, you will be able to specify the following; url -> Provide your server location to which the data filled in the form needs to be pushed when the 'Submit' is performed. The below key values are optional; output -> Specify the format in which the submitted form needs to be generated. As of now, we only support 'PDF' as the output format. You can also customise the name of the submitted form using the <filename> key. 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 callback url. redirect_url -> Specify the page URL to which the user needs to be redirected once the form is submitted. onsubmit_message -> Specify the message that needs to be displayed when the form is submitted. |
Optional Parameters - Editor Customization | ||
form_options | { "download":true, "print":true, "submit":true, } | Define the form permissions for the users. |
form_language | en | Set the interface language for the fillable form. |
prefill_data | { "name":"Amelia" } | Define the data that needs to be pre-filled in the form. Example: {"name":"Amelia"} - The value 'Amelia' will be pre-filled in the fillable field with label 'name'. Note: Only fillable fields with labels can be pre-filled. |
document_info | { "document_name":"New", "document_id":"1349" } | Set a unique id and specify display name of the new fillable template. |
user_info | { "user_id":"9173", "display_name":"Ken" } | Identify the user in the document with "user_id" and "display_name". |
Note:
Editor customization parameters and their values are case-sensitive.
Editor Customization Parameters
submit_settings
Parameter | Type | Possible Values | Default Value |
Mandatory Keys | |||
url | string | URL - Maximum length -> 65535 | URL |
Optional Keys | |||
output | string | ||
http_method_type | string | post / put | post |
retries | integer | 0 to 3 | 0 |
timeout | integer | 1 to 120000 milliseconds | 120000 |
form_options
Parameter | Type | Possible Values | Default Value | Description |
download | boolean | true / false | true | To enable or disable download option in the form. |
boolean | true / false | true | To enable or disable print option in the form. | |
submit | boolean | true / false | true | To enable or disable submit option in the form. |
form_language
Parameter | Type | Possible Values | Default Value |
form_language | string | en / es / jp | en |
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 |
url usage:
Zoho Office Integrator allows partners and businesses to save the data filled in the form to their specified storage server through "url" method.
A callback url is a publicly accessible web URL/Service to which Zoho will push the data filled in the form to the partner's server from Writer editor.
In order to use the 'url' 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 'url' 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
Response on form submit:
When the form is submitted, we will be pushing back the information with the following key names:
Key Name | Type | Description |
data | JSON | The dat filled in the fillable form. |
document_info | JSON | The unique id and the display name of the fillable form. |
user_info | JSON | The user id and the display name of the user. |
output_bytes | Bytes | The submitted form in the configured output format. |
Sample Response:
{
data:{
'name’:’Amelia’
...
},
document_info:{
"document_name":"New",
"document_id":"1349"
},
user_info:{
'user_id':'9173',
'display_name’:’Ken’
},
output_bytes:<bytes>
}
Sample Request
Copiedcurl -X POST \
https://api.office-integrator.com/writer/officeapi/v1/fillabletemplates/fillablelink \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F apikey=423s***** \
-F document=@/Users/username/Documents/Sample.docx \
-F 'submit_settings={'\"redirect_url'\":'\"'\",'\"onsubmit_message'\":'\"Submitted Successfully'\",'\"callback_options'\":{'\"url'\":'\"https://domain.com/save.php'\",'\"http_method_type'\":'\"post'\"}}' \
-F 'form_language=en' \
-F 'form_options={'\''download'\'':true,'\''print'\'':true,'\''submit'\'':true}' \
-F 'document_info={'\''document_name'\'':'\''New'\'', '\''document_id'\'':1349}' \
-F 'user_info={'\''user_id'\'':'\''1973'\'','\''display_name'\'':'\''Ken'\''}'