Web Forms

FormAPI can automatically generate web-based forms based on your template schemas. If you send your users a link to this form, they can fill out the form to generate a PDF. You can then redirect users to a different page after they have filled out the form.

You can also embed our web-based forms on your own website. Our embedded form library can be configured with JavaScript options and callbacks.

Configure Template Privacy Settings

First, you will need to go to your template's settings and make sure that "Online Form Privacy" is set to "Public". This will allow unauthenticated users to fill out your embedded form.

You may also want to set "Submission Privacy" to "Public". When this is set to "Private", the user can save the form, but they will not be able to see when the PDF has been processed. They will also not be able to download the generated PDF.

When "Submission Privacy" is set to "Public", the user can wait until the PDF has been processed, and you can show them a link to download the PDF.

Privacy

Query Params

You can set some query params in the URL to provide default data, set submission metadata, or hide some fields on the form.

  • Set Default Data

?data[<field>]=<value>

Set default values for the name and email fields:

https://app.formapi.io/templates/tpl_123/form?data[name]=John%20Smith&data[email][email protected]
  • Set Submission Metadata

Submission metadata is included in API responses and webhook notifications, but is not included in the generated PDF.

?metadata[<key>]=<value>

Set an internal userId value in the submission metadata:

https://app.formapi.io/templates/tpl_123/form?metadata[userId]=123
  • Hidden Fields

You can also hide some fields on the form by passing hidden_fields as a list of comma-separated field names.

?hidden_fields=<field_1>,<field_2>,...

For example, here is how you can set a value for the name field, and then hide that field on the form:

https://app.formapi.io/templates/tpl_123/form?data[name]=John%20Smith&hidden_fields=name

NOTE: If you hide a required field without passing a default value, you will get a validation error and you will not be able to generate a PDF.

Redirect to a URL

After the user submits the form, you can redirect them to a different URL. The redirect URL can be configured in the template settings.

The submission ID, template ID, and template name will be appended to this URL as query params:
https://example.com/?submission_id=sub_123&template_id=tpl_123&template_name=My%20Template

When "Submission Privacy" is set to "Private", the user will be redirected as soon as the form has been saved. When "Submission Privacy" is set to "Public", the user will be redirected after the PDF has finished processing.

results matching ""

    No results matching ""