Create Fillable Link

Purpose

Create a fillable link for a given document to fill and submit it as a form. Users can upload an existing fillable template from their local drive or a publicly accessible Web URL and generate a fillable link.

Quick Reference

PropertyValue
MethodPOST
Request URLhttps://{api.office-integrator_domain}/writer/officeapi/v1/fillabletemplates/fillablelink
Content-Typemultipart/form-data

Parameters

Body Parameters

ParameterValueMandatory/OptionalDescription
apikey423s*****MandatoryUniquely identifies the web application in which the Writer editor is integrated.
document or urlFile or StringMandatoryMethod 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>
}
Mandatory

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 saveurl.
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.

form_options{
 "download":true,
 "print":true,
 "submit":true
}
OptionalDefine the form permissions for the users.
form_languageenOptionalSet the interface language for the fillable form.
prefill_data{
 "name":"Amelia"
}
OptionalDefine 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"
}
OptionalSet a unique document ID and specify the display name of the new fillable template.
user_info{
  "user_id":"9173",
  "display_name":"Ken"
}
OptionalIdentify the user in the document with a user ID and display name.

submit_settings

Parameter/KeysTypeMandatory/OptionalPossible ValuesDefault Value
callback_options.urlStringMandatoryURL (max length: 65535)
callback_options.outputStringOptionalpdfpdf
callback_options.http_method_typeStringOptionalpost / putpost
callback_options.retriesIntegerOptional0 to 30
callback_options.timeoutIntegerOptional1 to 120000 (ms)120000
redirect_urlStringOptionalURL
onsubmit_messageStringOptionalAny string

url Usage

Zoho Office Integrator allows partners and businesses to save the data filled in the form to their specified storage server through the 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.

Requirements:

  • Partner's remote servers need to expose one of their ports — port 443 (HTTPS) or port 80 (HTTP) — for Zoho Writer to push the data back.
  • The url value specified in the 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, the following key names are pushed back:

Key NameTypeDescription
dataJSONThe data 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>
}

form_options

Parameter/KeysTypeMandatory/OptionalPossible ValuesDefault Value
downloadBooleanOptionaltrue / falsetrue
printBooleanOptionaltrue / falsetrue
submitBooleanOptionaltrue / falsetrue

form_language

Parameter/KeysTypeMandatory/OptionalPossible ValuesDefault Value
form_languageStringOptionalen / es / jpen

document_info

Parameter/KeysTypeMandatory/OptionalPossible ValuesDefault Value
document_idStringOptionale.g., 24eru24960v
document_nameStringOptionale.g., SampleUntitled

user_info

Parameter/KeysTypeMandatory/OptionalPossible ValuesDefault Value
user_idStringOptionale.g., 03588563264
display_nameStringOptionale.g., Ken / James / AdamGuest

Notes and Limits

  • Editor customization parameters and their values are case-sensitive.
  • The callback url must be a publicly accessible URL over port 443 (HTTPS) or port 80 (HTTP).
  • Only fillable fields with labels can be pre-filled using prefill_data.
  • Supported file formats during import: zfdoc, zdoc, docx and pdf.
  • As of now, only 'PDF' is supported as the output format for submitted forms.
  • You can customize the name of the submitted form using the <filename> key inside the output parameter.
  • For possible error codes, refer to: Error Codes
  • For other server-side SDK sample code, refer to: Server-Side SDKs

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" 
}