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

ParameterValueDescription
Mandatory Parameter
apikey423s*****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.

document - if the input file is from your local drive or desktop.

url - if the input file is from a publicly accessible Web URL.

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_languageenSet 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

ParameterTypePossible ValuesDefault Value
Mandatory Keys
urlstringURL - Maximum length -> 65535URL
Optional Keys
outputstringpdfpdf
http_method_typestringpost / putpost
retriesinteger0 to 30
timeoutinteger1 to 120000 milliseconds120000

form_options

ParameterTypePossible ValuesDefault ValueDescription
downloadbooleantrue / falsetrueTo enable or disable download option in the form.
printbooleantrue / falsetrueTo enable or disable print option in the form.
submitbooleantrue / falsetrueTo enable or disable submit option in the form.

form_language

ParameterTypePossible ValuesDefault Value
form_languagestringen / es / jpen

document_info

ParameterTypePossible ValuesDefault Value
document_idstring24eru24960v 
document_namestringSampleUntitled

user_info

ParameterTypePossible ValuesDefault Value
user_idinteger03588563264 
display_namestringKen/James/AdamGuest

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:

  1. 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.
  2. 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 NameTypeDescription
dataJSONThe dat filled in the fillable form.
document_infoJSONThe unique id and the display name of the fillable form.
user_infoJSONThe user id and the display name of the user.
output_bytesBytesThe 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'\''}' 
  

Sample Response

Copied{ 
fillable_form_url: "https://api.office-integrator.com/writer/officeapi/v1/fillabletemplates/<id>/fill" 
}