docspring 4.0.0 → 4.1.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.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +84 -0
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +24 -0
  5. data/Gemfile.lock +2 -2
  6. data/README.md +10 -1
  7. data/docs/AddTemplateFieldsRequest.md +18 -0
  8. data/docs/Client.md +704 -33
  9. data/docs/CreateSubmissionBatchRequest.md +2 -0
  10. data/docs/CreateSubmissionRequest.md +2 -0
  11. data/docs/CreateTemplateRequest.md +10 -2
  12. data/docs/Field.md +198 -0
  13. data/docs/FieldDependency.md +22 -0
  14. data/docs/FieldDependencyInput.md +22 -0
  15. data/docs/FieldGroup.md +32 -0
  16. data/docs/FieldGroupInput.md +30 -0
  17. data/docs/FieldGroupType.md +15 -0
  18. data/docs/FieldInput.md +196 -0
  19. data/docs/FieldType.md +15 -0
  20. data/docs/GenerateFilesFormat.md +15 -0
  21. data/docs/GenerateSubmissionFilesRequest.md +18 -0
  22. data/docs/OutputFormat.md +15 -0
  23. data/docs/PageImage.md +34 -0
  24. data/docs/PageImages.md +24 -0
  25. data/docs/PredefinedField.md +30 -0
  26. data/docs/PredefinedFieldInput.md +30 -0
  27. data/docs/RemoveTemplateFieldsRequest.md +18 -0
  28. data/docs/ReorderTemplateFieldsRequest.md +18 -0
  29. data/docs/Submission.md +3 -1
  30. data/docs/SubmissionFiles.md +3 -1
  31. data/docs/SubmissionInput.md +2 -0
  32. data/docs/SubmissionValidation.md +24 -0
  33. data/docs/Template.md +6 -0
  34. data/docs/TemplateDiff.md +30 -0
  35. data/docs/TemplateDiffSummary.md +28 -0
  36. data/docs/TemplateDocument.md +3 -3
  37. data/docs/TemplateFieldChange.md +24 -0
  38. data/docs/TemplateFieldChanges.md +24 -0
  39. data/docs/TemplateFieldDependency.md +1 -1
  40. data/docs/TemplateFieldDependencyInput.md +1 -1
  41. data/docs/TemplateFieldMove.md +22 -0
  42. data/docs/TemplateFields.md +22 -0
  43. data/docs/TemplatePageImages.md +24 -0
  44. data/docs/UpdateTemplateDocumentRequest.md +6 -2
  45. data/docs/UpdateTemplateFieldsRequest.md +18 -0
  46. data/docs/UpdateTemplateRequest.md +6 -0
  47. data/docs/ValidateSubmissionRequest.md +38 -0
  48. data/lib/docspring/api/client.rb +666 -18
  49. data/lib/docspring/api_client.rb +1 -1
  50. data/lib/docspring/models/add_template_fields_request.rb +187 -0
  51. data/lib/docspring/models/create_submission_batch_request.rb +23 -1
  52. data/lib/docspring/models/create_submission_request.rb +23 -1
  53. data/lib/docspring/models/create_template_request.rb +48 -3
  54. data/lib/docspring/models/field.rb +2217 -0
  55. data/lib/docspring/models/field_dependency.rb +246 -0
  56. data/lib/docspring/models/field_dependency_input.rb +246 -0
  57. data/lib/docspring/models/field_group.rb +368 -0
  58. data/lib/docspring/models/field_group_input.rb +247 -0
  59. data/lib/docspring/models/field_group_type.rb +41 -0
  60. data/lib/docspring/models/field_input.rb +1109 -0
  61. data/lib/docspring/models/field_type.rb +54 -0
  62. data/lib/docspring/models/generate_files_format.rb +40 -0
  63. data/lib/docspring/models/generate_submission_files_request.rb +187 -0
  64. data/lib/docspring/models/output_format.rb +41 -0
  65. data/lib/docspring/models/page_image.rb +359 -0
  66. data/lib/docspring/models/page_images.rb +248 -0
  67. data/lib/docspring/models/predefined_field.rb +287 -0
  68. data/lib/docspring/models/predefined_field_input.rb +287 -0
  69. data/lib/docspring/models/remove_template_fields_request.rb +187 -0
  70. data/lib/docspring/models/reorder_template_fields_request.rb +187 -0
  71. data/lib/docspring/models/submission.rb +31 -2
  72. data/lib/docspring/models/submission_files.rb +13 -4
  73. data/lib/docspring/models/submission_input.rb +23 -1
  74. data/lib/docspring/models/submission_validation.rb +234 -0
  75. data/lib/docspring/models/template.rb +74 -1
  76. data/lib/docspring/models/template_diff.rb +321 -0
  77. data/lib/docspring/models/template_diff_summary.rb +320 -0
  78. data/lib/docspring/models/template_document.rb +3 -3
  79. data/lib/docspring/models/template_document_state.rb +3 -1
  80. data/lib/docspring/models/template_field_change.rb +266 -0
  81. data/lib/docspring/models/template_field_changes.rb +274 -0
  82. data/lib/docspring/models/template_field_dependency.rb +1 -1
  83. data/lib/docspring/models/template_field_dependency_input.rb +1 -1
  84. data/lib/docspring/models/template_field_move.rb +239 -0
  85. data/lib/docspring/models/template_fields.rb +227 -0
  86. data/lib/docspring/models/template_page_images.rb +254 -0
  87. data/lib/docspring/models/update_template_document_request.rb +23 -20
  88. data/lib/docspring/models/update_template_fields_request.rb +187 -0
  89. data/lib/docspring/models/update_template_request.rb +38 -1
  90. data/lib/docspring/models/validate_submission_request.rb +288 -0
  91. data/lib/docspring/request_schemas.json +3364 -1584
  92. data/lib/docspring/version.rb +1 -1
  93. data/lib/docspring.rb +28 -0
  94. data/spec/api/client_spec.rb +128 -9
  95. data/spec/models/add_template_fields_request_spec.rb +36 -0
  96. data/spec/models/create_submission_batch_request_spec.rb +6 -0
  97. data/spec/models/create_submission_request_spec.rb +6 -0
  98. data/spec/models/create_template_request_spec.rb +24 -0
  99. data/spec/models/field_dependency_input_spec.rb +48 -0
  100. data/spec/models/field_dependency_spec.rb +48 -0
  101. data/spec/models/field_group_input_spec.rb +72 -0
  102. data/spec/models/field_group_spec.rb +78 -0
  103. data/spec/models/field_group_type_spec.rb +30 -0
  104. data/spec/models/field_input_spec.rb +570 -0
  105. data/spec/models/field_spec.rb +576 -0
  106. data/spec/models/field_type_spec.rb +30 -0
  107. data/spec/models/generate_files_format_spec.rb +30 -0
  108. data/spec/models/generate_submission_files_request_spec.rb +36 -0
  109. data/spec/models/output_format_spec.rb +30 -0
  110. data/spec/models/page_image_spec.rb +84 -0
  111. data/spec/models/page_images_spec.rb +54 -0
  112. data/spec/models/predefined_field_input_spec.rb +72 -0
  113. data/spec/models/predefined_field_spec.rb +72 -0
  114. data/spec/models/remove_template_fields_request_spec.rb +36 -0
  115. data/spec/models/reorder_template_fields_request_spec.rb +36 -0
  116. data/spec/models/submission_files_spec.rb +6 -0
  117. data/spec/models/submission_input_spec.rb +6 -0
  118. data/spec/models/submission_spec.rb +6 -0
  119. data/spec/models/submission_validation_spec.rb +54 -0
  120. data/spec/models/template_diff_spec.rb +72 -0
  121. data/spec/models/template_diff_summary_spec.rb +66 -0
  122. data/spec/models/template_field_change_spec.rb +54 -0
  123. data/spec/models/template_field_changes_spec.rb +54 -0
  124. data/spec/models/template_field_move_spec.rb +48 -0
  125. data/spec/models/template_fields_spec.rb +48 -0
  126. data/spec/models/template_page_images_spec.rb +54 -0
  127. data/spec/models/template_spec.rb +18 -0
  128. data/spec/models/update_template_document_request_spec.rb +12 -0
  129. data/spec/models/update_template_fields_request_spec.rb +36 -0
  130. data/spec/models/update_template_request_spec.rb +18 -0
  131. data/spec/models/validate_submission_request_spec.rb +96 -0
  132. metadata +113 -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 |
