docspring 4.0.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 +99 -0
- data/.travis.yml +1 -1
- data/AGENTS.md +3 -2
- data/CHANGELOG.md +64 -0
- data/Gemfile.lock +9 -9
- data/README.md +14 -1
- data/docs/AddTemplateFieldsRequest.md +18 -0
- data/docs/Client.md +917 -80
- data/docs/CombinedPdf.md +1 -1
- data/docs/CreateCombinedPdfRequest.md +1 -1
- data/docs/CreateSubmissionBatchRequest.md +2 -0
- data/docs/CreateSubmissionRequest.md +4 -2
- data/docs/CreateTemplatePreviewRequest.md +18 -0
- data/docs/CreateTemplateRequest.md +13 -3
- data/docs/ErrorDetail.md +1 -1
- data/docs/ErrorInfo.md +4 -4
- data/docs/Field.md +198 -0
- data/docs/FieldDependency.md +22 -0
- data/docs/FieldDependencyInput.md +22 -0
- data/docs/FieldGroup.md +32 -0
- data/docs/FieldGroupInput.md +30 -0
- data/docs/FieldGroupType.md +15 -0
- data/docs/FieldInput.md +196 -0
- data/docs/FieldType.md +15 -0
- data/docs/GenerateFilesFormat.md +15 -0
- data/docs/GenerateSubmissionFilesRequest.md +18 -0
- data/docs/OutputFormat.md +15 -0
- data/docs/PageImage.md +34 -0
- data/docs/PageImages.md +24 -0
- data/docs/PredefinedField.md +30 -0
- data/docs/PredefinedFieldInput.md +30 -0
- data/docs/RemoveTemplateFieldsRequest.md +18 -0
- data/docs/ReorderTemplateFieldsRequest.md +18 -0
- data/docs/Submission.md +16 -14
- data/docs/SubmissionFiles.md +3 -1
- data/docs/SubmissionInput.md +4 -2
- data/docs/SubmissionList.md +1 -1
- data/docs/SubmissionSummary.md +54 -0
- data/docs/SubmissionValidation.md +24 -0
- data/docs/Template.md +18 -10
- data/docs/TemplateActor.md +1 -1
- data/docs/TemplateDiff.md +30 -0
- data/docs/TemplateDiffSummary.md +28 -0
- data/docs/TemplateDocument.md +6 -6
- data/docs/TemplateDocumentSummary.md +24 -0
- data/docs/TemplateFieldChange.md +24 -0
- data/docs/TemplateFieldChanges.md +24 -0
- data/docs/TemplateFieldDependency.md +1 -1
- data/docs/TemplateFieldDependencyInput.md +1 -1
- data/docs/TemplateFieldMove.md +22 -0
- data/docs/TemplateFields.md +22 -0
- data/docs/TemplatePageImages.md +24 -0
- data/docs/TemplatePreview.md +32 -0
- data/docs/TemplatePreviewState.md +15 -0
- data/docs/TemplateSummary.md +2 -48
- data/docs/UpdateTemplateDocumentRequest.md +6 -2
- data/docs/UpdateTemplateFieldsRequest.md +18 -0
- data/docs/UpdateTemplateRequest.md +10 -2
- data/docs/ValidateSubmissionRequest.md +38 -0
- data/lib/docspring/api/client.rb +869 -51
- data/lib/docspring/api_client.rb +4 -2
- data/lib/docspring/date_time_values.rb +33 -0
- data/lib/docspring/models/add_template_fields_request.rb +187 -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_batch_request.rb +23 -1
- data/lib/docspring/models/create_submission_request.rb +25 -3
- data/lib/docspring/models/create_template_preview_request.rb +187 -0
- data/lib/docspring/models/create_template_request.rb +59 -4
- 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/field.rb +2217 -0
- data/lib/docspring/models/field_dependency.rb +246 -0
- data/lib/docspring/models/field_dependency_input.rb +246 -0
- data/lib/docspring/models/field_group.rb +368 -0
- data/lib/docspring/models/field_group_input.rb +247 -0
- data/lib/docspring/models/field_group_type.rb +41 -0
- data/lib/docspring/models/field_input.rb +1109 -0
- data/lib/docspring/models/field_type.rb +54 -0
- data/lib/docspring/models/generate_files_format.rb +40 -0
- data/lib/docspring/models/generate_submission_files_request.rb +187 -0
- data/lib/docspring/models/output_format.rb +41 -0
- data/lib/docspring/models/page_image.rb +359 -0
- data/lib/docspring/models/page_images.rb +248 -0
- data/lib/docspring/models/predefined_field.rb +287 -0
- data/lib/docspring/models/predefined_field_input.rb +287 -0
- data/lib/docspring/models/remove_template_fields_request.rb +187 -0
- data/lib/docspring/models/reorder_template_fields_request.rb +187 -0
- data/lib/docspring/models/submission.rb +146 -117
- data/lib/docspring/models/submission_files.rb +13 -4
- data/lib/docspring/models/submission_input.rb +25 -3
- data/lib/docspring/models/submission_list.rb +1 -1
- data/lib/docspring/models/submission_summary.rb +601 -0
- data/lib/docspring/models/submission_validation.rb +234 -0
- data/lib/docspring/models/template.rb +169 -83
- data/lib/docspring/models/template_actor.rb +1 -1
- data/lib/docspring/models/template_diff.rb +321 -0
- data/lib/docspring/models/template_diff_summary.rb +320 -0
- data/lib/docspring/models/template_document.rb +44 -44
- data/lib/docspring/models/template_document_state.rb +3 -1
- data/lib/docspring/models/template_document_summary.rb +260 -0
- data/lib/docspring/models/template_field_change.rb +266 -0
- data/lib/docspring/models/template_field_changes.rb +274 -0
- data/lib/docspring/models/template_field_dependency.rb +1 -1
- data/lib/docspring/models/template_field_dependency_input.rb +1 -1
- data/lib/docspring/models/template_field_move.rb +239 -0
- data/lib/docspring/models/template_fields.rb +227 -0
- data/lib/docspring/models/template_page_images.rb +254 -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_document_request.rb +23 -20
- data/lib/docspring/models/update_template_fields_request.rb +187 -0
- data/lib/docspring/models/update_template_request.rb +53 -6
- data/lib/docspring/models/validate_submission_request.rb +288 -0
- data/lib/docspring/request_schemas.json +3465 -1588
- data/lib/docspring/version.rb +1 -1
- data/lib/docspring/webhook_signature.rb +45 -0
- data/lib/docspring.rb +34 -0
- data/spec/api/client_spec.rb +167 -13
- data/spec/models/add_template_fields_request_spec.rb +36 -0
- data/spec/models/create_submission_batch_request_spec.rb +6 -0
- data/spec/models/create_submission_request_spec.rb +6 -0
- data/spec/models/create_template_preview_request_spec.rb +36 -0
- data/spec/models/create_template_request_spec.rb +30 -0
- data/spec/models/field_dependency_input_spec.rb +48 -0
- data/spec/models/field_dependency_spec.rb +48 -0
- data/spec/models/field_group_input_spec.rb +72 -0
- data/spec/models/field_group_spec.rb +78 -0
- data/spec/models/field_group_type_spec.rb +30 -0
- data/spec/models/field_input_spec.rb +570 -0
- data/spec/models/field_spec.rb +576 -0
- data/spec/models/field_type_spec.rb +30 -0
- data/spec/models/generate_files_format_spec.rb +30 -0
- data/spec/models/generate_submission_files_request_spec.rb +36 -0
- data/spec/models/output_format_spec.rb +30 -0
- data/spec/models/page_image_spec.rb +84 -0
- data/spec/models/page_images_spec.rb +54 -0
- data/spec/models/predefined_field_input_spec.rb +72 -0
- data/spec/models/predefined_field_spec.rb +72 -0
- data/spec/models/remove_template_fields_request_spec.rb +36 -0
- data/spec/models/reorder_template_fields_request_spec.rb +36 -0
- data/spec/models/submission_files_spec.rb +6 -0
- data/spec/models/submission_input_spec.rb +6 -0
- data/spec/models/submission_spec.rb +17 -11
- data/spec/models/submission_summary_spec.rb +144 -0
- data/spec/models/submission_validation_spec.rb +54 -0
- data/spec/models/template_diff_spec.rb +72 -0
- data/spec/models/template_diff_summary_spec.rb +66 -0
- data/spec/models/template_document_spec.rb +5 -5
- data/spec/models/template_document_summary_spec.rb +54 -0
- data/spec/models/template_field_change_spec.rb +54 -0
- data/spec/models/template_field_changes_spec.rb +54 -0
- data/spec/models/template_field_move_spec.rb +48 -0
- data/spec/models/template_fields_spec.rb +48 -0
- data/spec/models/template_page_images_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 +34 -10
- data/spec/models/template_summary_spec.rb +0 -138
- data/spec/models/update_template_document_request_spec.rb +12 -0
- data/spec/models/update_template_fields_request_spec.rb +36 -0
- data/spec/models/update_template_request_spec.rb +24 -0
- data/spec/models/validate_submission_request_spec.rb +96 -0
- metadata +135 -1
data/docs/Client.md
CHANGED
|
@@ -4,6 +4,7 @@ All URIs are relative to *https://sync.api.docspring.com/api/v2*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**add_template_fields**](Client.md#add_template_fields) | **POST** /templates/{template_id}/fields | Add fields to a template |
|
|
7
8
|
| [**copy_template**](Client.md#copy_template) | **POST** /templates/{template_id}/copy | Copy a template |
|
|
8
9
|
| [**create_combined_pdf**](Client.md#create_combined_pdf) | **POST** /combined_pdfs | Combine PDFs |
|
|
9
10
|
| [**create_custom_file_from_upload**](Client.md#create_custom_file_from_upload) | **POST** /custom_files | Create a custom file from an upload |
|
|
@@ -13,6 +14,7 @@ All URIs are relative to *https://sync.api.docspring.com/api/v2*
|
|
|
13
14
|
| [**create_submission**](Client.md#create_submission) | **POST** /templates/{template_id}/submissions | Generate a PDF |
|
|
14
15
|
| [**create_submission_batch**](Client.md#create_submission_batch) | **POST** /submissions/batches | Generate PDFs in a batch |
|
|
15
16
|
| [**create_template**](Client.md#create_template) | **POST** /templates | Create a template |
|
|
17
|
+
| [**create_template_preview**](Client.md#create_template_preview) | **POST** /templates/{template_id}/previews | Preview a template with data |
|
|
16
18
|
| [**create_webhook**](Client.md#create_webhook) | **POST** /webhooks | Create a webhook |
|
|
17
19
|
| [**delete_custom_file**](Client.md#delete_custom_file) | **DELETE** /custom_files/{custom_file_id} | Delete a custom file |
|
|
18
20
|
| [**delete_folder**](Client.md#delete_folder) | **DELETE** /folders/{folder_id} | Delete a folder |
|
|
@@ -20,6 +22,7 @@ All URIs are relative to *https://sync.api.docspring.com/api/v2*
|
|
|
20
22
|
| [**delete_webhook**](Client.md#delete_webhook) | **DELETE** /webhooks/{webhook_id} | Delete a webhook |
|
|
21
23
|
| [**expire_combined_pdf**](Client.md#expire_combined_pdf) | **DELETE** /combined_pdfs/{combined_pdf_id} | Expire a combined PDF |
|
|
22
24
|
| [**expire_submission**](Client.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a submission |
|
|
25
|
+
| [**generate_submission_files**](Client.md#generate_submission_files) | **POST** /submissions/{submission_id}/generate_files | Generate more files |
|
|
23
26
|
| [**generate_submission_preview**](Client.md#generate_submission_preview) | **POST** /submissions/{submission_id}/generate_preview | Generate a preview PDF |
|
|
24
27
|
| [**get_combined_pdf**](Client.md#get_combined_pdf) | **GET** /combined_pdfs/{combined_pdf_id} | Get a combined PDF |
|
|
25
28
|
| [**get_custom_file**](Client.md#get_custom_file) | **GET** /custom_files/{custom_file_id} | Get a custom file |
|
|
@@ -29,28 +32,108 @@ All URIs are relative to *https://sync.api.docspring.com/api/v2*
|
|
|
29
32
|
| [**get_submission**](Client.md#get_submission) | **GET** /submissions/{submission_id} | Get a submission |
|
|
30
33
|
| [**get_submission_batch**](Client.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Get a batch |
|
|
31
34
|
| [**get_template**](Client.md#get_template) | **GET** /templates/{template_id} | Get a template |
|
|
35
|
+
| [**get_template_diff**](Client.md#get_template_diff) | **GET** /templates/{template_id}/diff | Compare a version of a template with the one before it |
|
|
32
36
|
| [**get_template_model_code**](Client.md#get_template_model_code) | **GET** /templates/{template_id}/model_code | Generate typed code for a template's submission data |
|
|
37
|
+
| [**get_template_page_images**](Client.md#get_template_page_images) | **GET** /templates/{template_id}/page_images | Get images of a template's pages |
|
|
38
|
+
| [**get_template_preview**](Client.md#get_template_preview) | **GET** /templates/{template_id}/previews/{preview_id} | Get a template preview |
|
|
33
39
|
| [**get_template_schema**](Client.md#get_template_schema) | **GET** /templates/{template_id}/schema | Get the JSON Schema of a template's submission data |
|
|
34
40
|
| [**get_webhook**](Client.md#get_webhook) | **GET** /webhooks/{webhook_id} | Get a webhook |
|
|
35
41
|
| [**list_combined_pdfs**](Client.md#list_combined_pdfs) | **GET** /combined_pdfs | List combined PDFs |
|
|
36
42
|
| [**list_custom_files**](Client.md#list_custom_files) | **GET** /custom_files | List custom files |
|
|
37
43
|
| [**list_folders**](Client.md#list_folders) | **GET** /folders | List folders |
|
|
38
44
|
| [**list_submissions**](Client.md#list_submissions) | **GET** /submissions | List submissions |
|
|
45
|
+
| [**list_template_fields**](Client.md#list_template_fields) | **GET** /templates/{template_id}/fields | List a template's fields |
|
|
39
46
|
| [**list_template_submissions**](Client.md#list_template_submissions) | **GET** /templates/{template_id}/submissions | List a template's submissions |
|
|
40
47
|
| [**list_templates**](Client.md#list_templates) | **GET** /templates | List templates |
|
|
41
48
|
| [**list_webhooks**](Client.md#list_webhooks) | **GET** /webhooks | List webhooks |
|
|
42
49
|
| [**move_folder**](Client.md#move_folder) | **POST** /folders/{folder_id}/move | Move a folder |
|
|
43
50
|
| [**move_template**](Client.md#move_template) | **POST** /templates/{template_id}/move | Move a template to a folder |
|
|
44
51
|
| [**publish_template_version**](Client.md#publish_template_version) | **POST** /templates/{template_id}/publish_version | Publish a template version |
|
|
52
|
+
| [**remove_template_fields**](Client.md#remove_template_fields) | **POST** /templates/{template_id}/fields/remove | Remove fields from a template |
|
|
45
53
|
| [**rename_folder**](Client.md#rename_folder) | **POST** /folders/{folder_id}/rename | Rename a folder |
|
|
54
|
+
| [**reorder_template_fields**](Client.md#reorder_template_fields) | **POST** /templates/{template_id}/fields/reorder | Reorder a template's fields |
|
|
46
55
|
| [**restore_template_version**](Client.md#restore_template_version) | **POST** /templates/{template_id}/restore_version | Restore a template version |
|
|
47
56
|
| [**test_authentication**](Client.md#test_authentication) | **GET** /authentication | Test authentication |
|
|
48
57
|
| [**update_signature_request**](Client.md#update_signature_request) | **PUT** /signature_requests/{signature_request_id} | Update a signature request |
|
|
49
58
|
| [**update_template**](Client.md#update_template) | **PUT** /templates/{template_id} | Update a template |
|
|
50
59
|
| [**update_template_document**](Client.md#update_template_document) | **PUT** /templates/{template_id}/document | Replace a template's PDF |
|
|
60
|
+
| [**update_template_fields**](Client.md#update_template_fields) | **PUT** /templates/{template_id}/fields | Update a template's fields |
|
|
51
61
|
| [**update_webhook**](Client.md#update_webhook) | **PUT** /webhooks/{webhook_id} | Update a webhook |
|
|
52
62
|
| [**upload_template**](Client.md#upload_template) | **POST** /templates/upload | Create a PDF template from an uploaded PDF |
|
|
53
63
|
| [**upload_template_document**](Client.md#upload_template_document) | **PUT** /templates/{template_id}/document/upload | Replace a template's PDF with an uploaded PDF |
|
|
64
|
+
| [**validate_submission**](Client.md#validate_submission) | **POST** /templates/{template_id}/submissions/validate | Check a submission without creating it |
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## add_template_fields
|
|
68
|
+
|
|
69
|
+
> <TemplateFields> add_template_fields(template_id, body)
|
|
70
|
+
|
|
71
|
+
Add fields to a template
|
|
72
|
+
|
|
73
|
+
Adds fields to a template's draft and returns all of its fields. Publish a version for submissions of published versions to have them.
|
|
74
|
+
|
|
75
|
+
### Examples
|
|
76
|
+
|
|
77
|
+
```ruby
|
|
78
|
+
require 'time'
|
|
79
|
+
require 'docspring'
|
|
80
|
+
# setup authorization
|
|
81
|
+
DocSpring.configure do |config|
|
|
82
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
83
|
+
config.username = 'YOUR USERNAME'
|
|
84
|
+
config.password = 'YOUR PASSWORD'
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
api_instance = DocSpring::Client.new
|
|
88
|
+
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
89
|
+
body = DocSpring::AddTemplateFieldsRequest.new({fields: [DocSpring::FieldInput.new]}) # AddTemplateFieldsRequest | The fields to add to the template's draft.
|
|
90
|
+
|
|
91
|
+
begin
|
|
92
|
+
# Add fields to a template
|
|
93
|
+
result = api_instance.add_template_fields(template_id, body)
|
|
94
|
+
p result
|
|
95
|
+
rescue DocSpring::ApiError => e
|
|
96
|
+
puts "Error when calling Client->add_template_fields: #{e}"
|
|
97
|
+
end
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Using the add_template_fields_with_http_info variant
|
|
101
|
+
|
|
102
|
+
This returns an Array which contains the response data, status code and headers.
|
|
103
|
+
|
|
104
|
+
> <Array(<TemplateFields>, Integer, Hash)> add_template_fields_with_http_info(template_id, body)
|
|
105
|
+
|
|
106
|
+
```ruby
|
|
107
|
+
begin
|
|
108
|
+
# Add fields to a template
|
|
109
|
+
data, status_code, headers = api_instance.add_template_fields_with_http_info(template_id, body)
|
|
110
|
+
p status_code # => 2xx
|
|
111
|
+
p headers # => { ... }
|
|
112
|
+
p data # => <TemplateFields>
|
|
113
|
+
rescue DocSpring::ApiError => e
|
|
114
|
+
puts "Error when calling Client->add_template_fields_with_http_info: #{e}"
|
|
115
|
+
end
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Parameters
|
|
119
|
+
|
|
120
|
+
| Name | Type | Description | Notes |
|
|
121
|
+
| ---- | ---- | ----------- | ----- |
|
|
122
|
+
| **template_id** | **String** | The template's ID. | |
|
|
123
|
+
| **body** | [**AddTemplateFieldsRequest**](AddTemplateFieldsRequest.md) | The fields to add to the template's draft. | |
|
|
124
|
+
|
|
125
|
+
### Return type
|
|
126
|
+
|
|
127
|
+
[**TemplateFields**](TemplateFields.md)
|
|
128
|
+
|
|
129
|
+
### Authorization
|
|
130
|
+
|
|
131
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
132
|
+
|
|
133
|
+
### HTTP request headers
|
|
134
|
+
|
|
135
|
+
- **Content-Type**: application/json
|
|
136
|
+
- **Accept**: application/json
|
|
54
137
|
|
|
55
138
|
|
|
56
139
|
## copy_template
|
|
@@ -150,7 +233,8 @@ end
|
|
|
150
233
|
api_instance = DocSpring::Client.new
|
|
151
234
|
body = DocSpring::CreateCombinedPdfRequest.new({source_pdfs: [DocSpring::CombinedPdfSourcePdf.new({type: 'type_example', id: 'id_example'})]}) # CreateCombinedPdfRequest | The PDFs to merge, and the combined PDF's settings.
|
|
152
235
|
opts = {
|
|
153
|
-
wait: true # Boolean | Wait until the PDF has been generated before responding. Default true on sync.api hosts.
|
|
236
|
+
wait: true, # Boolean | Wait until the PDF has been generated before responding. Default true on sync.api hosts.
|
|
237
|
+
idempotency_key: 'idempotency_key_example' # String | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another combined PDF. Send a new key with each new combined PDF, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
|
|
154
238
|
}
|
|
155
239
|
|
|
156
240
|
begin
|
|
@@ -186,6 +270,7 @@ end
|
|
|
186
270
|
| ---- | ---- | ----------- | ----- |
|
|
187
271
|
| **body** | [**CreateCombinedPdfRequest**](CreateCombinedPdfRequest.md) | The PDFs to merge, and the combined PDF's settings. | |
|
|
188
272
|
| **wait** | **Boolean** | Wait until the PDF has been generated before responding. Default true on sync.api hosts. | [optional] |
|
|
273
|
+
| **idempotency_key** | **String** | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another combined PDF. Send a new key with each new combined PDF, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds. | [optional] |
|
|
189
274
|
|
|
190
275
|
### Return type
|
|
191
276
|
|
|
@@ -347,7 +432,7 @@ end
|
|
|
347
432
|
|
|
348
433
|
Record a signature request event
|
|
349
434
|
|
|
350
|
-
Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account.
|
|
435
|
+
Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account. A finished (completed, declined or expired) signature request's audit trail takes no more events, and a test API token can't record one for a live signature request.
|
|
351
436
|
|
|
352
437
|
### Examples
|
|
353
438
|
|
|
@@ -512,7 +597,8 @@ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
|
512
597
|
body = DocSpring::CreateSubmissionRequest.new # CreateSubmissionRequest | The submission's data and settings.
|
|
513
598
|
opts = {
|
|
514
599
|
version: 'version_example', # String | The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
|
|
515
|
-
wait: true # Boolean | Wait until the
|
|
600
|
+
wait: true, # Boolean | Wait until the files have been generated before responding. Default true on sync.api hosts.
|
|
601
|
+
idempotency_key: 'idempotency_key_example' # String | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another submission. Send a new key with each new submission, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
|
|
516
602
|
}
|
|
517
603
|
|
|
518
604
|
begin
|
|
@@ -549,7 +635,8 @@ end
|
|
|
549
635
|
| **template_id** | **String** | The template's ID. | |
|
|
550
636
|
| **body** | [**CreateSubmissionRequest**](CreateSubmissionRequest.md) | The submission's data and settings. | |
|
|
551
637
|
| **version** | **String** | The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published). | [optional] |
|
|
552
|
-
| **wait** | **Boolean** | Wait until the
|
|
638
|
+
| **wait** | **Boolean** | Wait until the files have been generated before responding. Default true on sync.api hosts. | [optional] |
|
|
639
|
+
| **idempotency_key** | **String** | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another submission. Send a new key with each new submission, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds. | [optional] |
|
|
553
640
|
|
|
554
641
|
### Return type
|
|
555
642
|
|
|
@@ -588,7 +675,8 @@ end
|
|
|
588
675
|
api_instance = DocSpring::Client.new
|
|
589
676
|
body = DocSpring::CreateSubmissionBatchRequest.new({submissions: [DocSpring::SubmissionInput.new]}) # CreateSubmissionBatchRequest | The submissions to create, and the settings they share.
|
|
590
677
|
opts = {
|
|
591
|
-
wait: true # Boolean | Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts.
|
|
678
|
+
wait: true, # Boolean | Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts.
|
|
679
|
+
idempotency_key: 'idempotency_key_example' # String | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another batch. Send a new key with each new batch, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
|
|
592
680
|
}
|
|
593
681
|
|
|
594
682
|
begin
|
|
@@ -624,6 +712,7 @@ end
|
|
|
624
712
|
| ---- | ---- | ----------- | ----- |
|
|
625
713
|
| **body** | [**CreateSubmissionBatchRequest**](CreateSubmissionBatchRequest.md) | The submissions to create, and the settings they share. | |
|
|
626
714
|
| **wait** | **Boolean** | Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts. | [optional] |
|
|
715
|
+
| **idempotency_key** | **String** | A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another batch. Send a new key with each new batch, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds. | [optional] |
|
|
627
716
|
|
|
628
717
|
### Return type
|
|
629
718
|
|
|
@@ -662,7 +751,7 @@ end
|
|
|
662
751
|
api_instance = DocSpring::Client.new
|
|
663
752
|
body = DocSpring::CreateTemplateRequest.new({template_type: DocSpring::TemplateType::PDF}) # CreateTemplateRequest | The template to create.
|
|
664
753
|
opts = {
|
|
665
|
-
wait: true # Boolean | Wait until the PDF has been processed before responding. Default true on sync.api hosts.
|
|
754
|
+
wait: true # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
|
|
666
755
|
}
|
|
667
756
|
|
|
668
757
|
begin
|
|
@@ -697,7 +786,7 @@ end
|
|
|
697
786
|
| Name | Type | Description | Notes |
|
|
698
787
|
| ---- | ---- | ----------- | ----- |
|
|
699
788
|
| **body** | [**CreateTemplateRequest**](CreateTemplateRequest.md) | The template to create. | |
|
|
700
|
-
| **wait** | **Boolean** | Wait until the PDF has been processed before responding. Default true on sync.api hosts. | [optional] |
|
|
789
|
+
| **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
|
|
701
790
|
|
|
702
791
|
### Return type
|
|
703
792
|
|
|
@@ -713,6 +802,82 @@ end
|
|
|
713
802
|
- **Accept**: application/json
|
|
714
803
|
|
|
715
804
|
|
|
805
|
+
## create_template_preview
|
|
806
|
+
|
|
807
|
+
> <TemplatePreview> create_template_preview(template_id, body, opts)
|
|
808
|
+
|
|
809
|
+
Preview a template with data
|
|
810
|
+
|
|
811
|
+
Makes PNG images of a template's pages filled in with the data you send (not a PDF), so you can check how an HTML or PDF template prints with your data before you publish a version or send live data. It renders the template's draft, or the published `version` you ask for. A preview makes no submission and uses no credits, and its pages are watermarked like a test submission's PDF. It's `pending` while it renders: get it with GET /templates/{template_id}/previews/{preview_id} until it's `processed`, with an image of each page, or `error`.
|
|
812
|
+
|
|
813
|
+
### Examples
|
|
814
|
+
|
|
815
|
+
```ruby
|
|
816
|
+
require 'time'
|
|
817
|
+
require 'docspring'
|
|
818
|
+
# setup authorization
|
|
819
|
+
DocSpring.configure do |config|
|
|
820
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
821
|
+
config.username = 'YOUR USERNAME'
|
|
822
|
+
config.password = 'YOUR PASSWORD'
|
|
823
|
+
end
|
|
824
|
+
|
|
825
|
+
api_instance = DocSpring::Client.new
|
|
826
|
+
template_id = 'tpl_1234567890abcdef02' # String | The template's ID.
|
|
827
|
+
body = DocSpring::CreateTemplatePreviewRequest.new({data: { key: 3.56}}) # CreateTemplatePreviewRequest | The data to render the template with.
|
|
828
|
+
opts = {
|
|
829
|
+
version: 'version_example' # String | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
begin
|
|
833
|
+
# Preview a template with data
|
|
834
|
+
result = api_instance.create_template_preview(template_id, body, opts)
|
|
835
|
+
p result
|
|
836
|
+
rescue DocSpring::ApiError => e
|
|
837
|
+
puts "Error when calling Client->create_template_preview: #{e}"
|
|
838
|
+
end
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
#### Using the create_template_preview_with_http_info variant
|
|
842
|
+
|
|
843
|
+
This returns an Array which contains the response data, status code and headers.
|
|
844
|
+
|
|
845
|
+
> <Array(<TemplatePreview>, Integer, Hash)> create_template_preview_with_http_info(template_id, body, opts)
|
|
846
|
+
|
|
847
|
+
```ruby
|
|
848
|
+
begin
|
|
849
|
+
# Preview a template with data
|
|
850
|
+
data, status_code, headers = api_instance.create_template_preview_with_http_info(template_id, body, opts)
|
|
851
|
+
p status_code # => 2xx
|
|
852
|
+
p headers # => { ... }
|
|
853
|
+
p data # => <TemplatePreview>
|
|
854
|
+
rescue DocSpring::ApiError => e
|
|
855
|
+
puts "Error when calling Client->create_template_preview_with_http_info: #{e}"
|
|
856
|
+
end
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
### Parameters
|
|
860
|
+
|
|
861
|
+
| Name | Type | Description | Notes |
|
|
862
|
+
| ---- | ---- | ----------- | ----- |
|
|
863
|
+
| **template_id** | **String** | The template's ID. | |
|
|
864
|
+
| **body** | [**CreateTemplatePreviewRequest**](CreateTemplatePreviewRequest.md) | The data to render the template with. | |
|
|
865
|
+
| **version** | **String** | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`. | [optional] |
|
|
866
|
+
|
|
867
|
+
### Return type
|
|
868
|
+
|
|
869
|
+
[**TemplatePreview**](TemplatePreview.md)
|
|
870
|
+
|
|
871
|
+
### Authorization
|
|
872
|
+
|
|
873
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
874
|
+
|
|
875
|
+
### HTTP request headers
|
|
876
|
+
|
|
877
|
+
- **Content-Type**: application/json
|
|
878
|
+
- **Accept**: application/json
|
|
879
|
+
|
|
880
|
+
|
|
716
881
|
## create_webhook
|
|
717
882
|
|
|
718
883
|
> <Webhook> create_webhook(body)
|
|
@@ -1207,6 +1372,82 @@ end
|
|
|
1207
1372
|
- **Accept**: application/json
|
|
1208
1373
|
|
|
1209
1374
|
|
|
1375
|
+
## generate_submission_files
|
|
1376
|
+
|
|
1377
|
+
> <Submission> generate_submission_files(submission_id, body, opts)
|
|
1378
|
+
|
|
1379
|
+
Generate more files
|
|
1380
|
+
|
|
1381
|
+
Adds formats to a processed submission's files, in the background: `png`, a PNG image of each page of the PDF (up to 100 pages). To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
|
|
1382
|
+
|
|
1383
|
+
### Examples
|
|
1384
|
+
|
|
1385
|
+
```ruby
|
|
1386
|
+
require 'time'
|
|
1387
|
+
require 'docspring'
|
|
1388
|
+
# setup authorization
|
|
1389
|
+
DocSpring.configure do |config|
|
|
1390
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
1391
|
+
config.username = 'YOUR USERNAME'
|
|
1392
|
+
config.password = 'YOUR PASSWORD'
|
|
1393
|
+
end
|
|
1394
|
+
|
|
1395
|
+
api_instance = DocSpring::Client.new
|
|
1396
|
+
submission_id = 'sub_1234567890abcdef01' # String | The submission's ID.
|
|
1397
|
+
body = DocSpring::GenerateSubmissionFilesRequest.new({formats: [DocSpring::GenerateFilesFormat::PNG]}) # GenerateSubmissionFilesRequest | The formats to make.
|
|
1398
|
+
opts = {
|
|
1399
|
+
wait: true # Boolean | Wait until the files have been generated before responding. Default true on sync.api hosts.
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
begin
|
|
1403
|
+
# Generate more files
|
|
1404
|
+
result = api_instance.generate_submission_files(submission_id, body, opts)
|
|
1405
|
+
p result
|
|
1406
|
+
rescue DocSpring::ApiError => e
|
|
1407
|
+
puts "Error when calling Client->generate_submission_files: #{e}"
|
|
1408
|
+
end
|
|
1409
|
+
```
|
|
1410
|
+
|
|
1411
|
+
#### Using the generate_submission_files_with_http_info variant
|
|
1412
|
+
|
|
1413
|
+
This returns an Array which contains the response data, status code and headers.
|
|
1414
|
+
|
|
1415
|
+
> <Array(<Submission>, Integer, Hash)> generate_submission_files_with_http_info(submission_id, body, opts)
|
|
1416
|
+
|
|
1417
|
+
```ruby
|
|
1418
|
+
begin
|
|
1419
|
+
# Generate more files
|
|
1420
|
+
data, status_code, headers = api_instance.generate_submission_files_with_http_info(submission_id, body, opts)
|
|
1421
|
+
p status_code # => 2xx
|
|
1422
|
+
p headers # => { ... }
|
|
1423
|
+
p data # => <Submission>
|
|
1424
|
+
rescue DocSpring::ApiError => e
|
|
1425
|
+
puts "Error when calling Client->generate_submission_files_with_http_info: #{e}"
|
|
1426
|
+
end
|
|
1427
|
+
```
|
|
1428
|
+
|
|
1429
|
+
### Parameters
|
|
1430
|
+
|
|
1431
|
+
| Name | Type | Description | Notes |
|
|
1432
|
+
| ---- | ---- | ----------- | ----- |
|
|
1433
|
+
| **submission_id** | **String** | The submission's ID. | |
|
|
1434
|
+
| **body** | [**GenerateSubmissionFilesRequest**](GenerateSubmissionFilesRequest.md) | The formats to make. | |
|
|
1435
|
+
| **wait** | **Boolean** | Wait until the files have been generated before responding. Default true on sync.api hosts. | [optional] |
|
|
1436
|
+
|
|
1437
|
+
### Return type
|
|
1438
|
+
|
|
1439
|
+
[**Submission**](Submission.md)
|
|
1440
|
+
|
|
1441
|
+
### Authorization
|
|
1442
|
+
|
|
1443
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
1444
|
+
|
|
1445
|
+
### HTTP request headers
|
|
1446
|
+
|
|
1447
|
+
- **Content-Type**: application/json
|
|
1448
|
+
- **Accept**: application/json
|
|
1449
|
+
|
|
1450
|
+
|
|
1210
1451
|
## generate_submission_preview
|
|
1211
1452
|
|
|
1212
1453
|
> <Submission> generate_submission_preview(submission_id)
|
|
@@ -1842,13 +2083,13 @@ end
|
|
|
1842
2083
|
- **Accept**: application/json
|
|
1843
2084
|
|
|
1844
2085
|
|
|
1845
|
-
##
|
|
2086
|
+
## get_template_diff
|
|
1846
2087
|
|
|
1847
|
-
> <
|
|
2088
|
+
> <TemplateDiff> get_template_diff(template_id, opts)
|
|
1848
2089
|
|
|
1849
|
-
|
|
2090
|
+
Compare a version of a template with the one before it
|
|
1850
2091
|
|
|
1851
|
-
|
|
2092
|
+
Returns what changed in the template's draft since its latest published version (or in a published version since the one before it): fields added, removed, changed and moved, the settings that changed, and whether the document was replaced. Check it before you publish a version.
|
|
1852
2093
|
|
|
1853
2094
|
### Examples
|
|
1854
2095
|
|
|
@@ -1864,35 +2105,34 @@ end
|
|
|
1864
2105
|
|
|
1865
2106
|
api_instance = DocSpring::Client.new
|
|
1866
2107
|
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
1867
|
-
lang = DocSpring::ModelCodeLanguage::TYPESCRIPT # ModelCodeLanguage | The language to generate the code in.
|
|
1868
2108
|
opts = {
|
|
1869
|
-
version: '
|
|
2109
|
+
version: '0.1.0' # String | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
|
|
1870
2110
|
}
|
|
1871
2111
|
|
|
1872
2112
|
begin
|
|
1873
|
-
#
|
|
1874
|
-
result = api_instance.
|
|
2113
|
+
# Compare a version of a template with the one before it
|
|
2114
|
+
result = api_instance.get_template_diff(template_id, opts)
|
|
1875
2115
|
p result
|
|
1876
2116
|
rescue DocSpring::ApiError => e
|
|
1877
|
-
puts "Error when calling Client->
|
|
2117
|
+
puts "Error when calling Client->get_template_diff: #{e}"
|
|
1878
2118
|
end
|
|
1879
2119
|
```
|
|
1880
2120
|
|
|
1881
|
-
#### Using the
|
|
2121
|
+
#### Using the get_template_diff_with_http_info variant
|
|
1882
2122
|
|
|
1883
2123
|
This returns an Array which contains the response data, status code and headers.
|
|
1884
2124
|
|
|
1885
|
-
> <Array(<
|
|
2125
|
+
> <Array(<TemplateDiff>, Integer, Hash)> get_template_diff_with_http_info(template_id, opts)
|
|
1886
2126
|
|
|
1887
2127
|
```ruby
|
|
1888
2128
|
begin
|
|
1889
|
-
#
|
|
1890
|
-
data, status_code, headers = api_instance.
|
|
2129
|
+
# Compare a version of a template with the one before it
|
|
2130
|
+
data, status_code, headers = api_instance.get_template_diff_with_http_info(template_id, opts)
|
|
1891
2131
|
p status_code # => 2xx
|
|
1892
2132
|
p headers # => { ... }
|
|
1893
|
-
p data # => <
|
|
2133
|
+
p data # => <TemplateDiff>
|
|
1894
2134
|
rescue DocSpring::ApiError => e
|
|
1895
|
-
puts "Error when calling Client->
|
|
2135
|
+
puts "Error when calling Client->get_template_diff_with_http_info: #{e}"
|
|
1896
2136
|
end
|
|
1897
2137
|
```
|
|
1898
2138
|
|
|
@@ -1901,12 +2141,11 @@ end
|
|
|
1901
2141
|
| Name | Type | Description | Notes |
|
|
1902
2142
|
| ---- | ---- | ----------- | ----- |
|
|
1903
2143
|
| **template_id** | **String** | The template's ID. | |
|
|
1904
|
-
| **
|
|
1905
|
-
| **version** | **String** | The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default. | [optional] |
|
|
2144
|
+
| **version** | **String** | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`. | [optional] |
|
|
1906
2145
|
|
|
1907
2146
|
### Return type
|
|
1908
2147
|
|
|
1909
|
-
[**
|
|
2148
|
+
[**TemplateDiff**](TemplateDiff.md)
|
|
1910
2149
|
|
|
1911
2150
|
### Authorization
|
|
1912
2151
|
|
|
@@ -1918,13 +2157,13 @@ end
|
|
|
1918
2157
|
- **Accept**: application/json
|
|
1919
2158
|
|
|
1920
2159
|
|
|
1921
|
-
##
|
|
2160
|
+
## get_template_model_code
|
|
1922
2161
|
|
|
1923
|
-
>
|
|
2162
|
+
> <TemplateModelCode> get_template_model_code(template_id, lang, opts)
|
|
1924
2163
|
|
|
1925
|
-
|
|
2164
|
+
Generate typed code for a template's submission data
|
|
1926
2165
|
|
|
1927
|
-
|
|
2166
|
+
Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object, and `just_types=true` leaves out the code that converts JSON to and from the types. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
|
|
1928
2167
|
|
|
1929
2168
|
### Examples
|
|
1930
2169
|
|
|
@@ -1940,34 +2179,36 @@ end
|
|
|
1940
2179
|
|
|
1941
2180
|
api_instance = DocSpring::Client.new
|
|
1942
2181
|
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
2182
|
+
lang = DocSpring::ModelCodeLanguage::TYPESCRIPT # ModelCodeLanguage | The language to generate the code in.
|
|
1943
2183
|
opts = {
|
|
1944
|
-
version: 'draft' # String | The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
|
|
2184
|
+
version: 'draft', # String | The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
|
|
2185
|
+
just_types: true # Boolean | Return only the types (interfaces, classes or structs), without the code that converts JSON to and from them. Default false. JavaScript has no types and PHP no types-only code, so theirs is the same either way.
|
|
1945
2186
|
}
|
|
1946
2187
|
|
|
1947
2188
|
begin
|
|
1948
|
-
#
|
|
1949
|
-
result = api_instance.
|
|
2189
|
+
# Generate typed code for a template's submission data
|
|
2190
|
+
result = api_instance.get_template_model_code(template_id, lang, opts)
|
|
1950
2191
|
p result
|
|
1951
2192
|
rescue DocSpring::ApiError => e
|
|
1952
|
-
puts "Error when calling Client->
|
|
2193
|
+
puts "Error when calling Client->get_template_model_code: #{e}"
|
|
1953
2194
|
end
|
|
1954
2195
|
```
|
|
1955
2196
|
|
|
1956
|
-
#### Using the
|
|
2197
|
+
#### Using the get_template_model_code_with_http_info variant
|
|
1957
2198
|
|
|
1958
2199
|
This returns an Array which contains the response data, status code and headers.
|
|
1959
2200
|
|
|
1960
|
-
> <Array(
|
|
2201
|
+
> <Array(<TemplateModelCode>, Integer, Hash)> get_template_model_code_with_http_info(template_id, lang, opts)
|
|
1961
2202
|
|
|
1962
2203
|
```ruby
|
|
1963
2204
|
begin
|
|
1964
|
-
#
|
|
1965
|
-
data, status_code, headers = api_instance.
|
|
2205
|
+
# Generate typed code for a template's submission data
|
|
2206
|
+
data, status_code, headers = api_instance.get_template_model_code_with_http_info(template_id, lang, opts)
|
|
1966
2207
|
p status_code # => 2xx
|
|
1967
2208
|
p headers # => { ... }
|
|
1968
|
-
p data # =>
|
|
2209
|
+
p data # => <TemplateModelCode>
|
|
1969
2210
|
rescue DocSpring::ApiError => e
|
|
1970
|
-
puts "Error when calling Client->
|
|
2211
|
+
puts "Error when calling Client->get_template_model_code_with_http_info: #{e}"
|
|
1971
2212
|
end
|
|
1972
2213
|
```
|
|
1973
2214
|
|
|
@@ -1976,11 +2217,13 @@ end
|
|
|
1976
2217
|
| Name | Type | Description | Notes |
|
|
1977
2218
|
| ---- | ---- | ----------- | ----- |
|
|
1978
2219
|
| **template_id** | **String** | The template's ID. | |
|
|
2220
|
+
| **lang** | [**ModelCodeLanguage**](.md) | The language to generate the code in. | |
|
|
1979
2221
|
| **version** | **String** | The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default. | [optional] |
|
|
2222
|
+
| **just_types** | **Boolean** | Return only the types (interfaces, classes or structs), without the code that converts JSON to and from them. Default false. JavaScript has no types and PHP no types-only code, so theirs is the same either way. | [optional] |
|
|
1980
2223
|
|
|
1981
2224
|
### Return type
|
|
1982
2225
|
|
|
1983
|
-
**
|
|
2226
|
+
[**TemplateModelCode**](TemplateModelCode.md)
|
|
1984
2227
|
|
|
1985
2228
|
### Authorization
|
|
1986
2229
|
|
|
@@ -1992,13 +2235,13 @@ end
|
|
|
1992
2235
|
- **Accept**: application/json
|
|
1993
2236
|
|
|
1994
2237
|
|
|
1995
|
-
##
|
|
2238
|
+
## get_template_page_images
|
|
1996
2239
|
|
|
1997
|
-
> <
|
|
2240
|
+
> <TemplatePageImages> get_template_page_images(template_id, opts)
|
|
1998
2241
|
|
|
1999
|
-
Get a
|
|
2242
|
+
Get images of a template's pages
|
|
2000
2243
|
|
|
2001
|
-
Returns a
|
|
2244
|
+
Returns a JPEG image of each page of a PDF template's PDF, with temporary links to download them: the draft's PDF, or a published version's. Use them to see the pages that fields are placed on.
|
|
2002
2245
|
|
|
2003
2246
|
### Examples
|
|
2004
2247
|
|
|
@@ -2013,32 +2256,35 @@ DocSpring.configure do |config|
|
|
|
2013
2256
|
end
|
|
2014
2257
|
|
|
2015
2258
|
api_instance = DocSpring::Client.new
|
|
2016
|
-
|
|
2259
|
+
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
2260
|
+
opts = {
|
|
2261
|
+
version: 'latest' # String | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
|
|
2262
|
+
}
|
|
2017
2263
|
|
|
2018
2264
|
begin
|
|
2019
|
-
# Get a
|
|
2020
|
-
result = api_instance.
|
|
2265
|
+
# Get images of a template's pages
|
|
2266
|
+
result = api_instance.get_template_page_images(template_id, opts)
|
|
2021
2267
|
p result
|
|
2022
2268
|
rescue DocSpring::ApiError => e
|
|
2023
|
-
puts "Error when calling Client->
|
|
2269
|
+
puts "Error when calling Client->get_template_page_images: #{e}"
|
|
2024
2270
|
end
|
|
2025
2271
|
```
|
|
2026
2272
|
|
|
2027
|
-
#### Using the
|
|
2273
|
+
#### Using the get_template_page_images_with_http_info variant
|
|
2028
2274
|
|
|
2029
2275
|
This returns an Array which contains the response data, status code and headers.
|
|
2030
2276
|
|
|
2031
|
-
> <Array(<
|
|
2277
|
+
> <Array(<TemplatePageImages>, Integer, Hash)> get_template_page_images_with_http_info(template_id, opts)
|
|
2032
2278
|
|
|
2033
2279
|
```ruby
|
|
2034
2280
|
begin
|
|
2035
|
-
# Get a
|
|
2036
|
-
data, status_code, headers = api_instance.
|
|
2281
|
+
# Get images of a template's pages
|
|
2282
|
+
data, status_code, headers = api_instance.get_template_page_images_with_http_info(template_id, opts)
|
|
2037
2283
|
p status_code # => 2xx
|
|
2038
2284
|
p headers # => { ... }
|
|
2039
|
-
p data # => <
|
|
2285
|
+
p data # => <TemplatePageImages>
|
|
2040
2286
|
rescue DocSpring::ApiError => e
|
|
2041
|
-
puts "Error when calling Client->
|
|
2287
|
+
puts "Error when calling Client->get_template_page_images_with_http_info: #{e}"
|
|
2042
2288
|
end
|
|
2043
2289
|
```
|
|
2044
2290
|
|
|
@@ -2046,11 +2292,12 @@ end
|
|
|
2046
2292
|
|
|
2047
2293
|
| Name | Type | Description | Notes |
|
|
2048
2294
|
| ---- | ---- | ----------- | ----- |
|
|
2049
|
-
| **
|
|
2295
|
+
| **template_id** | **String** | The template's ID. | |
|
|
2296
|
+
| **version** | **String** | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`. | [optional] |
|
|
2050
2297
|
|
|
2051
2298
|
### Return type
|
|
2052
2299
|
|
|
2053
|
-
[**
|
|
2300
|
+
[**TemplatePageImages**](TemplatePageImages.md)
|
|
2054
2301
|
|
|
2055
2302
|
### Authorization
|
|
2056
2303
|
|
|
@@ -2062,13 +2309,13 @@ end
|
|
|
2062
2309
|
- **Accept**: application/json
|
|
2063
2310
|
|
|
2064
2311
|
|
|
2065
|
-
##
|
|
2312
|
+
## get_template_preview
|
|
2066
2313
|
|
|
2067
|
-
> <
|
|
2314
|
+
> <TemplatePreview> get_template_preview(template_id, preview_id)
|
|
2068
2315
|
|
|
2069
|
-
|
|
2316
|
+
Get a template preview
|
|
2070
2317
|
|
|
2071
|
-
Returns
|
|
2318
|
+
Returns a preview made with POST /templates/{template_id}/previews. Once it's `processed`, `pages` has a PNG image of each page with a temporary link to download it: a preview has no PDF. Previews are deleted an hour after they're created.
|
|
2072
2319
|
|
|
2073
2320
|
### Examples
|
|
2074
2321
|
|
|
@@ -2083,13 +2330,229 @@ DocSpring.configure do |config|
|
|
|
2083
2330
|
end
|
|
2084
2331
|
|
|
2085
2332
|
api_instance = DocSpring::Client.new
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
cursor: 'cursor_example' # String | The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
2089
|
-
}
|
|
2333
|
+
template_id = 'tpl_1234567890abcdef02' # String | The template's ID.
|
|
2334
|
+
preview_id = 'tpv_1234567890abcdef0123' # String | The preview's ID.
|
|
2090
2335
|
|
|
2091
2336
|
begin
|
|
2092
|
-
#
|
|
2337
|
+
# Get a template preview
|
|
2338
|
+
result = api_instance.get_template_preview(template_id, preview_id)
|
|
2339
|
+
p result
|
|
2340
|
+
rescue DocSpring::ApiError => e
|
|
2341
|
+
puts "Error when calling Client->get_template_preview: #{e}"
|
|
2342
|
+
end
|
|
2343
|
+
```
|
|
2344
|
+
|
|
2345
|
+
#### Using the get_template_preview_with_http_info variant
|
|
2346
|
+
|
|
2347
|
+
This returns an Array which contains the response data, status code and headers.
|
|
2348
|
+
|
|
2349
|
+
> <Array(<TemplatePreview>, Integer, Hash)> get_template_preview_with_http_info(template_id, preview_id)
|
|
2350
|
+
|
|
2351
|
+
```ruby
|
|
2352
|
+
begin
|
|
2353
|
+
# Get a template preview
|
|
2354
|
+
data, status_code, headers = api_instance.get_template_preview_with_http_info(template_id, preview_id)
|
|
2355
|
+
p status_code # => 2xx
|
|
2356
|
+
p headers # => { ... }
|
|
2357
|
+
p data # => <TemplatePreview>
|
|
2358
|
+
rescue DocSpring::ApiError => e
|
|
2359
|
+
puts "Error when calling Client->get_template_preview_with_http_info: #{e}"
|
|
2360
|
+
end
|
|
2361
|
+
```
|
|
2362
|
+
|
|
2363
|
+
### Parameters
|
|
2364
|
+
|
|
2365
|
+
| Name | Type | Description | Notes |
|
|
2366
|
+
| ---- | ---- | ----------- | ----- |
|
|
2367
|
+
| **template_id** | **String** | The template's ID. | |
|
|
2368
|
+
| **preview_id** | **String** | The preview's ID. | |
|
|
2369
|
+
|
|
2370
|
+
### Return type
|
|
2371
|
+
|
|
2372
|
+
[**TemplatePreview**](TemplatePreview.md)
|
|
2373
|
+
|
|
2374
|
+
### Authorization
|
|
2375
|
+
|
|
2376
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
2377
|
+
|
|
2378
|
+
### HTTP request headers
|
|
2379
|
+
|
|
2380
|
+
- **Content-Type**: Not defined
|
|
2381
|
+
- **Accept**: application/json
|
|
2382
|
+
|
|
2383
|
+
|
|
2384
|
+
## get_template_schema
|
|
2385
|
+
|
|
2386
|
+
> Hash<String, Object> get_template_schema(template_id, opts)
|
|
2387
|
+
|
|
2388
|
+
Get the JSON Schema of a template's submission data
|
|
2389
|
+
|
|
2390
|
+
Returns the JSON Schema that a submission's `data` must match. Use it to check data before you create submissions, or to build a form for the template's fields.
|
|
2391
|
+
|
|
2392
|
+
### Examples
|
|
2393
|
+
|
|
2394
|
+
```ruby
|
|
2395
|
+
require 'time'
|
|
2396
|
+
require 'docspring'
|
|
2397
|
+
# setup authorization
|
|
2398
|
+
DocSpring.configure do |config|
|
|
2399
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
2400
|
+
config.username = 'YOUR USERNAME'
|
|
2401
|
+
config.password = 'YOUR PASSWORD'
|
|
2402
|
+
end
|
|
2403
|
+
|
|
2404
|
+
api_instance = DocSpring::Client.new
|
|
2405
|
+
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
2406
|
+
opts = {
|
|
2407
|
+
version: 'draft' # String | The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
begin
|
|
2411
|
+
# Get the JSON Schema of a template's submission data
|
|
2412
|
+
result = api_instance.get_template_schema(template_id, opts)
|
|
2413
|
+
p result
|
|
2414
|
+
rescue DocSpring::ApiError => e
|
|
2415
|
+
puts "Error when calling Client->get_template_schema: #{e}"
|
|
2416
|
+
end
|
|
2417
|
+
```
|
|
2418
|
+
|
|
2419
|
+
#### Using the get_template_schema_with_http_info variant
|
|
2420
|
+
|
|
2421
|
+
This returns an Array which contains the response data, status code and headers.
|
|
2422
|
+
|
|
2423
|
+
> <Array(Hash<String, Object>, Integer, Hash)> get_template_schema_with_http_info(template_id, opts)
|
|
2424
|
+
|
|
2425
|
+
```ruby
|
|
2426
|
+
begin
|
|
2427
|
+
# Get the JSON Schema of a template's submission data
|
|
2428
|
+
data, status_code, headers = api_instance.get_template_schema_with_http_info(template_id, opts)
|
|
2429
|
+
p status_code # => 2xx
|
|
2430
|
+
p headers # => { ... }
|
|
2431
|
+
p data # => Hash<String, Object>
|
|
2432
|
+
rescue DocSpring::ApiError => e
|
|
2433
|
+
puts "Error when calling Client->get_template_schema_with_http_info: #{e}"
|
|
2434
|
+
end
|
|
2435
|
+
```
|
|
2436
|
+
|
|
2437
|
+
### Parameters
|
|
2438
|
+
|
|
2439
|
+
| Name | Type | Description | Notes |
|
|
2440
|
+
| ---- | ---- | ----------- | ----- |
|
|
2441
|
+
| **template_id** | **String** | The template's ID. | |
|
|
2442
|
+
| **version** | **String** | The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default. | [optional] |
|
|
2443
|
+
|
|
2444
|
+
### Return type
|
|
2445
|
+
|
|
2446
|
+
**Hash<String, Object>**
|
|
2447
|
+
|
|
2448
|
+
### Authorization
|
|
2449
|
+
|
|
2450
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
2451
|
+
|
|
2452
|
+
### HTTP request headers
|
|
2453
|
+
|
|
2454
|
+
- **Content-Type**: Not defined
|
|
2455
|
+
- **Accept**: application/json
|
|
2456
|
+
|
|
2457
|
+
|
|
2458
|
+
## get_webhook
|
|
2459
|
+
|
|
2460
|
+
> <Webhook> get_webhook(webhook_id)
|
|
2461
|
+
|
|
2462
|
+
Get a webhook
|
|
2463
|
+
|
|
2464
|
+
Returns a webhook.
|
|
2465
|
+
|
|
2466
|
+
### Examples
|
|
2467
|
+
|
|
2468
|
+
```ruby
|
|
2469
|
+
require 'time'
|
|
2470
|
+
require 'docspring'
|
|
2471
|
+
# setup authorization
|
|
2472
|
+
DocSpring.configure do |config|
|
|
2473
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
2474
|
+
config.username = 'YOUR USERNAME'
|
|
2475
|
+
config.password = 'YOUR PASSWORD'
|
|
2476
|
+
end
|
|
2477
|
+
|
|
2478
|
+
api_instance = DocSpring::Client.new
|
|
2479
|
+
webhook_id = 'webhook_id_example' # String | The webhook's ID.
|
|
2480
|
+
|
|
2481
|
+
begin
|
|
2482
|
+
# Get a webhook
|
|
2483
|
+
result = api_instance.get_webhook(webhook_id)
|
|
2484
|
+
p result
|
|
2485
|
+
rescue DocSpring::ApiError => e
|
|
2486
|
+
puts "Error when calling Client->get_webhook: #{e}"
|
|
2487
|
+
end
|
|
2488
|
+
```
|
|
2489
|
+
|
|
2490
|
+
#### Using the get_webhook_with_http_info variant
|
|
2491
|
+
|
|
2492
|
+
This returns an Array which contains the response data, status code and headers.
|
|
2493
|
+
|
|
2494
|
+
> <Array(<Webhook>, Integer, Hash)> get_webhook_with_http_info(webhook_id)
|
|
2495
|
+
|
|
2496
|
+
```ruby
|
|
2497
|
+
begin
|
|
2498
|
+
# Get a webhook
|
|
2499
|
+
data, status_code, headers = api_instance.get_webhook_with_http_info(webhook_id)
|
|
2500
|
+
p status_code # => 2xx
|
|
2501
|
+
p headers # => { ... }
|
|
2502
|
+
p data # => <Webhook>
|
|
2503
|
+
rescue DocSpring::ApiError => e
|
|
2504
|
+
puts "Error when calling Client->get_webhook_with_http_info: #{e}"
|
|
2505
|
+
end
|
|
2506
|
+
```
|
|
2507
|
+
|
|
2508
|
+
### Parameters
|
|
2509
|
+
|
|
2510
|
+
| Name | Type | Description | Notes |
|
|
2511
|
+
| ---- | ---- | ----------- | ----- |
|
|
2512
|
+
| **webhook_id** | **String** | The webhook's ID. | |
|
|
2513
|
+
|
|
2514
|
+
### Return type
|
|
2515
|
+
|
|
2516
|
+
[**Webhook**](Webhook.md)
|
|
2517
|
+
|
|
2518
|
+
### Authorization
|
|
2519
|
+
|
|
2520
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
2521
|
+
|
|
2522
|
+
### HTTP request headers
|
|
2523
|
+
|
|
2524
|
+
- **Content-Type**: Not defined
|
|
2525
|
+
- **Accept**: application/json
|
|
2526
|
+
|
|
2527
|
+
|
|
2528
|
+
## list_combined_pdfs
|
|
2529
|
+
|
|
2530
|
+
> <CombinedPdfList> list_combined_pdfs(opts)
|
|
2531
|
+
|
|
2532
|
+
List combined PDFs
|
|
2533
|
+
|
|
2534
|
+
Returns the combined PDFs in your account, newest first, one page at a time.
|
|
2535
|
+
|
|
2536
|
+
### Examples
|
|
2537
|
+
|
|
2538
|
+
```ruby
|
|
2539
|
+
require 'time'
|
|
2540
|
+
require 'docspring'
|
|
2541
|
+
# setup authorization
|
|
2542
|
+
DocSpring.configure do |config|
|
|
2543
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
2544
|
+
config.username = 'YOUR USERNAME'
|
|
2545
|
+
config.password = 'YOUR PASSWORD'
|
|
2546
|
+
end
|
|
2547
|
+
|
|
2548
|
+
api_instance = DocSpring::Client.new
|
|
2549
|
+
opts = {
|
|
2550
|
+
limit: 56, # Integer | How many items to return (1-100, default 50).
|
|
2551
|
+
cursor: 'cursor_example' # String | The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
begin
|
|
2555
|
+
# List combined PDFs
|
|
2093
2556
|
result = api_instance.list_combined_pdfs(opts)
|
|
2094
2557
|
p result
|
|
2095
2558
|
rescue DocSpring::ApiError => e
|
|
@@ -2292,7 +2755,7 @@ end
|
|
|
2292
2755
|
|
|
2293
2756
|
List submissions
|
|
2294
2757
|
|
|
2295
|
-
Returns the submissions in your account, newest first, one page at a time.
|
|
2758
|
+
Returns the submissions in your account, newest first, one page at a time. Each one is a summary: its `data` is null unless you pass `include_data=true`, and its `files` are empty unless you pass `include_files=true`. Get a submission by its ID for its signature requests, uploads and page images.
|
|
2296
2759
|
|
|
2297
2760
|
### Examples
|
|
2298
2761
|
|
|
@@ -2314,7 +2777,9 @@ opts = {
|
|
|
2314
2777
|
created_before: Time.parse('2018-10-20T09:00:00Z'), # Time | Only list submissions created before this time.
|
|
2315
2778
|
include_data: true, # Boolean | Include each submission's `data` (null without it).
|
|
2316
2779
|
limit: 56, # Integer | How many items to return (1-100, default 50).
|
|
2317
|
-
cursor: 'cursor_example' # String | The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
2780
|
+
cursor: 'cursor_example', # String | The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
2781
|
+
state: DocSpring::SubmissionState::PENDING, # SubmissionState | Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
|
|
2782
|
+
include_files: true # Boolean | Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
|
|
2318
2783
|
}
|
|
2319
2784
|
|
|
2320
2785
|
begin
|
|
@@ -2355,6 +2820,8 @@ end
|
|
|
2355
2820
|
| **include_data** | **Boolean** | Include each submission's `data` (null without it). | [optional] |
|
|
2356
2821
|
| **limit** | **Integer** | How many items to return (1-100, default 50). | [optional][default to 50] |
|
|
2357
2822
|
| **cursor** | **String** | The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one. | [optional] |
|
|
2823
|
+
| **state** | [**SubmissionState**](.md) | Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck. | [optional] |
|
|
2824
|
+
| **include_files** | **Boolean** | Include each submission's generated files and their download links (`files`, empty without it), without the page images' links. | [optional] |
|
|
2358
2825
|
|
|
2359
2826
|
### Return type
|
|
2360
2827
|
|
|
@@ -2370,6 +2837,80 @@ end
|
|
|
2370
2837
|
- **Accept**: application/json
|
|
2371
2838
|
|
|
2372
2839
|
|
|
2840
|
+
## list_template_fields
|
|
2841
|
+
|
|
2842
|
+
> <TemplateFields> list_template_fields(template_id, opts)
|
|
2843
|
+
|
|
2844
|
+
List a template's fields
|
|
2845
|
+
|
|
2846
|
+
Returns a template's fields with all of their settings, page by page: the draft's fields, or a published version's. A PDF template's fields are placed on its pages: GET /templates/{template_id}/page_images has images of the pages.
|
|
2847
|
+
|
|
2848
|
+
### Examples
|
|
2849
|
+
|
|
2850
|
+
```ruby
|
|
2851
|
+
require 'time'
|
|
2852
|
+
require 'docspring'
|
|
2853
|
+
# setup authorization
|
|
2854
|
+
DocSpring.configure do |config|
|
|
2855
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
2856
|
+
config.username = 'YOUR USERNAME'
|
|
2857
|
+
config.password = 'YOUR PASSWORD'
|
|
2858
|
+
end
|
|
2859
|
+
|
|
2860
|
+
api_instance = DocSpring::Client.new
|
|
2861
|
+
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
2862
|
+
opts = {
|
|
2863
|
+
version: 'latest' # String | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
|
|
2864
|
+
}
|
|
2865
|
+
|
|
2866
|
+
begin
|
|
2867
|
+
# List a template's fields
|
|
2868
|
+
result = api_instance.list_template_fields(template_id, opts)
|
|
2869
|
+
p result
|
|
2870
|
+
rescue DocSpring::ApiError => e
|
|
2871
|
+
puts "Error when calling Client->list_template_fields: #{e}"
|
|
2872
|
+
end
|
|
2873
|
+
```
|
|
2874
|
+
|
|
2875
|
+
#### Using the list_template_fields_with_http_info variant
|
|
2876
|
+
|
|
2877
|
+
This returns an Array which contains the response data, status code and headers.
|
|
2878
|
+
|
|
2879
|
+
> <Array(<TemplateFields>, Integer, Hash)> list_template_fields_with_http_info(template_id, opts)
|
|
2880
|
+
|
|
2881
|
+
```ruby
|
|
2882
|
+
begin
|
|
2883
|
+
# List a template's fields
|
|
2884
|
+
data, status_code, headers = api_instance.list_template_fields_with_http_info(template_id, opts)
|
|
2885
|
+
p status_code # => 2xx
|
|
2886
|
+
p headers # => { ... }
|
|
2887
|
+
p data # => <TemplateFields>
|
|
2888
|
+
rescue DocSpring::ApiError => e
|
|
2889
|
+
puts "Error when calling Client->list_template_fields_with_http_info: #{e}"
|
|
2890
|
+
end
|
|
2891
|
+
```
|
|
2892
|
+
|
|
2893
|
+
### Parameters
|
|
2894
|
+
|
|
2895
|
+
| Name | Type | Description | Notes |
|
|
2896
|
+
| ---- | ---- | ----------- | ----- |
|
|
2897
|
+
| **template_id** | **String** | The template's ID. | |
|
|
2898
|
+
| **version** | **String** | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`. | [optional] |
|
|
2899
|
+
|
|
2900
|
+
### Return type
|
|
2901
|
+
|
|
2902
|
+
[**TemplateFields**](TemplateFields.md)
|
|
2903
|
+
|
|
2904
|
+
### Authorization
|
|
2905
|
+
|
|
2906
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
2907
|
+
|
|
2908
|
+
### HTTP request headers
|
|
2909
|
+
|
|
2910
|
+
- **Content-Type**: Not defined
|
|
2911
|
+
- **Accept**: application/json
|
|
2912
|
+
|
|
2913
|
+
|
|
2373
2914
|
## list_template_submissions
|
|
2374
2915
|
|
|
2375
2916
|
> <SubmissionList> list_template_submissions(template_id, opts)
|
|
@@ -2398,7 +2939,9 @@ opts = {
|
|
|
2398
2939
|
created_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Only list submissions created before this time.
|
|
2399
2940
|
include_data: true, # Boolean | Include each submission's `data` (null without it).
|
|
2400
2941
|
limit: 56, # Integer | How many items to return (1-100, default 50).
|
|
2401
|
-
cursor: 'cursor_example' # String | The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
2942
|
+
cursor: 'cursor_example', # String | The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
2943
|
+
state: DocSpring::SubmissionState::PENDING, # SubmissionState | Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
|
|
2944
|
+
include_files: true # Boolean | Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
|
|
2402
2945
|
}
|
|
2403
2946
|
|
|
2404
2947
|
begin
|
|
@@ -2439,6 +2982,8 @@ end
|
|
|
2439
2982
|
| **include_data** | **Boolean** | Include each submission's `data` (null without it). | [optional] |
|
|
2440
2983
|
| **limit** | **Integer** | How many items to return (1-100, default 50). | [optional][default to 50] |
|
|
2441
2984
|
| **cursor** | **String** | The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one. | [optional] |
|
|
2985
|
+
| **state** | [**SubmissionState**](.md) | Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck. | [optional] |
|
|
2986
|
+
| **include_files** | **Boolean** | Include each submission's generated files and their download links (`files`, empty without it), without the page images' links. | [optional] |
|
|
2442
2987
|
|
|
2443
2988
|
### Return type
|
|
2444
2989
|
|
|
@@ -2460,7 +3005,7 @@ end
|
|
|
2460
3005
|
|
|
2461
3006
|
List templates
|
|
2462
3007
|
|
|
2463
|
-
Returns the templates in your account (their drafts), newest first, one page at a time.
|
|
3008
|
+
Returns the templates in your account (their drafts), newest first, one page at a time. Each one is a summary: get a template by its ID for its settings, its PDF in full, its HTML, defaults and published versions.
|
|
2464
3009
|
|
|
2465
3010
|
### Examples
|
|
2466
3011
|
|
|
@@ -2766,7 +3311,7 @@ end
|
|
|
2766
3311
|
|
|
2767
3312
|
Publish a template version
|
|
2768
3313
|
|
|
2769
|
-
Publishes the template's draft as a new version that doesn't change. `version_type` says which part of the latest version number goes up.
|
|
3314
|
+
Publishes the template's draft as a new version that doesn't change. `version_type` says which part of the latest version number goes up. While the template's PDF is downloading or being processed, or DocSpring is setting up its fields, it returns a 409 that says so.
|
|
2770
3315
|
|
|
2771
3316
|
### Examples
|
|
2772
3317
|
|
|
@@ -2832,6 +3377,78 @@ end
|
|
|
2832
3377
|
- **Accept**: application/json
|
|
2833
3378
|
|
|
2834
3379
|
|
|
3380
|
+
## remove_template_fields
|
|
3381
|
+
|
|
3382
|
+
> <TemplateFields> remove_template_fields(template_id, body)
|
|
3383
|
+
|
|
3384
|
+
Remove fields from a template
|
|
3385
|
+
|
|
3386
|
+
Removes fields from a template's draft and returns the fields that are left. Conditional logic that used only the removed fields is removed too.
|
|
3387
|
+
|
|
3388
|
+
### Examples
|
|
3389
|
+
|
|
3390
|
+
```ruby
|
|
3391
|
+
require 'time'
|
|
3392
|
+
require 'docspring'
|
|
3393
|
+
# setup authorization
|
|
3394
|
+
DocSpring.configure do |config|
|
|
3395
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
3396
|
+
config.username = 'YOUR USERNAME'
|
|
3397
|
+
config.password = 'YOUR PASSWORD'
|
|
3398
|
+
end
|
|
3399
|
+
|
|
3400
|
+
api_instance = DocSpring::Client.new
|
|
3401
|
+
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
3402
|
+
body = DocSpring::RemoveTemplateFieldsRequest.new({field_ids: [37]}) # RemoveTemplateFieldsRequest | The fields to remove from the template's draft.
|
|
3403
|
+
|
|
3404
|
+
begin
|
|
3405
|
+
# Remove fields from a template
|
|
3406
|
+
result = api_instance.remove_template_fields(template_id, body)
|
|
3407
|
+
p result
|
|
3408
|
+
rescue DocSpring::ApiError => e
|
|
3409
|
+
puts "Error when calling Client->remove_template_fields: #{e}"
|
|
3410
|
+
end
|
|
3411
|
+
```
|
|
3412
|
+
|
|
3413
|
+
#### Using the remove_template_fields_with_http_info variant
|
|
3414
|
+
|
|
3415
|
+
This returns an Array which contains the response data, status code and headers.
|
|
3416
|
+
|
|
3417
|
+
> <Array(<TemplateFields>, Integer, Hash)> remove_template_fields_with_http_info(template_id, body)
|
|
3418
|
+
|
|
3419
|
+
```ruby
|
|
3420
|
+
begin
|
|
3421
|
+
# Remove fields from a template
|
|
3422
|
+
data, status_code, headers = api_instance.remove_template_fields_with_http_info(template_id, body)
|
|
3423
|
+
p status_code # => 2xx
|
|
3424
|
+
p headers # => { ... }
|
|
3425
|
+
p data # => <TemplateFields>
|
|
3426
|
+
rescue DocSpring::ApiError => e
|
|
3427
|
+
puts "Error when calling Client->remove_template_fields_with_http_info: #{e}"
|
|
3428
|
+
end
|
|
3429
|
+
```
|
|
3430
|
+
|
|
3431
|
+
### Parameters
|
|
3432
|
+
|
|
3433
|
+
| Name | Type | Description | Notes |
|
|
3434
|
+
| ---- | ---- | ----------- | ----- |
|
|
3435
|
+
| **template_id** | **String** | The template's ID. | |
|
|
3436
|
+
| **body** | [**RemoveTemplateFieldsRequest**](RemoveTemplateFieldsRequest.md) | The fields to remove from the template's draft. | |
|
|
3437
|
+
|
|
3438
|
+
### Return type
|
|
3439
|
+
|
|
3440
|
+
[**TemplateFields**](TemplateFields.md)
|
|
3441
|
+
|
|
3442
|
+
### Authorization
|
|
3443
|
+
|
|
3444
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
3445
|
+
|
|
3446
|
+
### HTTP request headers
|
|
3447
|
+
|
|
3448
|
+
- **Content-Type**: application/json
|
|
3449
|
+
- **Accept**: application/json
|
|
3450
|
+
|
|
3451
|
+
|
|
2835
3452
|
## rename_folder
|
|
2836
3453
|
|
|
2837
3454
|
> <Folder> rename_folder(folder_id, body)
|
|
@@ -2904,6 +3521,78 @@ end
|
|
|
2904
3521
|
- **Accept**: application/json
|
|
2905
3522
|
|
|
2906
3523
|
|
|
3524
|
+
## reorder_template_fields
|
|
3525
|
+
|
|
3526
|
+
> <TemplateFields> reorder_template_fields(template_id, body)
|
|
3527
|
+
|
|
3528
|
+
Reorder a template's fields
|
|
3529
|
+
|
|
3530
|
+
Changes the order of the fields in a template's draft and returns them in their new order. Send every field's ID: each field stays on its page, and a page's fields are printed in this order, so a later field prints over an earlier one where they overlap. Their values are in this order in the template's data schema and forms.
|
|
3531
|
+
|
|
3532
|
+
### Examples
|
|
3533
|
+
|
|
3534
|
+
```ruby
|
|
3535
|
+
require 'time'
|
|
3536
|
+
require 'docspring'
|
|
3537
|
+
# setup authorization
|
|
3538
|
+
DocSpring.configure do |config|
|
|
3539
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
3540
|
+
config.username = 'YOUR USERNAME'
|
|
3541
|
+
config.password = 'YOUR PASSWORD'
|
|
3542
|
+
end
|
|
3543
|
+
|
|
3544
|
+
api_instance = DocSpring::Client.new
|
|
3545
|
+
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
3546
|
+
body = DocSpring::ReorderTemplateFieldsRequest.new({field_ids: [37]}) # ReorderTemplateFieldsRequest | The new order of the fields in the template's draft.
|
|
3547
|
+
|
|
3548
|
+
begin
|
|
3549
|
+
# Reorder a template's fields
|
|
3550
|
+
result = api_instance.reorder_template_fields(template_id, body)
|
|
3551
|
+
p result
|
|
3552
|
+
rescue DocSpring::ApiError => e
|
|
3553
|
+
puts "Error when calling Client->reorder_template_fields: #{e}"
|
|
3554
|
+
end
|
|
3555
|
+
```
|
|
3556
|
+
|
|
3557
|
+
#### Using the reorder_template_fields_with_http_info variant
|
|
3558
|
+
|
|
3559
|
+
This returns an Array which contains the response data, status code and headers.
|
|
3560
|
+
|
|
3561
|
+
> <Array(<TemplateFields>, Integer, Hash)> reorder_template_fields_with_http_info(template_id, body)
|
|
3562
|
+
|
|
3563
|
+
```ruby
|
|
3564
|
+
begin
|
|
3565
|
+
# Reorder a template's fields
|
|
3566
|
+
data, status_code, headers = api_instance.reorder_template_fields_with_http_info(template_id, body)
|
|
3567
|
+
p status_code # => 2xx
|
|
3568
|
+
p headers # => { ... }
|
|
3569
|
+
p data # => <TemplateFields>
|
|
3570
|
+
rescue DocSpring::ApiError => e
|
|
3571
|
+
puts "Error when calling Client->reorder_template_fields_with_http_info: #{e}"
|
|
3572
|
+
end
|
|
3573
|
+
```
|
|
3574
|
+
|
|
3575
|
+
### Parameters
|
|
3576
|
+
|
|
3577
|
+
| Name | Type | Description | Notes |
|
|
3578
|
+
| ---- | ---- | ----------- | ----- |
|
|
3579
|
+
| **template_id** | **String** | The template's ID. | |
|
|
3580
|
+
| **body** | [**ReorderTemplateFieldsRequest**](ReorderTemplateFieldsRequest.md) | The new order of the fields in the template's draft. | |
|
|
3581
|
+
|
|
3582
|
+
### Return type
|
|
3583
|
+
|
|
3584
|
+
[**TemplateFields**](TemplateFields.md)
|
|
3585
|
+
|
|
3586
|
+
### Authorization
|
|
3587
|
+
|
|
3588
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
3589
|
+
|
|
3590
|
+
### HTTP request headers
|
|
3591
|
+
|
|
3592
|
+
- **Content-Type**: application/json
|
|
3593
|
+
- **Accept**: application/json
|
|
3594
|
+
|
|
3595
|
+
|
|
2907
3596
|
## restore_template_version
|
|
2908
3597
|
|
|
2909
3598
|
> <Template> restore_template_version(template_id, body)
|
|
@@ -3121,7 +3810,7 @@ end
|
|
|
3121
3810
|
|
|
3122
3811
|
Update a template
|
|
3123
3812
|
|
|
3124
|
-
Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object. Setting `parent_folder_id` moves the template and all of its published versions.
|
|
3813
|
+
Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object, and `field_groups` changes only the groups it lists. Setting `parent_folder_id` moves the template and all of its published versions.
|
|
3125
3814
|
|
|
3126
3815
|
### Examples
|
|
3127
3816
|
|
|
@@ -3193,7 +3882,7 @@ end
|
|
|
3193
3882
|
|
|
3194
3883
|
Replace a template's PDF
|
|
3195
3884
|
|
|
3196
|
-
Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields. To send the PDF
|
|
3885
|
+
Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign) (`cache_id`), a link to download it from (`document_url`), or the file in base64 (`document_base64`). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields. To send the PDF as `multipart/form-data` instead, use PUT /templates/{template_id}/document/upload.
|
|
3197
3886
|
|
|
3198
3887
|
### Examples
|
|
3199
3888
|
|
|
@@ -3209,9 +3898,9 @@ end
|
|
|
3209
3898
|
|
|
3210
3899
|
api_instance = DocSpring::Client.new
|
|
3211
3900
|
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
3212
|
-
body = DocSpring::UpdateTemplateDocumentRequest.new
|
|
3901
|
+
body = DocSpring::UpdateTemplateDocumentRequest.new # UpdateTemplateDocumentRequest | The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
|
|
3213
3902
|
opts = {
|
|
3214
|
-
wait: true # Boolean | Wait until the PDF has been processed before responding. Default true on sync.api hosts.
|
|
3903
|
+
wait: true # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
|
|
3215
3904
|
}
|
|
3216
3905
|
|
|
3217
3906
|
begin
|
|
@@ -3246,8 +3935,8 @@ end
|
|
|
3246
3935
|
| Name | Type | Description | Notes |
|
|
3247
3936
|
| ---- | ---- | ----------- | ----- |
|
|
3248
3937
|
| **template_id** | **String** | The template's ID. | |
|
|
3249
|
-
| **body** | [**UpdateTemplateDocumentRequest**](UpdateTemplateDocumentRequest.md) | The new PDF
|
|
3250
|
-
| **wait** | **Boolean** | Wait until the PDF has been processed before responding. Default true on sync.api hosts. | [optional] |
|
|
3938
|
+
| **body** | [**UpdateTemplateDocumentRequest**](UpdateTemplateDocumentRequest.md) | The new PDF, as one of `cache_id`, `document_url` and `document_base64`. | |
|
|
3939
|
+
| **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
|
|
3251
3940
|
|
|
3252
3941
|
### Return type
|
|
3253
3942
|
|
|
@@ -3263,6 +3952,78 @@ end
|
|
|
3263
3952
|
- **Accept**: application/json
|
|
3264
3953
|
|
|
3265
3954
|
|
|
3955
|
+
## update_template_fields
|
|
3956
|
+
|
|
3957
|
+
> <TemplateFields> update_template_fields(template_id, body)
|
|
3958
|
+
|
|
3959
|
+
Update a template's fields
|
|
3960
|
+
|
|
3961
|
+
Changes fields of a template's draft and returns all of its fields. Settings left out keep their values. A shared setting (`type`, `required`, `default`, ...) changes for every field with the same name.
|
|
3962
|
+
|
|
3963
|
+
### Examples
|
|
3964
|
+
|
|
3965
|
+
```ruby
|
|
3966
|
+
require 'time'
|
|
3967
|
+
require 'docspring'
|
|
3968
|
+
# setup authorization
|
|
3969
|
+
DocSpring.configure do |config|
|
|
3970
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
3971
|
+
config.username = 'YOUR USERNAME'
|
|
3972
|
+
config.password = 'YOUR PASSWORD'
|
|
3973
|
+
end
|
|
3974
|
+
|
|
3975
|
+
api_instance = DocSpring::Client.new
|
|
3976
|
+
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
3977
|
+
body = DocSpring::UpdateTemplateFieldsRequest.new({fields: [DocSpring::FieldInput.new]}) # UpdateTemplateFieldsRequest | The fields to change in the template's draft.
|
|
3978
|
+
|
|
3979
|
+
begin
|
|
3980
|
+
# Update a template's fields
|
|
3981
|
+
result = api_instance.update_template_fields(template_id, body)
|
|
3982
|
+
p result
|
|
3983
|
+
rescue DocSpring::ApiError => e
|
|
3984
|
+
puts "Error when calling Client->update_template_fields: #{e}"
|
|
3985
|
+
end
|
|
3986
|
+
```
|
|
3987
|
+
|
|
3988
|
+
#### Using the update_template_fields_with_http_info variant
|
|
3989
|
+
|
|
3990
|
+
This returns an Array which contains the response data, status code and headers.
|
|
3991
|
+
|
|
3992
|
+
> <Array(<TemplateFields>, Integer, Hash)> update_template_fields_with_http_info(template_id, body)
|
|
3993
|
+
|
|
3994
|
+
```ruby
|
|
3995
|
+
begin
|
|
3996
|
+
# Update a template's fields
|
|
3997
|
+
data, status_code, headers = api_instance.update_template_fields_with_http_info(template_id, body)
|
|
3998
|
+
p status_code # => 2xx
|
|
3999
|
+
p headers # => { ... }
|
|
4000
|
+
p data # => <TemplateFields>
|
|
4001
|
+
rescue DocSpring::ApiError => e
|
|
4002
|
+
puts "Error when calling Client->update_template_fields_with_http_info: #{e}"
|
|
4003
|
+
end
|
|
4004
|
+
```
|
|
4005
|
+
|
|
4006
|
+
### Parameters
|
|
4007
|
+
|
|
4008
|
+
| Name | Type | Description | Notes |
|
|
4009
|
+
| ---- | ---- | ----------- | ----- |
|
|
4010
|
+
| **template_id** | **String** | The template's ID. | |
|
|
4011
|
+
| **body** | [**UpdateTemplateFieldsRequest**](UpdateTemplateFieldsRequest.md) | The fields to change in the template's draft. | |
|
|
4012
|
+
|
|
4013
|
+
### Return type
|
|
4014
|
+
|
|
4015
|
+
[**TemplateFields**](TemplateFields.md)
|
|
4016
|
+
|
|
4017
|
+
### Authorization
|
|
4018
|
+
|
|
4019
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
4020
|
+
|
|
4021
|
+
### HTTP request headers
|
|
4022
|
+
|
|
4023
|
+
- **Content-Type**: application/json
|
|
4024
|
+
- **Accept**: application/json
|
|
4025
|
+
|
|
4026
|
+
|
|
3266
4027
|
## update_webhook
|
|
3267
4028
|
|
|
3268
4029
|
> <Webhook> update_webhook(webhook_id, body)
|
|
@@ -3358,7 +4119,7 @@ end
|
|
|
3358
4119
|
api_instance = DocSpring::Client.new
|
|
3359
4120
|
document = File.new('/path/to/some/file') # File | The PDF.
|
|
3360
4121
|
opts = {
|
|
3361
|
-
wait: true, # Boolean | Wait until the PDF has been processed before responding. Default true on sync.api hosts.
|
|
4122
|
+
wait: true, # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
|
|
3362
4123
|
name: 'name_example', # String | The template's name.
|
|
3363
4124
|
description: 'description_example', # String | The template's description.
|
|
3364
4125
|
parent_folder_id: 'parent_folder_id_example', # String | The folder to put the template in. Left out, it's created at the root.
|
|
@@ -3401,7 +4162,7 @@ end
|
|
|
3401
4162
|
| Name | Type | Description | Notes |
|
|
3402
4163
|
| ---- | ---- | ----------- | ----- |
|
|
3403
4164
|
| **document** | **File** | The PDF. | |
|
|
3404
|
-
| **wait** | **Boolean** | Wait until the PDF has been processed before responding. Default true on sync.api hosts. | [optional] |
|
|
4165
|
+
| **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
|
|
3405
4166
|
| **name** | **String** | The template's name. | [optional] |
|
|
3406
4167
|
| **description** | **String** | The template's description. | [optional] |
|
|
3407
4168
|
| **parent_folder_id** | **String** | The folder to put the template in. Left out, it's created at the root. | [optional] |
|
|
@@ -3449,7 +4210,7 @@ api_instance = DocSpring::Client.new
|
|
|
3449
4210
|
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
3450
4211
|
document = File.new('/path/to/some/file') # File | The new PDF.
|
|
3451
4212
|
opts = {
|
|
3452
|
-
wait: true, # Boolean | Wait until the PDF has been processed before responding. Default true on sync.api hosts.
|
|
4213
|
+
wait: true, # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
|
|
3453
4214
|
reimport_fields: true # Boolean | Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields.
|
|
3454
4215
|
}
|
|
3455
4216
|
|
|
@@ -3486,7 +4247,7 @@ end
|
|
|
3486
4247
|
| ---- | ---- | ----------- | ----- |
|
|
3487
4248
|
| **template_id** | **String** | The template's ID. | |
|
|
3488
4249
|
| **document** | **File** | The new PDF. | |
|
|
3489
|
-
| **wait** | **Boolean** | Wait until the PDF has been processed before responding. Default true on sync.api hosts. | [optional] |
|
|
4250
|
+
| **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
|
|
3490
4251
|
| **reimport_fields** | **Boolean** | Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields. | [optional] |
|
|
3491
4252
|
|
|
3492
4253
|
### Return type
|
|
@@ -3502,3 +4263,79 @@ end
|
|
|
3502
4263
|
- **Content-Type**: multipart/form-data
|
|
3503
4264
|
- **Accept**: application/json
|
|
3504
4265
|
|
|
4266
|
+
|
|
4267
|
+
## validate_submission
|
|
4268
|
+
|
|
4269
|
+
> <SubmissionValidation> validate_submission(template_id, body, opts)
|
|
4270
|
+
|
|
4271
|
+
Check a submission without creating it
|
|
4272
|
+
|
|
4273
|
+
Checks a submission as creating it would (its data against the template's fields, its settings and signature requests) without saving it, generating anything or using credits. It doesn't check your account's credits. The response says whether the submission is valid, and if not, has the error that creating it would return.
|
|
4274
|
+
|
|
4275
|
+
### Examples
|
|
4276
|
+
|
|
4277
|
+
```ruby
|
|
4278
|
+
require 'time'
|
|
4279
|
+
require 'docspring'
|
|
4280
|
+
# setup authorization
|
|
4281
|
+
DocSpring.configure do |config|
|
|
4282
|
+
# Configure HTTP basic authorization: api_token_basic
|
|
4283
|
+
config.username = 'YOUR USERNAME'
|
|
4284
|
+
config.password = 'YOUR PASSWORD'
|
|
4285
|
+
end
|
|
4286
|
+
|
|
4287
|
+
api_instance = DocSpring::Client.new
|
|
4288
|
+
template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
|
|
4289
|
+
body = DocSpring::ValidateSubmissionRequest.new # ValidateSubmissionRequest | The submission's data and settings.
|
|
4290
|
+
opts = {
|
|
4291
|
+
version: 'latest' # String | The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
|
|
4292
|
+
}
|
|
4293
|
+
|
|
4294
|
+
begin
|
|
4295
|
+
# Check a submission without creating it
|
|
4296
|
+
result = api_instance.validate_submission(template_id, body, opts)
|
|
4297
|
+
p result
|
|
4298
|
+
rescue DocSpring::ApiError => e
|
|
4299
|
+
puts "Error when calling Client->validate_submission: #{e}"
|
|
4300
|
+
end
|
|
4301
|
+
```
|
|
4302
|
+
|
|
4303
|
+
#### Using the validate_submission_with_http_info variant
|
|
4304
|
+
|
|
4305
|
+
This returns an Array which contains the response data, status code and headers.
|
|
4306
|
+
|
|
4307
|
+
> <Array(<SubmissionValidation>, Integer, Hash)> validate_submission_with_http_info(template_id, body, opts)
|
|
4308
|
+
|
|
4309
|
+
```ruby
|
|
4310
|
+
begin
|
|
4311
|
+
# Check a submission without creating it
|
|
4312
|
+
data, status_code, headers = api_instance.validate_submission_with_http_info(template_id, body, opts)
|
|
4313
|
+
p status_code # => 2xx
|
|
4314
|
+
p headers # => { ... }
|
|
4315
|
+
p data # => <SubmissionValidation>
|
|
4316
|
+
rescue DocSpring::ApiError => e
|
|
4317
|
+
puts "Error when calling Client->validate_submission_with_http_info: #{e}"
|
|
4318
|
+
end
|
|
4319
|
+
```
|
|
4320
|
+
|
|
4321
|
+
### Parameters
|
|
4322
|
+
|
|
4323
|
+
| Name | Type | Description | Notes |
|
|
4324
|
+
| ---- | ---- | ----------- | ----- |
|
|
4325
|
+
| **template_id** | **String** | The template's ID. | |
|
|
4326
|
+
| **body** | [**ValidateSubmissionRequest**](ValidateSubmissionRequest.md) | The submission's data and settings. | |
|
|
4327
|
+
| **version** | **String** | The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published). | [optional] |
|
|
4328
|
+
|
|
4329
|
+
### Return type
|
|
4330
|
+
|
|
4331
|
+
[**SubmissionValidation**](SubmissionValidation.md)
|
|
4332
|
+
|
|
4333
|
+
### Authorization
|
|
4334
|
+
|
|
4335
|
+
[api_token_basic](../README.md#api_token_basic)
|
|
4336
|
+
|
|
4337
|
+
### HTTP request headers
|
|
4338
|
+
|
|
4339
|
+
- **Content-Type**: application/json
|
|
4340
|
+
- **Accept**: application/json
|
|
4341
|
+
|