docspring 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +15 -0
- data/.travis.yml +1 -1
- data/AGENTS.md +3 -2
- data/CHANGELOG.md +40 -0
- data/Gemfile.lock +9 -9
- data/README.md +5 -1
- data/docs/Client.md +176 -10
- data/docs/CombinedPdf.md +1 -1
- data/docs/CreateCombinedPdfRequest.md +1 -1
- data/docs/CreateSubmissionRequest.md +2 -2
- data/docs/CreateTemplatePreviewRequest.md +18 -0
- data/docs/CreateTemplateRequest.md +3 -1
- data/docs/ErrorDetail.md +1 -1
- data/docs/ErrorInfo.md +4 -4
- data/docs/Submission.md +15 -15
- data/docs/SubmissionInput.md +2 -2
- data/docs/SubmissionList.md +1 -1
- data/docs/SubmissionSummary.md +54 -0
- data/docs/Template.md +12 -10
- data/docs/TemplateActor.md +1 -1
- data/docs/TemplateDocument.md +5 -5
- data/docs/TemplateDocumentSummary.md +24 -0
- data/docs/TemplatePreview.md +32 -0
- data/docs/TemplatePreviewState.md +15 -0
- data/docs/TemplateSummary.md +2 -48
- data/docs/UpdateTemplateRequest.md +4 -2
- data/docs/ValidateSubmissionRequest.md +2 -2
- data/lib/docspring/api/client.rb +178 -8
- data/lib/docspring/api_client.rb +4 -2
- data/lib/docspring/date_time_values.rb +33 -0
- data/lib/docspring/models/combined_pdf.rb +1 -1
- data/lib/docspring/models/create_combined_pdf_request.rb +1 -1
- data/lib/docspring/models/create_submission_request.rb +2 -2
- data/lib/docspring/models/create_template_preview_request.rb +187 -0
- data/lib/docspring/models/create_template_request.rb +12 -2
- data/lib/docspring/models/error_code.rb +3 -1
- data/lib/docspring/models/error_detail.rb +1 -1
- data/lib/docspring/models/error_info.rb +4 -4
- data/lib/docspring/models/submission.rb +140 -140
- data/lib/docspring/models/submission_input.rb +2 -2
- data/lib/docspring/models/submission_list.rb +1 -1
- data/lib/docspring/models/submission_summary.rb +601 -0
- data/lib/docspring/models/template.rb +96 -83
- data/lib/docspring/models/template_actor.rb +1 -1
- data/lib/docspring/models/template_document.rb +42 -42
- data/lib/docspring/models/template_document_summary.rb +260 -0
- data/lib/docspring/models/template_preview.rb +356 -0
- data/lib/docspring/models/template_preview_state.rb +42 -0
- data/lib/docspring/models/template_summary.rb +5 -572
- data/lib/docspring/models/update_template_request.rb +16 -6
- data/lib/docspring/models/validate_submission_request.rb +2 -2
- data/lib/docspring/request_schemas.json +105 -8
- data/lib/docspring/version.rb +1 -1
- data/lib/docspring/webhook_signature.rb +45 -0
- data/lib/docspring.rb +6 -0
- data/spec/api/client_spec.rb +39 -4
- data/spec/models/create_template_preview_request_spec.rb +36 -0
- data/spec/models/create_template_request_spec.rb +6 -0
- data/spec/models/submission_spec.rb +12 -12
- data/spec/models/submission_summary_spec.rb +144 -0
- data/spec/models/template_document_spec.rb +5 -5
- data/spec/models/template_document_summary_spec.rb +54 -0
- data/spec/models/template_preview_spec.rb +78 -0
- data/spec/models/template_preview_state_spec.rb +30 -0
- data/spec/models/template_spec.rb +28 -22
- data/spec/models/template_summary_spec.rb +0 -138
- data/spec/models/update_template_request_spec.rb +6 -0
- metadata +23 -1
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
| **test** | **Boolean** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | [optional] |
|
|
8
8
|
| **editable** | **Boolean** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | [optional] |
|
|
9
9
|
| **data** | **Hash<String, Object>** | The values of the template's fields, by field name. Required for a PDF template, unless `signature_requests` collects the values. | [optional] |
|
|
10
|
-
| **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. | [optional] |
|
|
10
|
+
| **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | [optional] |
|
|
11
11
|
| **password** | **String** | A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. | [optional] |
|
|
12
12
|
| **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission. | [optional] |
|
|
13
13
|
| **expires_in** | **Integer** | Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours. | [optional] |
|
|
14
14
|
| **field_overrides** | [**Hash<String, FieldOverride>**](FieldOverride.md) | Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. With `signature_requests`, `editable: true` is a 422, and a `default` for a signature or initials field makes the submission `invalid_data`. | [optional] |
|
|
15
15
|
| **html** | **String** | For an HTML template, HTML to use instead of the template's. | [optional] |
|
|
16
|
-
| **css** | **String** | For an HTML template, CSS
|
|
16
|
+
| **css** | **String** | For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity. | [optional] |
|
|
17
17
|
| **signature_requests** | [**Array<SignatureRequestInput>**](SignatureRequestInput.md) | The people who sign the PDF, and fill in their fields first. The PDF is generated once every signature request is completed. PDF templates only. Without `role`s, the first signature request is `Signer 1`, the second `Signer 2`, and so on. To leave a signer out, give every signature request its `role` and leave that one's out. Only the signers sign: a value for a signature or initials field in `data` makes the submission `invalid_data`. | [optional] |
|
|
18
18
|
|
|
19
19
|
## Example
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# DocSpring::CreateTemplatePreviewRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | **Hash<String, Object>** | The values of the template's fields, by field name, as you'd send them to create a submission. They're rendered as they are: they aren't checked against the template's fields. A value that a field can't print, such as an image URL that doesn't download, makes the preview's `state` `error`, with an `error_message`. | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'docspring'
|
|
13
|
+
|
|
14
|
+
instance = DocSpring::CreateTemplatePreviewRequest.new(
|
|
15
|
+
data: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
| **allow_skipping_optional_fields** | **Boolean** | Visual forms and signature request forms show the Continue button as soon as the required fields are filled in, without visiting each optional field. The `allowSkippingOptionalFields` embed option overrides it. | [optional] |
|
|
16
16
|
| **default_form_mode** | [**TemplateFormMode**](TemplateFormMode.md) | The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). HTML templates have no visual form, so `web` is the only value they accept. | [optional] |
|
|
17
17
|
| **editable_submissions** | **Boolean** | Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it. | [optional] |
|
|
18
|
-
| **embed_domains** | **Array<String>** | The sites
|
|
18
|
+
| **embed_domains** | **Array<String>** | The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted. | [optional] |
|
|
19
19
|
| **embed_edit_allow_settings** | **Boolean** | Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on). | [optional] |
|
|
20
20
|
| **embed_edit_allow_versioning** | **Boolean** | Allow the embedded template editor to publish, restore, compare and delete published versions. | [optional] |
|
|
21
21
|
| **embed_edit_allow_document_replacement** | **Boolean** | Allow the embedded template editor to replace the template's PDF. | [optional] |
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
| **header_html** | **String** | The HTML printed at the top of each page of an HTML template. | [optional] |
|
|
40
40
|
| **footer_html** | **String** | The HTML printed at the bottom of each page of an HTML template. | [optional] |
|
|
41
41
|
| **html_engine_options** | [**HtmlEngineOptionsInput**](HtmlEngineOptionsInput.md) | Null resets the options to their defaults. | [optional] |
|
|
42
|
+
| **html_escape_data** | **Boolean** | Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for PDF templates. | [optional] |
|
|
42
43
|
| **cache_id** | **String** | A PDF template's document: the `fields.key` of a file you uploaded with the presigned upload (GET /uploads/presign). A PDF template needs one of `cache_id`, `document_url` and `document_base64`. To upload the PDF with the request, use POST /templates/upload. | [optional] |
|
|
43
44
|
| **document_url** | **String** | An https:// link to the template's PDF (up to 100 MB), instead of `cache_id`. DocSpring downloads it after responding, following redirects to other https:// links: the template's `document.state` is `downloading` until then (sync.api hosts wait for it). If it can't be downloaded, the state is `download_failed` and `document.error_message` says why. | [optional] |
|
|
44
45
|
| **document_base64** | **String** | The template's PDF, encoded as base64 (a `data:` URI works too), instead of `cache_id`. Up to 7 MB before it's encoded: send a larger file with `cache_id` or `document_url`. | [optional] |
|
|
@@ -89,6 +90,7 @@ instance = DocSpring::CreateTemplateRequest.new(
|
|
|
89
90
|
header_html: null,
|
|
90
91
|
footer_html: null,
|
|
91
92
|
html_engine_options: null,
|
|
93
|
+
html_escape_data: null,
|
|
92
94
|
cache_id: null,
|
|
93
95
|
document_url: null,
|
|
94
96
|
document_base64: null,
|
data/docs/ErrorDetail.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
| **code** | **String** | What's wrong: `required`, `unknown_property`, `type`, `enum`, `format`, a JSON Schema keyword such as `minLength`, or a DocSpring code. New codes can be added. | |
|
|
8
8
|
| **message** | **String** | A human-readable explanation of the problem. | |
|
|
9
9
|
| **pointer** | **String** | A JSON pointer to the value in the request body (RFC 6901). An empty string means the whole body. In a submission's `data_errors`, it points into the request that created the submission. | [optional] |
|
|
10
|
-
| **parameter** | **String** | The query parameter the detail is about. | [optional] |
|
|
10
|
+
| **parameter** | **String** | The query parameter or header the detail is about. | [optional] |
|
|
11
11
|
| **submission_id** | **String** | For a batch item that failed validation, the ID of the submission recorded for it. | [optional] |
|
|
12
12
|
|
|
13
13
|
## Example
|
data/docs/ErrorInfo.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **code** | [**ErrorCode**](ErrorCode.md) | A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `upgrade_required` (403): your plan doesn't include this, such as more templates or the embedded template editor. `account_suspended` (403): the account is suspended, so it can't create submissions. `polling_timeout`: on a sync.api host, the PDF wasn't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id` or `template_id`. Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created. | |
|
|
7
|
+
| **code** | [**ErrorCode**](ErrorCode.md) | A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `upgrade_required` (403): your plan doesn't include this, such as more templates or the embedded template editor. `account_suspended` (403): the account is suspended, so it can't create submissions. `polling_timeout`: on a sync.api host, the PDF wasn't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id` or `template_id`. Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created. `idempotency_key_in_use` (409): a request with the same Idempotency-Key is still being processed. Send the request again in a few seconds; when the first request has already created its record, its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `idempotency_key_reused` (422): the Idempotency-Key was already used for a different request. | |
|
|
8
8
|
| **message** | **String** | A human-readable explanation, safe to show to developers. | |
|
|
9
9
|
| **details** | [**Array<ErrorDetail>**](ErrorDetail.md) | What was wrong with each part of the request. Empty when the error isn't about one part of it. | |
|
|
10
10
|
| **request_id** | **String** | The ID of the request. Include it when you contact support. | |
|
|
11
|
-
| **submission_id** | **String** | When a submission's data fails validation, the submission is still recorded (state `invalid_data`) so you can see it in the dashboard. This is its ID. With `insufficient_credits`, the submission that waits for credits. With `polling_timeout`, the submission that's still being processed. | [optional] |
|
|
12
|
-
| **submission_batch_id** | **String** | The ID of the recorded batch, when items in a batch fail validation. With `insufficient_credits`, the batch whose submissions wait for credits. With `polling_timeout`, the batch that's still being processed. | [optional] |
|
|
13
|
-
| **combined_pdf_id** | **String** | With `insufficient_credits`, the combined PDF that waits for credits. With `polling_timeout`, the combined PDF that's still being processed. | [optional] |
|
|
11
|
+
| **submission_id** | **String** | When a submission's data fails validation, the submission is still recorded (state `invalid_data`) so you can see it in the dashboard. This is its ID. With `insufficient_credits`, the submission that waits for credits. With `polling_timeout` or `idempotency_key_in_use`, the submission that's still being processed. | [optional] |
|
|
12
|
+
| **submission_batch_id** | **String** | The ID of the recorded batch, when items in a batch fail validation. With `insufficient_credits`, the batch whose submissions wait for credits. With `polling_timeout` or `idempotency_key_in_use`, the batch that's still being processed. | [optional] |
|
|
13
|
+
| **combined_pdf_id** | **String** | With `insufficient_credits`, the combined PDF that waits for credits. With `polling_timeout` or `idempotency_key_in_use`, the combined PDF that's still being processed. | [optional] |
|
|
14
14
|
| **template_id** | **String** | With `polling_timeout`, the template whose PDF is still being processed. | [optional] |
|
|
15
15
|
|
|
16
16
|
## Example
|
data/docs/Submission.md
CHANGED
|
@@ -13,22 +13,22 @@
|
|
|
13
13
|
| **state** | [**SubmissionState**](SubmissionState.md) | `pending` until the PDF has been generated, then `processed`. `waiting_for_signature_requests` until every signature request is completed. `insufficient_credits`: waiting for credits; `error_message` says whether the PDF is generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. Waiting ends in `error` if it's discarded or takes over 30 days. Every other state is final, with no PDF: `invalid_data` (the data doesn't match the template's fields: see `data_errors`), `declined` (a signature request was declined), and the states where generating the PDF failed, which have an `error_message`: `syntax_error` (a mistake in an HTML template's Liquid or SCSS), `image_download_failed` or `image_processing_failed` (an image in the data or the template couldn't be downloaded or read) and `error` (anything else). Older submissions can also be `license_revoked` or `accidental`. | |
|
|
14
14
|
| **test** | **Boolean** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | |
|
|
15
15
|
| **editable** | **Boolean** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | |
|
|
16
|
-
| **data** | **Hash<String, Object>** | The submission's data, with the values entered in completed signature requests.
|
|
16
|
+
| **data** | **Hash<String, Object>** | The submission's data, with the values entered in completed signature requests. Empty once the submission has expired. Null in a batch's submissions unless you pass `include_data=true`, and in the events of a webhook that leaves out submission data. | |
|
|
17
17
|
| **data_errors** | [**Array<ErrorDetail>**](ErrorDetail.md) | Why the data doesn't match the template's fields, when `state` is `invalid_data`: the same details as the 422 response that recorded it, with pointers into the request that created the submission (`/data/name`). Cleared once the submission has expired. | |
|
|
18
18
|
| **error_message** | **String** | Why the PDF couldn't be generated, when `state` is `error`. | |
|
|
19
|
-
| **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. | |
|
|
20
|
-
| **has_password** | **Boolean** | Whether the PDF needs a password to open (`password`). | |
|
|
21
|
-
| **signature_requests** | [**Array<SignatureRequest>**](SignatureRequest.md) | The people asked to sign the submission (and fill in their fields), in order. | |
|
|
22
|
-
| **actions** | [**Array<SubmissionAction>**](SubmissionAction.md) | The uploads of the submission's PDF to your storage (account integrations). | |
|
|
23
|
-
| **truncated_text** | **Hash<String, Array<String>>** | The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired. | |
|
|
24
|
-
| **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission. | |
|
|
19
|
+
| **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | |
|
|
25
20
|
| **files** | [**SubmissionFiles**](SubmissionFiles.md) | The generated files: `pdf` once the submission has been processed, `png` (the images of the PDF's pages, when `output_formats` has it: `files.png.pages[0]` is page 1), `audit_trail` once its signature requests are completed, and `preview` once a preview PDF has been generated. Empty once the submission has expired. | |
|
|
26
|
-
| **preview_generated_at** | **Time** | When the preview PDF was generated. Null if there is no preview. | |
|
|
27
21
|
| **expired** | **Boolean** | An expired submission's data, metadata, password and PDF have been deleted. | |
|
|
28
22
|
| **expires_at** | **Time** | When the submission expires. Null if it's kept until you delete it. | |
|
|
29
23
|
| **processed_at** | **Time** | When the PDF was generated. Null until then. | |
|
|
30
24
|
| **created_at** | **Time** | When the submission was created. | |
|
|
31
25
|
| **updated_at** | **Time** | When the submission was last updated. | |
|
|
26
|
+
| **has_password** | **Boolean** | Whether the PDF needs a password to open (`password`). | |
|
|
27
|
+
| **signature_requests** | [**Array<SignatureRequest>**](SignatureRequest.md) | The people asked to sign the submission (and fill in their fields), in order. | |
|
|
28
|
+
| **actions** | [**Array<SubmissionAction>**](SubmissionAction.md) | The uploads of the submission's PDF to your storage (account integrations). | |
|
|
29
|
+
| **truncated_text** | **Hash<String, Array<String>>** | The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired. | |
|
|
30
|
+
| **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission. | |
|
|
31
|
+
| **preview_generated_at** | **Time** | When the preview PDF was generated. Null if there is no preview. | |
|
|
32
32
|
|
|
33
33
|
## Example
|
|
34
34
|
|
|
@@ -49,18 +49,18 @@ instance = DocSpring::Submission.new(
|
|
|
49
49
|
data_errors: null,
|
|
50
50
|
error_message: null,
|
|
51
51
|
metadata: null,
|
|
52
|
-
has_password: null,
|
|
53
|
-
signature_requests: null,
|
|
54
|
-
actions: null,
|
|
55
|
-
truncated_text: null,
|
|
56
|
-
output_formats: null,
|
|
57
52
|
files: null,
|
|
58
|
-
preview_generated_at: null,
|
|
59
53
|
expired: null,
|
|
60
54
|
expires_at: null,
|
|
61
55
|
processed_at: null,
|
|
62
56
|
created_at: null,
|
|
63
|
-
updated_at: null
|
|
57
|
+
updated_at: null,
|
|
58
|
+
has_password: null,
|
|
59
|
+
signature_requests: null,
|
|
60
|
+
actions: null,
|
|
61
|
+
truncated_text: null,
|
|
62
|
+
output_formats: null,
|
|
63
|
+
preview_generated_at: null
|
|
64
64
|
)
|
|
65
65
|
```
|
|
66
66
|
|
data/docs/SubmissionInput.md
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
| **test** | **Boolean** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | [optional] |
|
|
8
8
|
| **editable** | **Boolean** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | [optional] |
|
|
9
9
|
| **data** | **Hash<String, Object>** | The values of the template's fields, by field name. Required for a PDF template. | [optional] |
|
|
10
|
-
| **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. | [optional] |
|
|
10
|
+
| **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | [optional] |
|
|
11
11
|
| **password** | **String** | A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. | [optional] |
|
|
12
12
|
| **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission. | [optional] |
|
|
13
13
|
| **expires_in** | **Integer** | Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours. | [optional] |
|
|
14
14
|
| **field_overrides** | [**Hash<String, FieldOverride>**](FieldOverride.md) | Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. With `signature_requests`, `editable: true` is a 422, and a `default` for a signature or initials field makes the submission `invalid_data`. | [optional] |
|
|
15
15
|
| **html** | **String** | For an HTML template, HTML to use instead of the template's. | [optional] |
|
|
16
|
-
| **css** | **String** | For an HTML template, CSS
|
|
16
|
+
| **css** | **String** | For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity. | [optional] |
|
|
17
17
|
| **template_id** | **String** | The submission's template. Default the batch's `template_id`. | [optional] |
|
|
18
18
|
| **template_version** | **String** | The version of the submission's template. Default the batch's `template_version`. | [optional] |
|
|
19
19
|
|
data/docs/SubmissionList.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **data** | [**Array<
|
|
7
|
+
| **data** | [**Array<SubmissionSummary>**](SubmissionSummary.md) | The items on this page. | |
|
|
8
8
|
| **next_cursor** | **String** | Pass it as `cursor` to get the next page. Null on the last page. | |
|
|
9
9
|
|
|
10
10
|
## Example
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# DocSpring::SubmissionSummary
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | The submission's ID. | |
|
|
8
|
+
| **template_id** | **String** | Null once the template has been permanently deleted. | |
|
|
9
|
+
| **template_type** | [**TemplateType**](TemplateType.md) | The template's type: `pdf` or `html`. | |
|
|
10
|
+
| **template_version** | **String** | The published version of the template the submission used. Null for the draft. | |
|
|
11
|
+
| **batch_id** | **String** | The ID of the batch the submission was created in. | |
|
|
12
|
+
| **source** | [**SubmissionSource**](SubmissionSource.md) | `api`: created with the API. `web`: a web form. `reprocess`: a copy of another submission, made to generate its PDF again. | |
|
|
13
|
+
| **state** | [**SubmissionState**](SubmissionState.md) | `pending` until the PDF has been generated, then `processed`. `waiting_for_signature_requests` until every signature request is completed. `insufficient_credits`: waiting for credits; `error_message` says whether the PDF is generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. Waiting ends in `error` if it's discarded or takes over 30 days. Every other state is final, with no PDF: `invalid_data` (the data doesn't match the template's fields: see `data_errors`), `declined` (a signature request was declined), and the states where generating the PDF failed, which have an `error_message`: `syntax_error` (a mistake in an HTML template's Liquid or SCSS), `image_download_failed` or `image_processing_failed` (an image in the data or the template couldn't be downloaded or read) and `error` (anything else). Older submissions can also be `license_revoked` or `accidental`. | |
|
|
14
|
+
| **test** | **Boolean** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | |
|
|
15
|
+
| **editable** | **Boolean** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | |
|
|
16
|
+
| **data** | **Hash<String, Object>** | The submission's data, with the values entered in completed signature requests. Null unless you pass `include_data=true`. Empty once the submission has expired. | |
|
|
17
|
+
| **data_errors** | [**Array<ErrorDetail>**](ErrorDetail.md) | Why the data doesn't match the template's fields, when `state` is `invalid_data`: the same details as the 422 response that recorded it, with pointers into the request that created the submission (`/data/name`). Cleared once the submission has expired. | |
|
|
18
|
+
| **error_message** | **String** | Why the PDF couldn't be generated, when `state` is `error`. | |
|
|
19
|
+
| **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | |
|
|
20
|
+
| **files** | [**SubmissionFiles**](SubmissionFiles.md) | Empty unless you pass `include_files=true`: then the generated files, as when you get the submission, without the `png` pages' links (`files.png.pages` is null). Get the submission for its page images. | |
|
|
21
|
+
| **expired** | **Boolean** | An expired submission's data, metadata, password and PDF have been deleted. | |
|
|
22
|
+
| **expires_at** | **Time** | When the submission expires. Null if it's kept until you delete it. | |
|
|
23
|
+
| **processed_at** | **Time** | When the PDF was generated. Null until then. | |
|
|
24
|
+
| **created_at** | **Time** | When the submission was created. | |
|
|
25
|
+
| **updated_at** | **Time** | When the submission was last updated. | |
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
require 'docspring'
|
|
31
|
+
|
|
32
|
+
instance = DocSpring::SubmissionSummary.new(
|
|
33
|
+
id: null,
|
|
34
|
+
template_id: null,
|
|
35
|
+
template_type: null,
|
|
36
|
+
template_version: null,
|
|
37
|
+
batch_id: null,
|
|
38
|
+
source: null,
|
|
39
|
+
state: null,
|
|
40
|
+
test: null,
|
|
41
|
+
editable: null,
|
|
42
|
+
data: null,
|
|
43
|
+
data_errors: null,
|
|
44
|
+
error_message: null,
|
|
45
|
+
metadata: null,
|
|
46
|
+
files: null,
|
|
47
|
+
expired: null,
|
|
48
|
+
expires_at: null,
|
|
49
|
+
processed_at: null,
|
|
50
|
+
created_at: null,
|
|
51
|
+
updated_at: null
|
|
52
|
+
)
|
|
53
|
+
```
|
|
54
|
+
|
data/docs/Template.md
CHANGED
|
@@ -8,21 +8,24 @@
|
|
|
8
8
|
| **name** | **String** | The template's name. | |
|
|
9
9
|
| **description** | **String** | Shown under the template's name at the top of its hosted forms, and used as their meta description. Not shown on embedded forms or signature requests. | |
|
|
10
10
|
| **template_type** | [**TemplateType**](TemplateType.md) | `pdf`: fields placed on an uploaded PDF. `html`: a PDF rendered from HTML and SCSS. It can't be changed after the template is created. | |
|
|
11
|
-
| **ready** | **Boolean** | Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once its
|
|
11
|
+
| **ready** | **Boolean** | Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once DocSpring has stored its PDF, made an image of each page and finished looking for fields on each page, which can be after `document.state` becomes `processed`. A PDF template with no PDF (`document` is null) isn't ready. | |
|
|
12
12
|
| **document** | [**TemplateDocument**](TemplateDocument.md) | The PDF of a PDF template. Null for HTML templates, and for a PDF template that has no PDF yet. | |
|
|
13
13
|
| **parent_folder_id** | **String** | The ID of the folder the template is in. Null for a template at the root. Setting it moves the template and all of its published versions. | |
|
|
14
14
|
| **path** | **String** | The path of the folder the template is in, such as `/Contracts`. `/` for a template at the root. | |
|
|
15
|
-
| **version** | **String** | The published version this is, such as `1.2.0`. Null for the draft. | |
|
|
16
15
|
| **latest_version** | **String** | The template's latest published version. Null if no version has been published. | |
|
|
17
16
|
| **version_published_at** | **Time** | When this version was published. Null for the draft. | |
|
|
18
17
|
| **locked** | **Boolean** | A locked template can't be changed or deleted until it's unlocked (`locked` can always be changed). | |
|
|
18
|
+
| **last_changed_at** | **Time** | When the draft was last changed. | |
|
|
19
|
+
| **created_at** | **Time** | When the template was created. | |
|
|
20
|
+
| **updated_at** | **Time** | When the template was last updated. | |
|
|
21
|
+
| **version** | **String** | The published version this is, such as `1.2.0`. Null for the draft. | |
|
|
19
22
|
| **add_signature_request_submission_id_footers** | **Boolean** | Print the submission ID in the footer of each page of PDFs signed through signature requests. | |
|
|
20
23
|
| **ai_field_naming_language** | [**AiFieldNamingLanguage**](AiFieldNamingLanguage.md) | The language AI field setup names fields in: `auto` uses the form's language when it's written in the Latin alphabet without accents, and English otherwise; `english` always uses English; `form_language` uses the form's language and script. New templates take it from your account's template settings. Null for HTML templates. | |
|
|
21
24
|
| **allow_additional_properties** | **Boolean** | Accept submission data with properties that aren't fields of the template. | |
|
|
22
25
|
| **allow_skipping_optional_fields** | **Boolean** | Visual forms and signature request forms show the Continue button as soon as the required fields are filled in, without visiting each optional field. The `allowSkippingOptionalFields` embed option overrides it. | |
|
|
23
26
|
| **default_form_mode** | [**TemplateFormMode**](TemplateFormMode.md) | The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). HTML templates have no visual form, so `web` is the only value they accept. | |
|
|
24
27
|
| **editable_submissions** | **Boolean** | Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it. | |
|
|
25
|
-
| **embed_domains** | **Array<String>** | The sites
|
|
28
|
+
| **embed_domains** | **Array<String>** | The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted. | |
|
|
26
29
|
| **embed_edit_allow_settings** | **Boolean** | Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on). | |
|
|
27
30
|
| **embed_edit_allow_versioning** | **Boolean** | Allow the embedded template editor to publish, restore, compare and delete published versions. | |
|
|
28
31
|
| **embed_edit_allow_document_replacement** | **Boolean** | Allow the embedded template editor to replace the template's PDF. | |
|
|
@@ -37,10 +40,7 @@
|
|
|
37
40
|
| **public_web_form** | **Boolean** | Allow anyone to fill in the template's web form. | |
|
|
38
41
|
| **redirect_url** | **String** | Where the web form sends people after they submit it. | |
|
|
39
42
|
| **has_slack_webhook_url** | **Boolean** | Whether `slack_webhook_url` is set. | |
|
|
40
|
-
| **last_changed_at** | **Time** | When the draft was last changed. | |
|
|
41
43
|
| **last_changed_by** | [**TemplateActor**](TemplateActor.md) | Who last changed the draft: a user in your account, an API token, or someone using the embedded template editor. Null if no change has been recorded. | |
|
|
42
|
-
| **created_at** | **Time** | When the template was created. | |
|
|
43
|
-
| **updated_at** | **Time** | When the template was last updated. | |
|
|
44
44
|
| **defaults** | [**TemplateDefaults**](TemplateDefaults.md) | | |
|
|
45
45
|
| **field_dependencies** | [**Array<TemplateFieldDependency>**](TemplateFieldDependency.md) | Conditional logic: each rule shows or hides its target fields, or makes them required, depending on the values of other fields. | |
|
|
46
46
|
| **field_groups** | [**Array<FieldGroup>**](FieldGroup.md) | The groups of the template's fields, with their settings. A field's name puts it in groups: `address/city` is in the group `address`, and `items/0/price` is in the list `items` and its items' group `items/~`. | |
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
| **header_html** | **String** | The HTML printed at the top of each page of an HTML template. | |
|
|
52
52
|
| **footer_html** | **String** | The HTML printed at the bottom of each page of an HTML template. | |
|
|
53
53
|
| **html_engine_options** | [**HtmlEngineOptions**](HtmlEngineOptions.md) | How an HTML template's PDFs are printed. Null for PDF templates. Setting it replaces the whole object: options left out use their defaults. | |
|
|
54
|
+
| **html_escape_data** | **Boolean** | Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for PDF templates. | |
|
|
54
55
|
| **embed_edit_token** | **String** | The token that opens the template in the embedded template editor. | |
|
|
55
56
|
| **versions** | [**Array<TemplateVersion>**](TemplateVersion.md) | The template's published versions, newest first (up to 100). | |
|
|
56
57
|
|
|
@@ -68,10 +69,13 @@ instance = DocSpring::Template.new(
|
|
|
68
69
|
document: null,
|
|
69
70
|
parent_folder_id: null,
|
|
70
71
|
path: null,
|
|
71
|
-
version: null,
|
|
72
72
|
latest_version: null,
|
|
73
73
|
version_published_at: null,
|
|
74
74
|
locked: null,
|
|
75
|
+
last_changed_at: null,
|
|
76
|
+
created_at: null,
|
|
77
|
+
updated_at: null,
|
|
78
|
+
version: null,
|
|
75
79
|
add_signature_request_submission_id_footers: null,
|
|
76
80
|
ai_field_naming_language: null,
|
|
77
81
|
allow_additional_properties: null,
|
|
@@ -93,10 +97,7 @@ instance = DocSpring::Template.new(
|
|
|
93
97
|
public_web_form: null,
|
|
94
98
|
redirect_url: null,
|
|
95
99
|
has_slack_webhook_url: null,
|
|
96
|
-
last_changed_at: null,
|
|
97
100
|
last_changed_by: null,
|
|
98
|
-
created_at: null,
|
|
99
|
-
updated_at: null,
|
|
100
101
|
defaults: null,
|
|
101
102
|
field_dependencies: null,
|
|
102
103
|
field_groups: null,
|
|
@@ -107,6 +108,7 @@ instance = DocSpring::Template.new(
|
|
|
107
108
|
header_html: null,
|
|
108
109
|
footer_html: null,
|
|
109
110
|
html_engine_options: null,
|
|
111
|
+
html_escape_data: null,
|
|
110
112
|
embed_edit_token: null,
|
|
111
113
|
versions: null
|
|
112
114
|
)
|
data/docs/TemplateActor.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **type** | [**TemplateActorType**](TemplateActorType.md) | `user`: a user in your account. `api`: an API token. `external_user`: someone using the embedded template editor, as identified by your app. | |
|
|
7
|
+
| **type** | [**TemplateActorType**](TemplateActorType.md) | `user`: a user in your account, also when they make the change with an app they connected (an OAuth access token). `api`: an API token. `external_user`: someone using the embedded template editor, as identified by your app. | |
|
|
8
8
|
| **user_id** | **String** | The user's ID, for `user`. | |
|
|
9
9
|
| **external_id** | **String** | The ID your app gave the embedded editor's user, for `external_user`. | |
|
|
10
10
|
| **name** | **String** | The user's name, or the name your app gave the embedded editor's user. | |
|
data/docs/TemplateDocument.md
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **filename** | **String** | The PDF's file name. Null until a `document_url` has been downloaded. | |
|
|
8
|
-
| **
|
|
9
|
-
| **state** | [**TemplateDocumentState**](TemplateDocumentState.md) | `pending` while DocSpring processes the PDF, then `processed`. `password_required`, `malformed_pdf` and `unknown_error` mean the PDF couldn't be processed, and `error_message` says why: upload it again or upload another one. `downloading` while DocSpring downloads a `document_url`, then as for an upload. `download_failed` means it couldn't be downloaded, and `error_message` says why. A template keeps its PDF while a new one is downloaded, and when it couldn't be. | |
|
|
8
|
+
| **state** | [**TemplateDocumentState**](TemplateDocumentState.md) | `pending` while DocSpring processes the PDF, then `processed` (`ready` says when its pages are done too). `password_required`, `malformed_pdf` and `unknown_error` mean the PDF couldn't be processed, and `error_message` says why: upload it again or upload another one. `downloading` while DocSpring downloads a `document_url`, then as for an upload. `download_failed` means it couldn't be downloaded, and `error_message` says why. A template keeps its PDF while a new one is downloaded, and when it couldn't be. | |
|
|
10
9
|
| **error_message** | **String** | Why the PDF couldn't be processed or downloaded, and how to fix it. Null unless `state` is an error. | |
|
|
11
|
-
| **field_reimport_state** | [**FieldReimportState**](FieldReimportState.md) | Whether the fields are being re-imported from this PDF (`reimport_fields` when the PDF was replaced): `requested` while DocSpring processes the PDF, then `imported`, or `no_fields` when the PDF had no fillable fields and the template kept its fields. `none` when no re-import was asked for, or when it couldn't run (the PDF couldn't be processed, or the template was locked or published while it was). | |
|
|
12
10
|
| **page_count** | **Integer** | 0 until the PDF has been processed. | |
|
|
11
|
+
| **md5** | **String** | The MD5 hash of the PDF. | |
|
|
12
|
+
| **field_reimport_state** | [**FieldReimportState**](FieldReimportState.md) | Whether the fields are being re-imported from this PDF (`reimport_fields` when the PDF was replaced): `requested` while DocSpring processes the PDF, then `imported`, or `no_fields` when the PDF had no fillable fields and the template kept its fields. `none` when no re-import was asked for, or when it couldn't run (the PDF couldn't be processed, or the template was locked or published while it was). | |
|
|
13
13
|
| **page_dimensions** | **Array<Array<Float>>** | Each page's width and height in PDF points. Null until the PDF has been processed. | |
|
|
14
14
|
| **has_fillable_fields** | **Boolean** | Whether the PDF has fillable form fields. Null until DocSpring has read the PDF. | |
|
|
15
15
|
| **page_processing_statuses** | [**Array<TemplatePageProcessingStatus>**](TemplatePageProcessingStatus.md) | How processing is going on each page, in page order: its image, and its fields when DocSpring sets them up (`detect_fields` when the template was created). `state` becomes `processed` once every page is done. Empty until DocSpring has read the PDF, and for PDFs uploaded before DocSpring recorded page statuses. | |
|
|
@@ -24,11 +24,11 @@ require 'docspring'
|
|
|
24
24
|
|
|
25
25
|
instance = DocSpring::TemplateDocument.new(
|
|
26
26
|
filename: null,
|
|
27
|
-
md5: null,
|
|
28
27
|
state: null,
|
|
29
28
|
error_message: null,
|
|
30
|
-
field_reimport_state: null,
|
|
31
29
|
page_count: null,
|
|
30
|
+
md5: null,
|
|
31
|
+
field_reimport_state: null,
|
|
32
32
|
page_dimensions: null,
|
|
33
33
|
has_fillable_fields: null,
|
|
34
34
|
page_processing_statuses: null,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# DocSpring::TemplateDocumentSummary
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **filename** | **String** | The PDF's file name. Null until a `document_url` has been downloaded. | |
|
|
8
|
+
| **state** | [**TemplateDocumentState**](TemplateDocumentState.md) | `pending` while DocSpring processes the PDF, then `processed` (`ready` says when its pages are done too). `password_required`, `malformed_pdf` and `unknown_error` mean the PDF couldn't be processed, and `error_message` says why: upload it again or upload another one. `downloading` while DocSpring downloads a `document_url`, then as for an upload. `download_failed` means it couldn't be downloaded, and `error_message` says why. A template keeps its PDF while a new one is downloaded, and when it couldn't be. | |
|
|
9
|
+
| **error_message** | **String** | Why the PDF couldn't be processed or downloaded, and how to fix it. Null unless `state` is an error. | |
|
|
10
|
+
| **page_count** | **Integer** | 0 until the PDF has been processed. | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'docspring'
|
|
16
|
+
|
|
17
|
+
instance = DocSpring::TemplateDocumentSummary.new(
|
|
18
|
+
filename: null,
|
|
19
|
+
state: null,
|
|
20
|
+
error_message: null,
|
|
21
|
+
page_count: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# DocSpring::TemplatePreview
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | The preview's ID. | |
|
|
8
|
+
| **template_id** | **String** | The template's ID. | |
|
|
9
|
+
| **version** | **String** | The published version that was rendered, such as `1.2.0`. Null for the draft. | |
|
|
10
|
+
| **state** | [**TemplatePreviewState**](TemplatePreviewState.md) | `pending` while it renders (usually a few seconds), then `processed`, or `error` with an `error_message`. | |
|
|
11
|
+
| **error_message** | **String** | Why the preview couldn't be rendered, such as an error in an HTML template's Liquid, or a value in the data that a field can't print. | |
|
|
12
|
+
| **page_count** | **Integer** | How many pages the template printed, once it's processed. | |
|
|
13
|
+
| **pages** | [**Array<PageImage>**](PageImage.md) | A PNG image of each page once it's processed, in order: `pages[0]` is page 1. A preview has no PDF. Their `download_url`s expire, so get the preview again when you need them. | |
|
|
14
|
+
| **expires_at** | **Time** | When the preview and its images are deleted. | |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'docspring'
|
|
20
|
+
|
|
21
|
+
instance = DocSpring::TemplatePreview.new(
|
|
22
|
+
id: null,
|
|
23
|
+
template_id: null,
|
|
24
|
+
version: null,
|
|
25
|
+
state: null,
|
|
26
|
+
error_message: null,
|
|
27
|
+
page_count: null,
|
|
28
|
+
pages: null,
|
|
29
|
+
expires_at: null
|
|
30
|
+
)
|
|
31
|
+
```
|
|
32
|
+
|
data/docs/TemplateSummary.md
CHANGED
|
@@ -8,37 +8,14 @@
|
|
|
8
8
|
| **name** | **String** | The template's name. | |
|
|
9
9
|
| **description** | **String** | Shown under the template's name at the top of its hosted forms, and used as their meta description. Not shown on embedded forms or signature requests. | |
|
|
10
10
|
| **template_type** | [**TemplateType**](TemplateType.md) | `pdf`: fields placed on an uploaded PDF. `html`: a PDF rendered from HTML and SCSS. It can't be changed after the template is created. | |
|
|
11
|
-
| **ready** | **Boolean** | Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once its
|
|
12
|
-
| **document** | [**
|
|
11
|
+
| **ready** | **Boolean** | Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once DocSpring has stored its PDF, made an image of each page and finished looking for fields on each page, which can be after `document.state` becomes `processed`. A PDF template with no PDF (`document` is null) isn't ready. | |
|
|
12
|
+
| **document** | [**TemplateDocumentSummary**](TemplateDocumentSummary.md) | The PDF of a PDF template: its file name, page count and processing state. Null for HTML templates, and for a PDF template that has no PDF yet. | |
|
|
13
13
|
| **parent_folder_id** | **String** | The ID of the folder the template is in. Null for a template at the root. Setting it moves the template and all of its published versions. | |
|
|
14
14
|
| **path** | **String** | The path of the folder the template is in, such as `/Contracts`. `/` for a template at the root. | |
|
|
15
|
-
| **version** | **String** | The published version this is, such as `1.2.0`. Null for the draft. | |
|
|
16
15
|
| **latest_version** | **String** | The template's latest published version. Null if no version has been published. | |
|
|
17
16
|
| **version_published_at** | **Time** | When this version was published. Null for the draft. | |
|
|
18
17
|
| **locked** | **Boolean** | A locked template can't be changed or deleted until it's unlocked (`locked` can always be changed). | |
|
|
19
|
-
| **add_signature_request_submission_id_footers** | **Boolean** | Print the submission ID in the footer of each page of PDFs signed through signature requests. | |
|
|
20
|
-
| **ai_field_naming_language** | [**AiFieldNamingLanguage**](AiFieldNamingLanguage.md) | The language AI field setup names fields in: `auto` uses the form's language when it's written in the Latin alphabet without accents, and English otherwise; `english` always uses English; `form_language` uses the form's language and script. New templates take it from your account's template settings. Null for HTML templates. | |
|
|
21
|
-
| **allow_additional_properties** | **Boolean** | Accept submission data with properties that aren't fields of the template. | |
|
|
22
|
-
| **allow_skipping_optional_fields** | **Boolean** | Visual forms and signature request forms show the Continue button as soon as the required fields are filled in, without visiting each optional field. The `allowSkippingOptionalFields` embed option overrides it. | |
|
|
23
|
-
| **default_form_mode** | [**TemplateFormMode**](TemplateFormMode.md) | The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). HTML templates have no visual form, so `web` is the only value they accept. | |
|
|
24
|
-
| **editable_submissions** | **Boolean** | Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it. | |
|
|
25
|
-
| **embed_domains** | **Array<String>** | The sites where the template's signature requests, forms and embedded template editor can be loaded: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). When it's empty, live signature requests don't load on any site, and the embedded template editor loads on every site. | |
|
|
26
|
-
| **embed_edit_allow_settings** | **Boolean** | Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on). | |
|
|
27
|
-
| **embed_edit_allow_versioning** | **Boolean** | Allow the embedded template editor to publish, restore, compare and delete published versions. | |
|
|
28
|
-
| **embed_edit_allow_document_replacement** | **Boolean** | Allow the embedded template editor to replace the template's PDF. | |
|
|
29
|
-
| **encrypt_pdfs** | **Boolean** | Encrypt generated PDFs with `encrypt_pdfs_password`. | |
|
|
30
|
-
| **has_encrypt_pdfs_password** | **Boolean** | Whether `encrypt_pdfs_password` is set. | |
|
|
31
|
-
| **expire_submissions** | **Boolean** | Delete each submission's data and PDF after `expire_after` `expiration_interval`. | |
|
|
32
|
-
| **expire_after** | **Integer** | How many `expiration_interval`s a submission's data and PDF are kept for, when `expire_submissions` is on. At most 5256000 (10 years in minutes). | |
|
|
33
|
-
| **expiration_interval** | [**ExpirationInterval**](ExpirationInterval.md) | The unit of `expire_after`. | |
|
|
34
|
-
| **merge_audit_trail_pdf** | **Boolean** | Add the audit trail to the end of PDFs signed through signature requests. | |
|
|
35
|
-
| **parse_dates_using_template_date_format** | **Boolean** | Date fields also accept NN/NN/YYYY dates (with slashes, dashes or dots), read in the order of the template's default date format: month first for %m/%d/%Y, day first for %d/%m/%Y. When false, date fields only accept YYYY-MM-DD. Applies to PDF templates: an HTML template's date fields only accept YYYY-MM-DD. Date fields that include a time take RFC 3339 date-times either way. | |
|
|
36
|
-
| **public_submissions** | **Boolean** | Allow anyone with a submission's ID to download its PDF. | |
|
|
37
|
-
| **public_web_form** | **Boolean** | Allow anyone to fill in the template's web form. | |
|
|
38
|
-
| **redirect_url** | **String** | Where the web form sends people after they submit it. | |
|
|
39
|
-
| **has_slack_webhook_url** | **Boolean** | Whether `slack_webhook_url` is set. | |
|
|
40
18
|
| **last_changed_at** | **Time** | When the draft was last changed. | |
|
|
41
|
-
| **last_changed_by** | [**TemplateActor**](TemplateActor.md) | Who last changed the draft: a user in your account, an API token, or someone using the embedded template editor. Null if no change has been recorded. | |
|
|
42
19
|
| **created_at** | **Time** | When the template was created. | |
|
|
43
20
|
| **updated_at** | **Time** | When the template was last updated. | |
|
|
44
21
|
|
|
@@ -56,33 +33,10 @@ instance = DocSpring::TemplateSummary.new(
|
|
|
56
33
|
document: null,
|
|
57
34
|
parent_folder_id: null,
|
|
58
35
|
path: null,
|
|
59
|
-
version: null,
|
|
60
36
|
latest_version: null,
|
|
61
37
|
version_published_at: null,
|
|
62
38
|
locked: null,
|
|
63
|
-
add_signature_request_submission_id_footers: null,
|
|
64
|
-
ai_field_naming_language: null,
|
|
65
|
-
allow_additional_properties: null,
|
|
66
|
-
allow_skipping_optional_fields: null,
|
|
67
|
-
default_form_mode: null,
|
|
68
|
-
editable_submissions: null,
|
|
69
|
-
embed_domains: null,
|
|
70
|
-
embed_edit_allow_settings: null,
|
|
71
|
-
embed_edit_allow_versioning: null,
|
|
72
|
-
embed_edit_allow_document_replacement: null,
|
|
73
|
-
encrypt_pdfs: null,
|
|
74
|
-
has_encrypt_pdfs_password: null,
|
|
75
|
-
expire_submissions: null,
|
|
76
|
-
expire_after: null,
|
|
77
|
-
expiration_interval: null,
|
|
78
|
-
merge_audit_trail_pdf: null,
|
|
79
|
-
parse_dates_using_template_date_format: null,
|
|
80
|
-
public_submissions: null,
|
|
81
|
-
public_web_form: null,
|
|
82
|
-
redirect_url: null,
|
|
83
|
-
has_slack_webhook_url: null,
|
|
84
39
|
last_changed_at: null,
|
|
85
|
-
last_changed_by: null,
|
|
86
40
|
created_at: null,
|
|
87
41
|
updated_at: null
|
|
88
42
|
)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
| **allow_skipping_optional_fields** | **Boolean** | Visual forms and signature request forms show the Continue button as soon as the required fields are filled in, without visiting each optional field. The `allowSkippingOptionalFields` embed option overrides it. | [optional] |
|
|
15
15
|
| **default_form_mode** | [**TemplateFormMode**](TemplateFormMode.md) | The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). HTML templates have no visual form, so `web` is the only value they accept. | [optional] |
|
|
16
16
|
| **editable_submissions** | **Boolean** | Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it. | [optional] |
|
|
17
|
-
| **embed_domains** | **Array<String>** | The sites
|
|
17
|
+
| **embed_domains** | **Array<String>** | The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted. | [optional] |
|
|
18
18
|
| **embed_edit_allow_settings** | **Boolean** | Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on). | [optional] |
|
|
19
19
|
| **embed_edit_allow_versioning** | **Boolean** | Allow the embedded template editor to publish, restore, compare and delete published versions. | [optional] |
|
|
20
20
|
| **embed_edit_allow_document_replacement** | **Boolean** | Allow the embedded template editor to replace the template's PDF. | [optional] |
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
| **header_html** | **String** | The HTML printed at the top of each page of an HTML template. | [optional] |
|
|
40
40
|
| **footer_html** | **String** | The HTML printed at the bottom of each page of an HTML template. | [optional] |
|
|
41
41
|
| **html_engine_options** | [**HtmlEngineOptionsInput**](HtmlEngineOptionsInput.md) | Null resets the options to their defaults. | [optional] |
|
|
42
|
+
| **html_escape_data** | **Boolean** | Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for PDF templates. | [optional] |
|
|
42
43
|
|
|
43
44
|
## Example
|
|
44
45
|
|
|
@@ -80,7 +81,8 @@ instance = DocSpring::UpdateTemplateRequest.new(
|
|
|
80
81
|
scss: null,
|
|
81
82
|
header_html: null,
|
|
82
83
|
footer_html: null,
|
|
83
|
-
html_engine_options: null
|
|
84
|
+
html_engine_options: null,
|
|
85
|
+
html_escape_data: null
|
|
84
86
|
)
|
|
85
87
|
```
|
|
86
88
|
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
| **test** | **Boolean** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | [optional] |
|
|
8
8
|
| **editable** | **Boolean** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | [optional] |
|
|
9
9
|
| **data** | **Hash<String, Object>** | The values of the template's fields, by field name. Required for a PDF template, unless `signature_requests` collects the values. | [optional] |
|
|
10
|
-
| **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. | [optional] |
|
|
10
|
+
| **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | [optional] |
|
|
11
11
|
| **password** | **String** | A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. | [optional] |
|
|
12
12
|
| **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission. | [optional] |
|
|
13
13
|
| **expires_in** | **Integer** | Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours. | [optional] |
|
|
14
14
|
| **field_overrides** | [**Hash<String, FieldOverride>**](FieldOverride.md) | Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. With `signature_requests`, `editable: true` is a 422, and a `default` for a signature or initials field makes the submission `invalid_data`. | [optional] |
|
|
15
15
|
| **html** | **String** | For an HTML template, HTML to use instead of the template's. | [optional] |
|
|
16
|
-
| **css** | **String** | For an HTML template, CSS
|
|
16
|
+
| **css** | **String** | For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity. | [optional] |
|
|
17
17
|
| **signature_requests** | [**Array<SignatureRequestInput>**](SignatureRequestInput.md) | The people who sign the PDF, and fill in their fields first. The PDF is generated once every signature request is completed. PDF templates only. Without `role`s, the first signature request is `Signer 1`, the second `Signer 2`, and so on. To leave a signer out, give every signature request its `role` and leave that one's out. Only the signers sign: a value for a signature or initials field in `data` makes the submission `invalid_data`. | [optional] |
|
|
18
18
|
|
|
19
19
|
## Example
|