@@ -20,6 +21,7 @@ All URIs are relative to *https://sync.api.docspring.com/api/v2*
20
21
  | [**delete_webhook**](Client.md#delete_webhook) | **DELETE** /webhooks/{webhook_id} | Delete a webhook |
21
22
  | [**expire_combined_pdf**](Client.md#expire_combined_pdf) | **DELETE** /combined_pdfs/{combined_pdf_id} | Expire a combined PDF |
22
23
  | [**expire_submission**](Client.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a submission |
24
+ | [**generate_submission_files**](Client.md#generate_submission_files) | **POST** /submissions/{submission_id}/generate_files | Generate more files |
23
25
  | [**generate_submission_preview**](Client.md#generate_submission_preview) | **POST** /submissions/{submission_id}/generate_preview | Generate a preview PDF |
24
26
  | [**get_combined_pdf**](Client.md#get_combined_pdf) | **GET** /combined_pdfs/{combined_pdf_id} | Get a combined PDF |
25
27
  | [**get_custom_file**](Client.md#get_custom_file) | **GET** /custom_files/{custom_file_id} | Get a custom file |
@@ -29,28 +31,107 @@ All URIs are relative to *https://sync.api.docspring.com/api/v2*
29
31
  | [**get_submission**](Client.md#get_submission) | **GET** /submissions/{submission_id} | Get a submission |
30
32
  | [**get_submission_batch**](Client.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Get a batch |
31
33
  | [**get_template**](Client.md#get_template) | **GET** /templates/{template_id} | Get a template |
34
+ | [**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
35
  | [**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 |
36
+ | [**get_template_page_images**](Client.md#get_template_page_images) | **GET** /templates/{template_id}/page_images | Get images of a template's pages |
33
37
  | [**get_template_schema**](Client.md#get_template_schema) | **GET** /templates/{template_id}/schema | Get the JSON Schema of a template's submission data |
34
38
  | [**get_webhook**](Client.md#get_webhook) | **GET** /webhooks/{webhook_id} | Get a webhook |
35
39
  | [**list_combined_pdfs**](Client.md#list_combined_pdfs) | **GET** /combined_pdfs | List combined PDFs |
36
40
  | [**list_custom_files**](Client.md#list_custom_files) | **GET** /custom_files | List custom files |
37
41
  | [**list_folders**](Client.md#list_folders) | **GET** /folders | List folders |
38
42
  | [**list_submissions**](Client.md#list_submissions) | **GET** /submissions | List submissions |
43
+ | [**list_template_fields**](Client.md#list_template_fields) | **GET** /templates/{template_id}/fields | List a template's fields |
39
44
  | [**list_template_submissions**](Client.md#list_template_submissions) | **GET** /templates/{template_id}/submissions | List a template's submissions |
40
45
  | [**list_templates**](Client.md#list_templates) | **GET** /templates | List templates |
41
46
  | [**list_webhooks**](Client.md#list_webhooks) | **GET** /webhooks | List webhooks |
42
47
  | [**move_folder**](Client.md#move_folder) | **POST** /folders/{folder_id}/move | Move a folder |
43
48
  | [**move_template**](Client.md#move_template) | **POST** /templates/{template_id}/move | Move a template to a folder |
44
49
  | [**publish_template_version**](Client.md#publish_template_version) | **POST** /templates/{template_id}/publish_version | Publish a template version |
50
+ | [**remove_template_fields**](Client.md#remove_template_fields) | **POST** /templates/{template_id}/fields/remove | Remove fields from a template |
45
51
  | [**rename_folder**](Client.md#rename_folder) | **POST** /folders/{folder_id}/rename | Rename a folder |
52
+ | [**reorder_template_fields**](Client.md#reorder_template_fields) | **POST** /templates/{template_id}/fields/reorder | Reorder a template's fields |
46
53
  | [**restore_template_version**](Client.md#restore_template_version) | **POST** /templates/{template_id}/restore_version | Restore a template version |
47
54
  | [**test_authentication**](Client.md#test_authentication) | **GET** /authentication | Test authentication |
48
55
  | [**update_signature_request**](Client.md#update_signature_request) | **PUT** /signature_requests/{signature_request_id} | Update a signature request |
49
56
  | [**update_template**](Client.md#update_template) | **PUT** /templates/{template_id} | Update a template |
50
57
  | [**update_template_document**](Client.md#update_template_document) | **PUT** /templates/{template_id}/document | Replace a template's PDF |
58
+ | [**update_template_fields**](Client.md#update_template_fields) | **PUT** /templates/{template_id}/fields | Update a template's fields |
51
59
  | [**update_webhook**](Client.md#update_webhook) | **PUT** /webhooks/{webhook_id} | Update a webhook |
52
60
  | [**upload_template**](Client.md#upload_template) | **POST** /templates/upload | Create a PDF template from an uploaded PDF |
53
61
  | [**upload_template_document**](Client.md#upload_template_document) | **PUT** /templates/{template_id}/document/upload | Replace a template's PDF with an uploaded PDF |
62
+ | [**validate_submission**](Client.md#validate_submission) | **POST** /templates/{template_id}/submissions/validate | Check a submission without creating it |
63
+
64
+
65
+ ## add_template_fields
66
+
67
+ > <TemplateFields> add_template_fields(template_id, body)
68
+
69
+ Add fields to a template
70
+
71
+ Adds fields to a template's draft and returns all of its fields. Publish a version for submissions of published versions to have them.
72
+
73
+ ### Examples
74
+
75
+ ```ruby
76
+ require 'time'
77
+ require 'docspring'
78
+ # setup authorization
79
+ DocSpring.configure do |config|
80
+ # Configure HTTP basic authorization: api_token_basic
81
+ config.username = 'YOUR USERNAME'
82
+ config.password = 'YOUR PASSWORD'
83
+ end
84
+
85
+ api_instance = DocSpring::Client.new
86
+ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
87
+ body = DocSpring::AddTemplateFieldsRequest.new({fields: [DocSpring::FieldInput.new]}) # AddTemplateFieldsRequest | The fields to add to the template's draft.
88
+
89
+ begin
90
+ # Add fields to a template
91
+ result = api_instance.add_template_fields(template_id, body)
92
+ p result
93
+ rescue DocSpring::ApiError => e
94
+ puts "Error when calling Client->add_template_fields: #{e}"
95
+ end
96
+ ```
97
+
98
+ #### Using the add_template_fields_with_http_info variant
99
+
100
+ This returns an Array which contains the response data, status code and headers.
101
+
102
+ > <Array(<TemplateFields>, Integer, Hash)> add_template_fields_with_http_info(template_id, body)
103
+
104
+ ```ruby
105
+ begin
106
+ # Add fields to a template
107
+ data, status_code, headers = api_instance.add_template_fields_with_http_info(template_id, body)
108
+ p status_code # => 2xx
109
+ p headers # => { ... }
110
+ p data # => <TemplateFields>
111
+ rescue DocSpring::ApiError => e
112
+ puts "Error when calling Client->add_template_fields_with_http_info: #{e}"
113
+ end
114
+ ```
115
+
116
+ ### Parameters
117
+
118
+ | Name | Type | Description | Notes |
119
+ | ---- | ---- | ----------- | ----- |
120
+ | **template_id** | **String** | The template's ID. | |
121
+ | **body** | [**AddTemplateFieldsRequest**](AddTemplateFieldsRequest.md) | The fields to add to the template's draft. | |
122
+
123
+ ### Return type
124
+
125
+ [**TemplateFields**](TemplateFields.md)
126
+
127
+ ### Authorization
128
+
129
+ [api_token_basic](../README.md#api_token_basic)
130
+
131
+ ### HTTP request headers
132
+
133
+ - **Content-Type**: application/json
134
+ - **Accept**: application/json
54
135
 
55
136
 
56
137
  ## copy_template
@@ -512,7 +593,7 @@ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
512
593
  body = DocSpring::CreateSubmissionRequest.new # CreateSubmissionRequest | The submission's data and settings.
513
594
  opts = {
514
595
  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 PDF has been generated before responding. Default true on sync.api hosts.
596
+ wait: true # Boolean | Wait until the files have been generated before responding. Default true on sync.api hosts.
516
597
  }
517
598
 
518
599
  begin
@@ -549,7 +630,7 @@ end
549
630
  | **template_id** | **String** | The template's ID. | |
550
631
  | **body** | [**CreateSubmissionRequest**](CreateSubmissionRequest.md) | The submission's data and settings. | |
551
632
  | **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 PDF has been generated before responding. Default true on sync.api hosts. | [optional] |
633
+ | **wait** | **Boolean** | Wait until the files have been generated before responding. Default true on sync.api hosts. | [optional] |
553
634
 
554
635
  ### Return type
555
636
 
@@ -662,7 +743,7 @@ end
662
743
  api_instance = DocSpring::Client.new
663
744
  body = DocSpring::CreateTemplateRequest.new({template_type: DocSpring::TemplateType::PDF}) # CreateTemplateRequest | The template to create.
664
745
  opts = {
665
- wait: true # Boolean | Wait until the PDF has been processed before responding. Default true on sync.api hosts.
746
+ wait: true # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
666
747
  }
667
748
 
668
749
  begin
@@ -697,7 +778,7 @@ end
697
778
  | Name | Type | Description | Notes |
698
779
  | ---- | ---- | ----------- | ----- |
699
780
  | **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] |
781
+ | **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
701
782
 
702
783
  ### Return type
703
784
 
@@ -1207,6 +1288,82 @@ end
1207
1288
  - **Accept**: application/json
1208
1289
 
1209
1290
 
1291
+ ## generate_submission_files
1292
+
1293
+ > <Submission> generate_submission_files(submission_id, body, opts)
1294
+
1295
+ Generate more files
1296
+
1297
+ 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.
1298
+
1299
+ ### Examples
1300
+
1301
+ ```ruby
1302
+ require 'time'
1303
+ require 'docspring'
1304
+ # setup authorization
1305
+ DocSpring.configure do |config|
1306
+ # Configure HTTP basic authorization: api_token_basic
1307
+ config.username = 'YOUR USERNAME'
1308
+ config.password = 'YOUR PASSWORD'
1309
+ end
1310
+
1311
+ api_instance = DocSpring::Client.new
1312
+ submission_id = 'sub_1234567890abcdef01' # String | The submission's ID.
1313
+ body = DocSpring::GenerateSubmissionFilesRequest.new({formats: [DocSpring::GenerateFilesFormat::PNG]}) # GenerateSubmissionFilesRequest | The formats to make.
1314
+ opts = {
1315
+ wait: true # Boolean | Wait until the files have been generated before responding. Default true on sync.api hosts.
1316
+ }
1317
+
1318
+ begin
1319
+ # Generate more files
1320
+ result = api_instance.generate_submission_files(submission_id, body, opts)
1321
+ p result
1322
+ rescue DocSpring::ApiError => e
1323
+ puts "Error when calling Client->generate_submission_files: #{e}"
1324
+ end
1325
+ ```
1326
+
1327
+ #### Using the generate_submission_files_with_http_info variant
1328
+
1329
+ This returns an Array which contains the response data, status code and headers.
1330
+
1331
+ > <Array(<Submission>, Integer, Hash)> generate_submission_files_with_http_info(submission_id, body, opts)
1332
+
1333
+ ```ruby
1334
+ begin
1335
+ # Generate more files
1336
+ data, status_code, headers = api_instance.generate_submission_files_with_http_info(submission_id, body, opts)
1337
+ p status_code # => 2xx
1338
+ p headers # => { ... }
1339
+ p data # => <Submission>
1340
+ rescue DocSpring::ApiError => e
1341
+ puts "Error when calling Client->generate_submission_files_with_http_info: #{e}"
1342
+ end
1343
+ ```
1344
+
1345
+ ### Parameters
1346
+
1347
+ | Name | Type | Description | Notes |
1348
+ | ---- | ---- | ----------- | ----- |
1349
+ | **submission_id** | **String** | The submission's ID. | |
1350
+ | **body** | [**GenerateSubmissionFilesRequest**](GenerateSubmissionFilesRequest.md) | The formats to make. | |
1351
+ | **wait** | **Boolean** | Wait until the files have been generated before responding. Default true on sync.api hosts. | [optional] |
1352
+
1353
+ ### Return type
1354
+
1355
+ [**Submission**](Submission.md)
1356
+
1357
+ ### Authorization
1358
+
1359
+ [api_token_basic](../README.md#api_token_basic)
1360
+
1361
+ ### HTTP request headers
1362
+
1363
+ - **Content-Type**: application/json
1364
+ - **Accept**: application/json
1365
+
1366
+
1210
1367
  ## generate_submission_preview
1211
1368
 
1212
1369
  > <Submission> generate_submission_preview(submission_id)
@@ -1842,6 +1999,80 @@ end
1842
1999
  - **Accept**: application/json
1843
2000
 
1844
2001
 
2002
+ ## get_template_diff
2003
+
2004
+ > <TemplateDiff> get_template_diff(template_id, opts)
2005
+
2006
+ Compare a version of a template with the one before it
2007
+
2008
+ 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.
2009
+
2010
+ ### Examples
2011
+
2012
+ ```ruby
2013
+ require 'time'
2014
+ require 'docspring'
2015
+ # setup authorization
2016
+ DocSpring.configure do |config|
2017
+ # Configure HTTP basic authorization: api_token_basic
2018
+ config.username = 'YOUR USERNAME'
2019
+ config.password = 'YOUR PASSWORD'
2020
+ end
2021
+
2022
+ api_instance = DocSpring::Client.new
2023
+ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
2024
+ opts = {
2025
+ version: '0.1.0' # String | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
2026
+ }
2027
+
2028
+ begin
2029
+ # Compare a version of a template with the one before it
2030
+ result = api_instance.get_template_diff(template_id, opts)
2031
+ p result
2032
+ rescue DocSpring::ApiError => e
2033
+ puts "Error when calling Client->get_template_diff: #{e}"
2034
+ end
2035
+ ```
2036
+
2037
+ #### Using the get_template_diff_with_http_info variant
2038
+
2039
+ This returns an Array which contains the response data, status code and headers.
2040
+
2041
+ > <Array(<TemplateDiff>, Integer, Hash)> get_template_diff_with_http_info(template_id, opts)
2042
+
2043
+ ```ruby
2044
+ begin
2045
+ # Compare a version of a template with the one before it
2046
+ data, status_code, headers = api_instance.get_template_diff_with_http_info(template_id, opts)
2047
+ p status_code # => 2xx
2048
+ p headers # => { ... }
2049
+ p data # => <TemplateDiff>
2050
+ rescue DocSpring::ApiError => e
2051
+ puts "Error when calling Client->get_template_diff_with_http_info: #{e}"
2052
+ end
2053
+ ```
2054
+
2055
+ ### Parameters
2056
+
2057
+ | Name | Type | Description | Notes |
2058
+ | ---- | ---- | ----------- | ----- |
2059
+ | **template_id** | **String** | The template's ID. | |
2060
+ | **version** | **String** | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`. | [optional] |
2061
+
2062
+ ### Return type
2063
+
2064
+ [**TemplateDiff**](TemplateDiff.md)
2065
+
2066
+ ### Authorization
2067
+
2068
+ [api_token_basic](../README.md#api_token_basic)
2069
+
2070
+ ### HTTP request headers
2071
+
2072
+ - **Content-Type**: Not defined
2073
+ - **Accept**: application/json
2074
+
2075
+
1845
2076
  ## get_template_model_code
1846
2077
 
1847
2078
  > <TemplateModelCode> get_template_model_code(template_id, lang, opts)
@@ -1918,6 +2149,80 @@ end
1918
2149
  - **Accept**: application/json
1919
2150
 
1920
2151
 
2152
+ ## get_template_page_images
2153
+
2154
+ > <TemplatePageImages> get_template_page_images(template_id, opts)
2155
+
2156
+ Get images of a template's pages
2157
+
2158
+ 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.
2159
+
2160
+ ### Examples
2161
+
2162
+ ```ruby
2163
+ require 'time'
2164
+ require 'docspring'
2165
+ # setup authorization
2166
+ DocSpring.configure do |config|
2167
+ # Configure HTTP basic authorization: api_token_basic
2168
+ config.username = 'YOUR USERNAME'
2169
+ config.password = 'YOUR PASSWORD'
2170
+ end
2171
+
2172
+ api_instance = DocSpring::Client.new
2173
+ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
2174
+ opts = {
2175
+ version: 'latest' # String | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
2176
+ }
2177
+
2178
+ begin
2179
+ # Get images of a template's pages
2180
+ result = api_instance.get_template_page_images(template_id, opts)
2181
+ p result
2182
+ rescue DocSpring::ApiError => e
2183
+ puts "Error when calling Client->get_template_page_images: #{e}"
2184
+ end
2185
+ ```
2186
+
2187
+ #### Using the get_template_page_images_with_http_info variant
2188
+
2189
+ This returns an Array which contains the response data, status code and headers.
2190
+
2191
+ > <Array(<TemplatePageImages>, Integer, Hash)> get_template_page_images_with_http_info(template_id, opts)
2192
+
2193
+ ```ruby
2194
+ begin
2195
+ # Get images of a template's pages
2196
+ data, status_code, headers = api_instance.get_template_page_images_with_http_info(template_id, opts)
2197
+ p status_code # => 2xx
2198
+ p headers # => { ... }
2199
+ p data # => <TemplatePageImages>
2200
+ rescue DocSpring::ApiError => e
2201
+ puts "Error when calling Client->get_template_page_images_with_http_info: #{e}"
2202
+ end
2203
+ ```
2204
+
2205
+ ### Parameters
2206
+
2207
+ | Name | Type | Description | Notes |
2208
+ | ---- | ---- | ----------- | ----- |
2209
+ | **template_id** | **String** | The template's ID. | |
2210
+ | **version** | **String** | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`. | [optional] |
2211
+
2212
+ ### Return type
2213
+
2214
+ [**TemplatePageImages**](TemplatePageImages.md)
2215
+
2216
+ ### Authorization
2217
+
2218
+ [api_token_basic](../README.md#api_token_basic)
2219
+
2220
+ ### HTTP request headers
2221
+
2222
+ - **Content-Type**: Not defined
2223
+ - **Accept**: application/json
2224
+
2225
+
1921
2226
  ## get_template_schema
1922
2227
 
1923
2228
  > Hash&lt;String, Object&gt; get_template_schema(template_id, opts)
@@ -2370,13 +2675,13 @@ end
2370
2675
  - **Accept**: application/json
2371
2676
 
2372
2677
 
2373
- ## list_template_submissions
2678
+ ## list_template_fields
2374
2679
 
2375
- > <SubmissionList> list_template_submissions(template_id, opts)
2680
+ > <TemplateFields> list_template_fields(template_id, opts)
2376
2681
 
2377
- List a template's submissions
2682
+ List a template's fields
2378
2683
 
2379
- Returns a template's submissions (from every version of the template), newest first.
2684
+ 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.
2380
2685
 
2381
2686
  ### Examples
2382
2687
 
@@ -2393,36 +2698,110 @@ end
2393
2698
  api_instance = DocSpring::Client.new
2394
2699
  template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
2395
2700
  opts = {
2396
- test: true, # Boolean | Only list test submissions (true) or live submissions (false).
2397
- created_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Only list submissions created after this time (RFC 3339, such as `2025-01-31T09:00:00Z`).
2398
- created_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Only list submissions created before this time.
2399
- include_data: true, # Boolean | Include each submission's `data` (null without it).
2400
- 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.
2701
+ version: 'latest' # String | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
2402
2702
  }
2403
2703
 
2404
2704
  begin
2405
- # List a template's submissions
2406
- result = api_instance.list_template_submissions(template_id, opts)
2705
+ # List a template's fields
2706
+ result = api_instance.list_template_fields(template_id, opts)
2407
2707
  p result
2408
2708
  rescue DocSpring::ApiError => e
2409
- puts "Error when calling Client->list_template_submissions: #{e}"
2709
+ puts "Error when calling Client->list_template_fields: #{e}"
2410
2710
  end
2411
2711
  ```
2412
2712
 
2413
- #### Using the list_template_submissions_with_http_info variant
2713
+ #### Using the list_template_fields_with_http_info variant
2414
2714
 
2415
2715
  This returns an Array which contains the response data, status code and headers.
2416
2716
 
2417
- > <Array(<SubmissionList>, Integer, Hash)> list_template_submissions_with_http_info(template_id, opts)
2717
+ > <Array(<TemplateFields>, Integer, Hash)> list_template_fields_with_http_info(template_id, opts)
2418
2718
 
2419
2719
  ```ruby
2420
2720
  begin
2421
- # List a template's submissions
2422
- data, status_code, headers = api_instance.list_template_submissions_with_http_info(template_id, opts)
2721
+ # List a template's fields
2722
+ data, status_code, headers = api_instance.list_template_fields_with_http_info(template_id, opts)
2423
2723
  p status_code # => 2xx
2424
2724
  p headers # => { ... }
2425
- p data # => <SubmissionList>
2725
+ p data # => <TemplateFields>
2726
+ rescue DocSpring::ApiError => e
2727
+ puts "Error when calling Client->list_template_fields_with_http_info: #{e}"
2728
+ end
2729
+ ```
2730
+
2731
+ ### Parameters
2732
+
2733
+ | Name | Type | Description | Notes |
2734
+ | ---- | ---- | ----------- | ----- |
2735
+ | **template_id** | **String** | The template's ID. | |
2736
+ | **version** | **String** | A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`. | [optional] |
2737
+
2738
+ ### Return type
2739
+
2740
+ [**TemplateFields**](TemplateFields.md)
2741
+
2742
+ ### Authorization
2743
+
2744
+ [api_token_basic](../README.md#api_token_basic)
2745
+
2746
+ ### HTTP request headers
2747
+
2748
+ - **Content-Type**: Not defined
2749
+ - **Accept**: application/json
2750
+
2751
+
2752
+ ## list_template_submissions
2753
+
2754
+ > <SubmissionList> list_template_submissions(template_id, opts)
2755
+
2756
+ List a template's submissions
2757
+
2758
+ Returns a template's submissions (from every version of the template), newest first.
2759
+
2760
+ ### Examples
2761
+
2762
+ ```ruby
2763
+ require 'time'
2764
+ require 'docspring'
2765
+ # setup authorization
2766
+ DocSpring.configure do |config|
2767
+ # Configure HTTP basic authorization: api_token_basic
2768
+ config.username = 'YOUR USERNAME'
2769
+ config.password = 'YOUR PASSWORD'
2770
+ end
2771
+
2772
+ api_instance = DocSpring::Client.new
2773
+ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
2774
+ opts = {
2775
+ test: true, # Boolean | Only list test submissions (true) or live submissions (false).
2776
+ created_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Only list submissions created after this time (RFC 3339, such as `2025-01-31T09:00:00Z`).
2777
+ created_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Only list submissions created before this time.
2778
+ include_data: true, # Boolean | Include each submission's `data` (null without it).
2779
+ limit: 56, # Integer | How many items to return (1-100, default 50).
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
+ }
2782
+
2783
+ begin
2784
+ # List a template's submissions
2785
+ result = api_instance.list_template_submissions(template_id, opts)
2786
+ p result
2787
+ rescue DocSpring::ApiError => e
2788
+ puts "Error when calling Client->list_template_submissions: #{e}"
2789
+ end
2790
+ ```
2791
+
2792
+ #### Using the list_template_submissions_with_http_info variant
2793
+
2794
+ This returns an Array which contains the response data, status code and headers.
2795
+
2796
+ > <Array(<SubmissionList>, Integer, Hash)> list_template_submissions_with_http_info(template_id, opts)
2797
+
2798
+ ```ruby
2799
+ begin
2800
+ # List a template's submissions
2801
+ data, status_code, headers = api_instance.list_template_submissions_with_http_info(template_id, opts)
2802
+ p status_code # => 2xx
2803
+ p headers # => { ... }
2804
+ p data # => <SubmissionList>
2426
2805
  rescue DocSpring::ApiError => e
2427
2806
  puts "Error when calling Client->list_template_submissions_with_http_info: #{e}"
2428
2807
  end
@@ -2766,7 +3145,7 @@ end
2766
3145
 
2767
3146
  Publish a template version
2768
3147
 
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.
3148
+ 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
3149
 
2771
3150
  ### Examples
2772
3151
 
@@ -2832,6 +3211,78 @@ end
2832
3211
  - **Accept**: application/json
2833
3212
 
2834
3213
 
3214
+ ## remove_template_fields
3215
+
3216
+ > <TemplateFields> remove_template_fields(template_id, body)
3217
+
3218
+ Remove fields from a template
3219
+
3220
+ 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.
3221
+
3222
+ ### Examples
3223
+
3224
+ ```ruby
3225
+ require 'time'
3226
+ require 'docspring'
3227
+ # setup authorization
3228
+ DocSpring.configure do |config|
3229
+ # Configure HTTP basic authorization: api_token_basic
3230
+ config.username = 'YOUR USERNAME'
3231
+ config.password = 'YOUR PASSWORD'
3232
+ end
3233
+
3234
+ api_instance = DocSpring::Client.new
3235
+ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
3236
+ body = DocSpring::RemoveTemplateFieldsRequest.new({field_ids: [37]}) # RemoveTemplateFieldsRequest | The fields to remove from the template's draft.
3237
+
3238
+ begin
3239
+ # Remove fields from a template
3240
+ result = api_instance.remove_template_fields(template_id, body)
3241
+ p result
3242
+ rescue DocSpring::ApiError => e
3243
+ puts "Error when calling Client->remove_template_fields: #{e}"
3244
+ end
3245
+ ```
3246
+
3247
+ #### Using the remove_template_fields_with_http_info variant
3248
+
3249
+ This returns an Array which contains the response data, status code and headers.
3250
+
3251
+ > <Array(<TemplateFields>, Integer, Hash)> remove_template_fields_with_http_info(template_id, body)
3252
+
3253
+ ```ruby
3254
+ begin
3255
+ # Remove fields from a template
3256
+ data, status_code, headers = api_instance.remove_template_fields_with_http_info(template_id, body)
3257
+ p status_code # => 2xx
3258
+ p headers # => { ... }
3259
+ p data # => <TemplateFields>
3260
+ rescue DocSpring::ApiError => e
3261
+ puts "Error when calling Client->remove_template_fields_with_http_info: #{e}"
3262
+ end
3263
+ ```
3264
+
3265
+ ### Parameters
3266
+
3267
+ | Name | Type | Description | Notes |
3268
+ | ---- | ---- | ----------- | ----- |
3269
+ | **template_id** | **String** | The template's ID. | |
3270
+ | **body** | [**RemoveTemplateFieldsRequest**](RemoveTemplateFieldsRequest.md) | The fields to remove from the template's draft. | |
3271
+
3272
+ ### Return type
3273
+
3274
+ [**TemplateFields**](TemplateFields.md)
3275
+
3276
+ ### Authorization
3277
+
3278
+ [api_token_basic](../README.md#api_token_basic)
3279
+
3280
+ ### HTTP request headers
3281
+
3282
+ - **Content-Type**: application/json
3283
+ - **Accept**: application/json
3284
+
3285
+
2835
3286
  ## rename_folder
2836
3287
 
2837
3288
  > <Folder> rename_folder(folder_id, body)
@@ -2904,6 +3355,78 @@ end
2904
3355
  - **Accept**: application/json
2905
3356
 
2906
3357
 
3358
+ ## reorder_template_fields
3359
+
3360
+ > <TemplateFields> reorder_template_fields(template_id, body)
3361
+
3362
+ Reorder a template's fields
3363
+
3364
+ 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.
3365
+
3366
+ ### Examples
3367
+
3368
+ ```ruby
3369
+ require 'time'
3370
+ require 'docspring'
3371
+ # setup authorization
3372
+ DocSpring.configure do |config|
3373
+ # Configure HTTP basic authorization: api_token_basic
3374
+ config.username = 'YOUR USERNAME'
3375
+ config.password = 'YOUR PASSWORD'
3376
+ end
3377
+
3378
+ api_instance = DocSpring::Client.new
3379
+ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
3380
+ body = DocSpring::ReorderTemplateFieldsRequest.new({field_ids: [37]}) # ReorderTemplateFieldsRequest | The new order of the fields in the template's draft.
3381
+
3382
+ begin
3383
+ # Reorder a template's fields
3384
+ result = api_instance.reorder_template_fields(template_id, body)
3385
+ p result
3386
+ rescue DocSpring::ApiError => e
3387
+ puts "Error when calling Client->reorder_template_fields: #{e}"
3388
+ end
3389
+ ```
3390
+
3391
+ #### Using the reorder_template_fields_with_http_info variant
3392
+
3393
+ This returns an Array which contains the response data, status code and headers.
3394
+
3395
+ > <Array(<TemplateFields>, Integer, Hash)> reorder_template_fields_with_http_info(template_id, body)
3396
+
3397
+ ```ruby
3398
+ begin
3399
+ # Reorder a template's fields
3400
+ data, status_code, headers = api_instance.reorder_template_fields_with_http_info(template_id, body)
3401
+ p status_code # => 2xx
3402
+ p headers # => { ... }
3403
+ p data # => <TemplateFields>
3404
+ rescue DocSpring::ApiError => e
3405
+ puts "Error when calling Client->reorder_template_fields_with_http_info: #{e}"
3406
+ end
3407
+ ```
3408
+
3409
+ ### Parameters
3410
+
3411
+ | Name | Type | Description | Notes |
3412
+ | ---- | ---- | ----------- | ----- |
3413
+ | **template_id** | **String** | The template's ID. | |
3414
+ | **body** | [**ReorderTemplateFieldsRequest**](ReorderTemplateFieldsRequest.md) | The new order of the fields in the template's draft. | |
3415
+
3416
+ ### Return type
3417
+
3418
+ [**TemplateFields**](TemplateFields.md)
3419
+
3420
+ ### Authorization
3421
+
3422
+ [api_token_basic](../README.md#api_token_basic)
3423
+
3424
+ ### HTTP request headers
3425
+
3426
+ - **Content-Type**: application/json
3427
+ - **Accept**: application/json
3428
+
3429
+
2907
3430
  ## restore_template_version
2908
3431
 
2909
3432
  > <Template> restore_template_version(template_id, body)
@@ -3121,7 +3644,7 @@ end
3121
3644
 
3122
3645
  Update a template
3123
3646
 
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.
3647
+ 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
3648
 
3126
3649
  ### Examples
3127
3650
 
@@ -3193,7 +3716,7 @@ end
3193
3716
 
3194
3717
  Replace a template's PDF
3195
3718
 
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 with the request instead, use PUT /templates/{template_id}/document/upload.
3719
+ 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
3720
 
3198
3721
  ### Examples
3199
3722
 
@@ -3209,9 +3732,9 @@ end
3209
3732
 
3210
3733
  api_instance = DocSpring::Client.new
3211
3734
  template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
3212
- body = DocSpring::UpdateTemplateDocumentRequest.new({cache_id: 'cache_id_example'}) # UpdateTemplateDocumentRequest | The new PDF.
3735
+ body = DocSpring::UpdateTemplateDocumentRequest.new # UpdateTemplateDocumentRequest | The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
3213
3736
  opts = {
3214
- wait: true # Boolean | Wait until the PDF has been processed before responding. Default true on sync.api hosts.
3737
+ wait: true # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
3215
3738
  }
3216
3739
 
3217
3740
  begin
@@ -3246,8 +3769,8 @@ end
3246
3769
  | Name | Type | Description | Notes |
3247
3770
  | ---- | ---- | ----------- | ----- |
3248
3771
  | **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] |
3772
+ | **body** | [**UpdateTemplateDocumentRequest**](UpdateTemplateDocumentRequest.md) | The new PDF, as one of `cache_id`, `document_url` and `document_base64`. | |
3773
+ | **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
3251
3774
 
3252
3775
  ### Return type
3253
3776
 
@@ -3263,6 +3786,78 @@ end
3263
3786
  - **Accept**: application/json
3264
3787
 
3265
3788
 
3789
+ ## update_template_fields
3790
+
3791
+ > <TemplateFields> update_template_fields(template_id, body)
3792
+
3793
+ Update a template's fields
3794
+
3795
+ 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.
3796
+
3797
+ ### Examples
3798
+
3799
+ ```ruby
3800
+ require 'time'
3801
+ require 'docspring'
3802
+ # setup authorization
3803
+ DocSpring.configure do |config|
3804
+ # Configure HTTP basic authorization: api_token_basic
3805
+ config.username = 'YOUR USERNAME'
3806
+ config.password = 'YOUR PASSWORD'
3807
+ end
3808
+
3809
+ api_instance = DocSpring::Client.new
3810
+ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
3811
+ body = DocSpring::UpdateTemplateFieldsRequest.new({fields: [DocSpring::FieldInput.new]}) # UpdateTemplateFieldsRequest | The fields to change in the template's draft.
3812
+
3813
+ begin
3814
+ # Update a template's fields
3815
+ result = api_instance.update_template_fields(template_id, body)
3816
+ p result
3817
+ rescue DocSpring::ApiError => e
3818
+ puts "Error when calling Client->update_template_fields: #{e}"
3819
+ end
3820
+ ```
3821
+
3822
+ #### Using the update_template_fields_with_http_info variant
3823
+
3824
+ This returns an Array which contains the response data, status code and headers.
3825
+
3826
+ > <Array(<TemplateFields>, Integer, Hash)> update_template_fields_with_http_info(template_id, body)
3827
+
3828
+ ```ruby
3829
+ begin
3830
+ # Update a template's fields
3831
+ data, status_code, headers = api_instance.update_template_fields_with_http_info(template_id, body)
3832
+ p status_code # => 2xx
3833
+ p headers # => { ... }
3834
+ p data # => <TemplateFields>
3835
+ rescue DocSpring::ApiError => e
3836
+ puts "Error when calling Client->update_template_fields_with_http_info: #{e}"
3837
+ end
3838
+ ```
3839
+
3840
+ ### Parameters
3841
+
3842
+ | Name | Type | Description | Notes |
3843
+ | ---- | ---- | ----------- | ----- |
3844
+ | **template_id** | **String** | The template's ID. | |
3845
+ | **body** | [**UpdateTemplateFieldsRequest**](UpdateTemplateFieldsRequest.md) | The fields to change in the template's draft. | |
3846
+
3847
+ ### Return type
3848
+
3849
+ [**TemplateFields**](TemplateFields.md)
3850
+
3851
+ ### Authorization
3852
+
3853
+ [api_token_basic](../README.md#api_token_basic)
3854
+
3855
+ ### HTTP request headers
3856
+
3857
+ - **Content-Type**: application/json
3858
+ - **Accept**: application/json
3859
+
3860
+
3266
3861
  ## update_webhook
3267
3862
 
3268
3863
  > <Webhook> update_webhook(webhook_id, body)
@@ -3358,7 +3953,7 @@ end
3358
3953
  api_instance = DocSpring::Client.new
3359
3954
  document = File.new('/path/to/some/file') # File | The PDF.
3360
3955
  opts = {
3361
- wait: true, # Boolean | Wait until the PDF has been processed before responding. Default true on sync.api hosts.
3956
+ wait: true, # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
3362
3957
  name: 'name_example', # String | The template's name.
3363
3958
  description: 'description_example', # String | The template's description.
3364
3959
  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 +3996,7 @@ end
3401
3996
  | Name | Type | Description | Notes |
3402
3997
  | ---- | ---- | ----------- | ----- |
3403
3998
  | **document** | **File** | The PDF. | |
3404
- | **wait** | **Boolean** | Wait until the PDF has been processed before responding. Default true on sync.api hosts. | [optional] |
3999
+ | **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
3405
4000
  | **name** | **String** | The template's name. | [optional] |
3406
4001
  | **description** | **String** | The template's description. | [optional] |
3407
4002
  | **parent_folder_id** | **String** | The folder to put the template in. Left out, it's created at the root. | [optional] |
@@ -3449,7 +4044,7 @@ api_instance = DocSpring::Client.new
3449
4044
  template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
3450
4045
  document = File.new('/path/to/some/file') # File | The new PDF.
3451
4046
  opts = {
3452
- wait: true, # Boolean | Wait until the PDF has been processed before responding. Default true on sync.api hosts.
4047
+ wait: true, # Boolean | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
3453
4048
  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
4049
  }
3455
4050
 
@@ -3486,7 +4081,7 @@ end
3486
4081
  | ---- | ---- | ----------- | ----- |
3487
4082
  | **template_id** | **String** | The template's ID. | |
3488
4083
  | **document** | **File** | The new PDF. | |
3489
- | **wait** | **Boolean** | Wait until the PDF has been processed before responding. Default true on sync.api hosts. | [optional] |
4084
+ | **wait** | **Boolean** | Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts. | [optional] |
3490
4085
  | **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
4086
 
3492
4087
  ### Return type
@@ -3502,3 +4097,79 @@ end
3502
4097
  - **Content-Type**: multipart/form-data
3503
4098
  - **Accept**: application/json
3504
4099
 
4100
+
4101
+ ## validate_submission
4102
+
4103
+ > <SubmissionValidation> validate_submission(template_id, body, opts)
4104
+
4105
+ Check a submission without creating it
4106
+
4107
+ 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.
4108
+
4109
+ ### Examples
4110
+
4111
+ ```ruby
4112
+ require 'time'
4113
+ require 'docspring'
4114
+ # setup authorization
4115
+ DocSpring.configure do |config|
4116
+ # Configure HTTP basic authorization: api_token_basic
4117
+ config.username = 'YOUR USERNAME'
4118
+ config.password = 'YOUR PASSWORD'
4119
+ end
4120
+
4121
+ api_instance = DocSpring::Client.new
4122
+ template_id = 'tpl_1234567890abcdef01' # String | The template's ID.
4123
+ body = DocSpring::ValidateSubmissionRequest.new # ValidateSubmissionRequest | The submission's data and settings.
4124
+ opts = {
4125
+ 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).
4126
+ }
4127
+
4128
+ begin
4129
+ # Check a submission without creating it
4130
+ result = api_instance.validate_submission(template_id, body, opts)
4131
+ p result
4132
+ rescue DocSpring::ApiError => e
4133
+ puts "Error when calling Client->validate_submission: #{e}"
4134
+ end
4135
+ ```
4136
+
4137
+ #### Using the validate_submission_with_http_info variant
4138
+
4139
+ This returns an Array which contains the response data, status code and headers.
4140
+
4141
+ > <Array(<SubmissionValidation>, Integer, Hash)> validate_submission_with_http_info(template_id, body, opts)
4142
+
4143
+ ```ruby
4144
+ begin
4145
+ # Check a submission without creating it
4146
+ data, status_code, headers = api_instance.validate_submission_with_http_info(template_id, body, opts)
4147
+ p status_code # => 2xx
4148
+ p headers # => { ... }
4149
+ p data # => <SubmissionValidation>
4150
+ rescue DocSpring::ApiError => e
4151
+ puts "Error when calling Client->validate_submission_with_http_info: #{e}"
4152
+ end
4153
+ ```
4154
+
4155
+ ### Parameters
4156
+
4157
+ | Name | Type | Description | Notes |
4158
+ | ---- | ---- | ----------- | ----- |
4159
+ | **template_id** | **String** | The template's ID. | |
4160
+ | **body** | [**ValidateSubmissionRequest**](ValidateSubmissionRequest.md) | The submission's data and settings. | |
4161
+ | **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] |
4162
+
4163
+ ### Return type
4164
+
4165
+ [**SubmissionValidation**](SubmissionValidation.md)
4166
+
4167
+ ### Authorization
4168
+
4169
+ [api_token_basic](../README.md#api_token_basic)
4170
+
4171
+ ### HTTP request headers
4172
+
4173
+ - **Content-Type**: application/json
4174
+ - **Accept**: application/json
4175
+