Users can create a document based on a template by filling out a form. These documents are stored by fillthedoc and given a 32 byte unique (unguessable) hash as identifier. The document can only be fetched using this hash as JSON data, HTML or PDF.
Create a document
Example request body
"cao_name": "CAO Employee Pension",
templateproperty is required and can be a template id or template reference. When creating a new document, the latest version of the template is always used. Only published templates can be used to create a document.
The document can be prefilled by adding a
valuesproperty in the request. The data should match the structure defined by the template's form.
The response contains an
edit_urlproperty. If the end user needs to complete the information for the document, send him to this URL. The document id is a unique and unguessable 32 bit random value. The user doesn't need any information other than this URL.
callbackURL was specified when creating the document, it will be called when the end user completes filling out the document. The request body is a JSON representation of the document and similar to the response body when creating a document.
The document will automatically be locked after the user has completed the form. You may update the document to unlock it.
Retrieve a document
Acceptheader to specify if you'd like to receive the document data and metadata as JSON or just contents as PDF or HTML.
Do not send the URL for generating the PDF directly to the end user. It will not be accessible without the API key. Instead, use the API to download the PDF, store it locally, and allow the user to download it from your system.
Update a document
Example request body
Documents are automatically be locked after the user has completed the form. This is indicated by the
stepproperty which is set to
finished. Set the
nullto allow the user to modify the document. The edit url remains unchanged. Once the end user is finished, the webhook (specified as
callbackwhen the document was created) will be called again.
It's possible to modify the data, prior to generating the PDF or HTML document, via the
valuesproperty. The values are merged, even for nested data, as specified by RFC 7396 (regardless of the
Delete a document