docspring 4.1.0 → 4.3.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 (372) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +15 -0
  3. data/.travis.yml +1 -1
  4. data/AGENTS.md +5 -4
  5. data/CHANGELOG.md +67 -0
  6. data/Gemfile.lock +11 -10
  7. data/README.md +11 -6
  8. data/docs/Client.md +273 -105
  9. data/docs/CombinedPdf.md +1 -1
  10. data/docs/CreateCombinedPdfRequest.md +1 -1
  11. data/docs/CreateSubmissionRequest.md +5 -5
  12. data/docs/CreateTemplatePreviewRequest.md +18 -0
  13. data/docs/CreateTemplateRequest.md +14 -10
  14. data/docs/ErrorDetail.md +1 -1
  15. data/docs/ErrorInfo.md +4 -4
  16. data/docs/FieldGroup.md +2 -2
  17. data/docs/FieldGroupInput.md +1 -1
  18. data/docs/GenerateSubmissionFilesRequest.md +1 -1
  19. data/docs/GeneratedFile.md +2 -2
  20. data/docs/Submission.md +18 -18
  21. data/docs/SubmissionBatch.md +3 -3
  22. data/docs/SubmissionFiles.md +4 -0
  23. data/docs/SubmissionInput.md +5 -5
  24. data/docs/SubmissionList.md +1 -1
  25. data/docs/SubmissionSummary.md +54 -0
  26. data/docs/Template.md +21 -17
  27. data/docs/TemplateActor.md +1 -1
  28. data/docs/TemplateDiff.md +2 -2
  29. data/docs/TemplateDocument.md +12 -12
  30. data/docs/TemplateDocumentSummary.md +24 -0
  31. data/docs/TemplatePreview.md +32 -0
  32. data/docs/TemplatePreviewState.md +15 -0
  33. data/docs/TemplateSummary.md +5 -49
  34. data/docs/UpdateTemplateDocumentRequest.md +5 -5
  35. data/docs/UpdateTemplateRequest.md +10 -6
  36. data/docs/ValidateSubmissionRequest.md +5 -5
  37. data/docspring.gemspec +2 -2
  38. data/lib/docspring/api/client.rb +222 -49
  39. data/lib/docspring/api_client.rb +5 -3
  40. data/lib/docspring/api_error.rb +1 -1
  41. data/lib/docspring/api_model_base.rb +1 -1
  42. data/lib/docspring/configuration.rb +1 -1
  43. data/lib/docspring/date_time_values.rb +33 -0
  44. data/lib/docspring/models/add_template_fields_request.rb +1 -1
  45. data/lib/docspring/models/ai_field_naming_language.rb +1 -1
  46. data/lib/docspring/models/authentication_check.rb +1 -1
  47. data/lib/docspring/models/barcode_symbology.rb +1 -1
  48. data/lib/docspring/models/check_character.rb +1 -1
  49. data/lib/docspring/models/combined_field_type.rb +1 -1
  50. data/lib/docspring/models/combined_pdf.rb +2 -2
  51. data/lib/docspring/models/combined_pdf_files.rb +1 -1
  52. data/lib/docspring/models/combined_pdf_list.rb +1 -1
  53. data/lib/docspring/models/combined_pdf_source.rb +1 -1
  54. data/lib/docspring/models/combined_pdf_source_input.rb +1 -1
  55. data/lib/docspring/models/combined_pdf_source_pdf.rb +1 -1
  56. data/lib/docspring/models/combined_pdf_source_type.rb +1 -1
  57. data/lib/docspring/models/combined_pdf_state.rb +1 -1
  58. data/lib/docspring/models/copy_template_request.rb +1 -1
  59. data/lib/docspring/models/create_combined_pdf_request.rb +2 -2
  60. data/lib/docspring/models/create_custom_file_from_upload_request.rb +1 -1
  61. data/lib/docspring/models/create_folder_request.rb +1 -1
  62. data/lib/docspring/models/create_signature_request_event_request.rb +1 -1
  63. data/lib/docspring/models/create_signature_request_token_request.rb +1 -1
  64. data/lib/docspring/models/create_submission_batch_request.rb +1 -1
  65. data/lib/docspring/models/create_submission_request.rb +6 -6
  66. data/lib/docspring/models/create_template_preview_request.rb +187 -0
  67. data/lib/docspring/models/create_template_request.rb +32 -12
  68. data/lib/docspring/models/create_webhook_request.rb +1 -1
  69. data/lib/docspring/models/custom_file.rb +1 -1
  70. data/lib/docspring/models/custom_file_list.rb +1 -1
  71. data/lib/docspring/models/custom_file_source_pdf.rb +1 -1
  72. data/lib/docspring/models/error_code.rb +4 -2
  73. data/lib/docspring/models/error_detail.rb +2 -2
  74. data/lib/docspring/models/error_info.rb +5 -5
  75. data/lib/docspring/models/error_response.rb +1 -1
  76. data/lib/docspring/models/expiration_interval.rb +1 -1
  77. data/lib/docspring/models/field.rb +2 -2
  78. data/lib/docspring/models/field_comparison_condition.rb +1 -1
  79. data/lib/docspring/models/field_comparison_operator.rb +1 -1
  80. data/lib/docspring/models/field_dependency.rb +1 -1
  81. data/lib/docspring/models/field_dependency_input.rb +1 -1
  82. data/lib/docspring/models/field_display_type.rb +1 -1
  83. data/lib/docspring/models/field_equals_condition.rb +1 -1
  84. data/lib/docspring/models/field_equals_operator.rb +1 -1
  85. data/lib/docspring/models/field_group.rb +3 -3
  86. data/lib/docspring/models/field_group_input.rb +2 -2
  87. data/lib/docspring/models/field_group_type.rb +1 -1
  88. data/lib/docspring/models/field_in_condition.rb +1 -1
  89. data/lib/docspring/models/field_input.rb +2 -2
  90. data/lib/docspring/models/field_override.rb +1 -1
  91. data/lib/docspring/models/field_presence_condition.rb +1 -1
  92. data/lib/docspring/models/field_presence_operator.rb +1 -1
  93. data/lib/docspring/models/field_range_condition.rb +1 -1
  94. data/lib/docspring/models/field_reimport_state.rb +1 -1
  95. data/lib/docspring/models/field_setup_logic.rb +1 -1
  96. data/lib/docspring/models/field_setup_naming.rb +1 -1
  97. data/lib/docspring/models/field_setup_source.rb +1 -1
  98. data/lib/docspring/models/field_type.rb +1 -1
  99. data/lib/docspring/models/folder.rb +1 -1
  100. data/lib/docspring/models/folder_list.rb +1 -1
  101. data/lib/docspring/models/generate_files_format.rb +5 -2
  102. data/lib/docspring/models/generate_submission_files_request.rb +2 -2
  103. data/lib/docspring/models/generated_file.rb +4 -4
  104. data/lib/docspring/models/generated_file_state.rb +1 -1
  105. data/lib/docspring/models/html_engine_options.rb +1 -1
  106. data/lib/docspring/models/html_engine_options_input.rb +1 -1
  107. data/lib/docspring/models/image_gravity.rb +1 -1
  108. data/lib/docspring/models/image_scale_type.rb +1 -1
  109. data/lib/docspring/models/model_code_language.rb +3 -2
  110. data/lib/docspring/models/move_folder_request.rb +1 -1
  111. data/lib/docspring/models/move_template_request.rb +1 -1
  112. data/lib/docspring/models/number_condition_type.rb +1 -1
  113. data/lib/docspring/models/output_format.rb +4 -2
  114. data/lib/docspring/models/page_format.rb +1 -1
  115. data/lib/docspring/models/page_image.rb +1 -1
  116. data/lib/docspring/models/page_images.rb +1 -1
  117. data/lib/docspring/models/predefined_field.rb +1 -1
  118. data/lib/docspring/models/predefined_field_input.rb +1 -1
  119. data/lib/docspring/models/publish_template_version_request.rb +1 -1
  120. data/lib/docspring/models/remove_template_fields_request.rb +1 -1
  121. data/lib/docspring/models/rename_folder_request.rb +1 -1
  122. data/lib/docspring/models/reorder_template_fields_request.rb +1 -1
  123. data/lib/docspring/models/restore_template_version_request.rb +1 -1
  124. data/lib/docspring/models/shape_type.rb +1 -1
  125. data/lib/docspring/models/signature_request.rb +1 -1
  126. data/lib/docspring/models/signature_request_auth_second_factor_type.rb +1 -1
  127. data/lib/docspring/models/signature_request_auth_type.rb +1 -1
  128. data/lib/docspring/models/signature_request_event.rb +1 -1
  129. data/lib/docspring/models/signature_request_event_type.rb +1 -1
  130. data/lib/docspring/models/signature_request_input.rb +1 -1
  131. data/lib/docspring/models/signature_request_message_type.rb +1 -1
  132. data/lib/docspring/models/signature_request_state.rb +1 -1
  133. data/lib/docspring/models/signature_request_token.rb +1 -1
  134. data/lib/docspring/models/signature_request_token_type.rb +1 -1
  135. data/lib/docspring/models/string_condition_type.rb +1 -1
  136. data/lib/docspring/models/submission.rb +145 -145
  137. data/lib/docspring/models/submission_action.rb +1 -1
  138. data/lib/docspring/models/submission_action_state.rb +1 -1
  139. data/lib/docspring/models/submission_action_type.rb +1 -1
  140. data/lib/docspring/models/submission_batch.rb +5 -5
  141. data/lib/docspring/models/submission_batch_state.rb +1 -1
  142. data/lib/docspring/models/submission_files.rb +22 -2
  143. data/lib/docspring/models/submission_input.rb +6 -6
  144. data/lib/docspring/models/submission_list.rb +2 -2
  145. data/lib/docspring/models/submission_source.rb +1 -1
  146. data/lib/docspring/models/submission_source_pdf.rb +1 -1
  147. data/lib/docspring/models/submission_state.rb +1 -1
  148. data/lib/docspring/models/submission_summary.rb +601 -0
  149. data/lib/docspring/models/submission_validation.rb +1 -1
  150. data/lib/docspring/models/template.rb +131 -91
  151. data/lib/docspring/models/template_actor.rb +2 -2
  152. data/lib/docspring/models/template_actor_type.rb +1 -1
  153. data/lib/docspring/models/template_defaults.rb +1 -1
  154. data/lib/docspring/models/template_defaults_input.rb +1 -1
  155. data/lib/docspring/models/template_diff.rb +3 -3
  156. data/lib/docspring/models/template_diff_summary.rb +1 -1
  157. data/lib/docspring/models/template_document.rb +51 -51
  158. data/lib/docspring/models/template_document_state.rb +4 -2
  159. data/lib/docspring/models/template_document_summary.rb +260 -0
  160. data/lib/docspring/models/template_field_change.rb +1 -1
  161. data/lib/docspring/models/template_field_changes.rb +1 -1
  162. data/lib/docspring/models/template_field_dependency.rb +1 -1
  163. data/lib/docspring/models/template_field_dependency_action.rb +1 -1
  164. data/lib/docspring/models/template_field_dependency_condition.rb +1 -1
  165. data/lib/docspring/models/template_field_dependency_condition_input.rb +1 -1
  166. data/lib/docspring/models/template_field_dependency_input.rb +1 -1
  167. data/lib/docspring/models/template_field_dependency_match.rb +1 -1
  168. data/lib/docspring/models/template_field_dependency_operator.rb +1 -1
  169. data/lib/docspring/models/template_field_logic_status.rb +1 -1
  170. data/lib/docspring/models/template_field_move.rb +1 -1
  171. data/lib/docspring/models/template_fields.rb +1 -1
  172. data/lib/docspring/models/template_form_mode.rb +1 -1
  173. data/lib/docspring/models/template_model_code.rb +1 -1
  174. data/lib/docspring/models/template_page_ai_error.rb +1 -1
  175. data/lib/docspring/models/template_page_ai_naming_status.rb +1 -1
  176. data/lib/docspring/models/template_page_fields_status.rb +1 -1
  177. data/lib/docspring/models/template_page_image_status.rb +1 -1
  178. data/lib/docspring/models/template_page_images.rb +1 -1
  179. data/lib/docspring/models/template_page_processing_status.rb +1 -1
  180. data/lib/docspring/models/template_preview.rb +356 -0
  181. data/lib/docspring/models/template_preview_state.rb +42 -0
  182. data/lib/docspring/models/template_source_pdf.rb +1 -1
  183. data/lib/docspring/models/template_summary.rb +34 -574
  184. data/lib/docspring/models/template_summary_list.rb +1 -1
  185. data/lib/docspring/models/template_type.rb +3 -2
  186. data/lib/docspring/models/template_version.rb +1 -1
  187. data/lib/docspring/models/template_version_type.rb +1 -1
  188. data/lib/docspring/models/text_alignment.rb +1 -1
  189. data/lib/docspring/models/text_overflow.rb +1 -1
  190. data/lib/docspring/models/text_vertical_alignment.rb +1 -1
  191. data/lib/docspring/models/typeface.rb +1 -1
  192. data/lib/docspring/models/update_signature_request_request.rb +1 -1
  193. data/lib/docspring/models/update_template_document_request.rb +7 -7
  194. data/lib/docspring/models/update_template_fields_request.rb +1 -1
  195. data/lib/docspring/models/update_template_request.rb +31 -11
  196. data/lib/docspring/models/update_webhook_request.rb +1 -1
  197. data/lib/docspring/models/upload_method.rb +1 -1
  198. data/lib/docspring/models/upload_presign.rb +1 -1
  199. data/lib/docspring/models/url_source_pdf.rb +1 -1
  200. data/lib/docspring/models/validate_submission_request.rb +6 -6
  201. data/lib/docspring/models/webhook.rb +1 -1
  202. data/lib/docspring/models/webhook_event_type.rb +1 -1
  203. data/lib/docspring/models/webhook_list.rb +1 -1
  204. data/lib/docspring/models/webhook_mode.rb +1 -1
  205. data/lib/docspring/request_schemas.json +144 -10
  206. data/lib/docspring/version.rb +2 -2
  207. data/lib/docspring/webhook_signature.rb +45 -0
  208. data/lib/docspring.rb +7 -1
  209. data/spec/api/client_spec.rb +61 -25
  210. data/spec/models/add_template_fields_request_spec.rb +1 -1
  211. data/spec/models/ai_field_naming_language_spec.rb +1 -1
  212. data/spec/models/authentication_check_spec.rb +1 -1
  213. data/spec/models/barcode_symbology_spec.rb +1 -1
  214. data/spec/models/check_character_spec.rb +1 -1
  215. data/spec/models/combined_field_type_spec.rb +1 -1
  216. data/spec/models/combined_pdf_files_spec.rb +1 -1
  217. data/spec/models/combined_pdf_list_spec.rb +1 -1
  218. data/spec/models/combined_pdf_source_input_spec.rb +1 -1
  219. data/spec/models/combined_pdf_source_pdf_spec.rb +1 -1
  220. data/spec/models/combined_pdf_source_spec.rb +1 -1
  221. data/spec/models/combined_pdf_source_type_spec.rb +1 -1
  222. data/spec/models/combined_pdf_spec.rb +1 -1
  223. data/spec/models/combined_pdf_state_spec.rb +1 -1
  224. data/spec/models/copy_template_request_spec.rb +1 -1
  225. data/spec/models/create_combined_pdf_request_spec.rb +1 -1
  226. data/spec/models/create_custom_file_from_upload_request_spec.rb +1 -1
  227. data/spec/models/create_folder_request_spec.rb +1 -1
  228. data/spec/models/create_signature_request_event_request_spec.rb +1 -1
  229. data/spec/models/create_signature_request_token_request_spec.rb +1 -1
  230. data/spec/models/create_submission_batch_request_spec.rb +1 -1
  231. data/spec/models/create_submission_request_spec.rb +1 -1
  232. data/spec/models/create_template_preview_request_spec.rb +36 -0
  233. data/spec/models/create_template_request_spec.rb +13 -1
  234. data/spec/models/create_webhook_request_spec.rb +1 -1
  235. data/spec/models/custom_file_list_spec.rb +1 -1
  236. data/spec/models/custom_file_source_pdf_spec.rb +1 -1
  237. data/spec/models/custom_file_spec.rb +1 -1
  238. data/spec/models/error_code_spec.rb +1 -1
  239. data/spec/models/error_detail_spec.rb +1 -1
  240. data/spec/models/error_info_spec.rb +1 -1
  241. data/spec/models/error_response_spec.rb +1 -1
  242. data/spec/models/expiration_interval_spec.rb +1 -1
  243. data/spec/models/field_comparison_condition_spec.rb +1 -1
  244. data/spec/models/field_comparison_operator_spec.rb +1 -1
  245. data/spec/models/field_dependency_input_spec.rb +1 -1
  246. data/spec/models/field_dependency_spec.rb +1 -1
  247. data/spec/models/field_display_type_spec.rb +1 -1
  248. data/spec/models/field_equals_condition_spec.rb +1 -1
  249. data/spec/models/field_equals_operator_spec.rb +1 -1
  250. data/spec/models/field_group_input_spec.rb +1 -1
  251. data/spec/models/field_group_spec.rb +1 -1
  252. data/spec/models/field_group_type_spec.rb +1 -1
  253. data/spec/models/field_in_condition_spec.rb +1 -1
  254. data/spec/models/field_input_spec.rb +1 -1
  255. data/spec/models/field_override_spec.rb +1 -1
  256. data/spec/models/field_presence_condition_spec.rb +1 -1
  257. data/spec/models/field_presence_operator_spec.rb +1 -1
  258. data/spec/models/field_range_condition_spec.rb +1 -1
  259. data/spec/models/field_reimport_state_spec.rb +1 -1
  260. data/spec/models/field_setup_logic_spec.rb +1 -1
  261. data/spec/models/field_setup_naming_spec.rb +1 -1
  262. data/spec/models/field_setup_source_spec.rb +1 -1
  263. data/spec/models/field_spec.rb +1 -1
  264. data/spec/models/field_type_spec.rb +1 -1
  265. data/spec/models/folder_list_spec.rb +1 -1
  266. data/spec/models/folder_spec.rb +1 -1
  267. data/spec/models/generate_files_format_spec.rb +1 -1
  268. data/spec/models/generate_submission_files_request_spec.rb +1 -1
  269. data/spec/models/generated_file_spec.rb +1 -1
  270. data/spec/models/generated_file_state_spec.rb +1 -1
  271. data/spec/models/html_engine_options_input_spec.rb +1 -1
  272. data/spec/models/html_engine_options_spec.rb +1 -1
  273. data/spec/models/image_gravity_spec.rb +1 -1
  274. data/spec/models/image_scale_type_spec.rb +1 -1
  275. data/spec/models/model_code_language_spec.rb +1 -1
  276. data/spec/models/move_folder_request_spec.rb +1 -1
  277. data/spec/models/move_template_request_spec.rb +1 -1
  278. data/spec/models/number_condition_type_spec.rb +1 -1
  279. data/spec/models/output_format_spec.rb +1 -1
  280. data/spec/models/page_format_spec.rb +1 -1
  281. data/spec/models/page_image_spec.rb +1 -1
  282. data/spec/models/page_images_spec.rb +1 -1
  283. data/spec/models/predefined_field_input_spec.rb +1 -1
  284. data/spec/models/predefined_field_spec.rb +1 -1
  285. data/spec/models/publish_template_version_request_spec.rb +1 -1
  286. data/spec/models/remove_template_fields_request_spec.rb +1 -1
  287. data/spec/models/rename_folder_request_spec.rb +1 -1
  288. data/spec/models/reorder_template_fields_request_spec.rb +1 -1
  289. data/spec/models/restore_template_version_request_spec.rb +1 -1
  290. data/spec/models/shape_type_spec.rb +1 -1
  291. data/spec/models/signature_request_auth_second_factor_type_spec.rb +1 -1
  292. data/spec/models/signature_request_auth_type_spec.rb +1 -1
  293. data/spec/models/signature_request_event_spec.rb +1 -1
  294. data/spec/models/signature_request_event_type_spec.rb +1 -1
  295. data/spec/models/signature_request_input_spec.rb +1 -1
  296. data/spec/models/signature_request_message_type_spec.rb +1 -1
  297. data/spec/models/signature_request_spec.rb +1 -1
  298. data/spec/models/signature_request_state_spec.rb +1 -1
  299. data/spec/models/signature_request_token_spec.rb +1 -1
  300. data/spec/models/signature_request_token_type_spec.rb +1 -1
  301. data/spec/models/string_condition_type_spec.rb +1 -1
  302. data/spec/models/submission_action_spec.rb +1 -1
  303. data/spec/models/submission_action_state_spec.rb +1 -1
  304. data/spec/models/submission_action_type_spec.rb +1 -1
  305. data/spec/models/submission_batch_spec.rb +1 -1
  306. data/spec/models/submission_batch_state_spec.rb +1 -1
  307. data/spec/models/submission_files_spec.rb +13 -1
  308. data/spec/models/submission_input_spec.rb +1 -1
  309. data/spec/models/submission_list_spec.rb +1 -1
  310. data/spec/models/submission_source_pdf_spec.rb +1 -1
  311. data/spec/models/submission_source_spec.rb +1 -1
  312. data/spec/models/submission_spec.rb +13 -13
  313. data/spec/models/submission_state_spec.rb +1 -1
  314. data/spec/models/submission_summary_spec.rb +144 -0
  315. data/spec/models/submission_validation_spec.rb +1 -1
  316. data/spec/models/template_actor_spec.rb +1 -1
  317. data/spec/models/template_actor_type_spec.rb +1 -1
  318. data/spec/models/template_defaults_input_spec.rb +1 -1
  319. data/spec/models/template_defaults_spec.rb +1 -1
  320. data/spec/models/template_diff_spec.rb +1 -1
  321. data/spec/models/template_diff_summary_spec.rb +1 -1
  322. data/spec/models/template_document_spec.rb +6 -6
  323. data/spec/models/template_document_state_spec.rb +1 -1
  324. data/spec/models/template_document_summary_spec.rb +54 -0
  325. data/spec/models/template_field_change_spec.rb +1 -1
  326. data/spec/models/template_field_changes_spec.rb +1 -1
  327. data/spec/models/template_field_dependency_action_spec.rb +1 -1
  328. data/spec/models/template_field_dependency_condition_input_spec.rb +1 -1
  329. data/spec/models/template_field_dependency_condition_spec.rb +1 -1
  330. data/spec/models/template_field_dependency_input_spec.rb +1 -1
  331. data/spec/models/template_field_dependency_match_spec.rb +1 -1
  332. data/spec/models/template_field_dependency_operator_spec.rb +1 -1
  333. data/spec/models/template_field_dependency_spec.rb +1 -1
  334. data/spec/models/template_field_logic_status_spec.rb +1 -1
  335. data/spec/models/template_field_move_spec.rb +1 -1
  336. data/spec/models/template_fields_spec.rb +1 -1
  337. data/spec/models/template_form_mode_spec.rb +1 -1
  338. data/spec/models/template_model_code_spec.rb +1 -1
  339. data/spec/models/template_page_ai_error_spec.rb +1 -1
  340. data/spec/models/template_page_ai_naming_status_spec.rb +1 -1
  341. data/spec/models/template_page_fields_status_spec.rb +1 -1
  342. data/spec/models/template_page_image_status_spec.rb +1 -1
  343. data/spec/models/template_page_images_spec.rb +1 -1
  344. data/spec/models/template_page_processing_status_spec.rb +1 -1
  345. data/spec/models/template_preview_spec.rb +78 -0
  346. data/spec/models/template_preview_state_spec.rb +30 -0
  347. data/spec/models/template_source_pdf_spec.rb +1 -1
  348. data/spec/models/template_spec.rb +35 -23
  349. data/spec/models/template_summary_list_spec.rb +1 -1
  350. data/spec/models/template_summary_spec.rb +6 -138
  351. data/spec/models/template_type_spec.rb +1 -1
  352. data/spec/models/template_version_spec.rb +1 -1
  353. data/spec/models/template_version_type_spec.rb +1 -1
  354. data/spec/models/text_alignment_spec.rb +1 -1
  355. data/spec/models/text_overflow_spec.rb +1 -1
  356. data/spec/models/text_vertical_alignment_spec.rb +1 -1
  357. data/spec/models/typeface_spec.rb +1 -1
  358. data/spec/models/update_signature_request_request_spec.rb +1 -1
  359. data/spec/models/update_template_document_request_spec.rb +1 -1
  360. data/spec/models/update_template_fields_request_spec.rb +1 -1
  361. data/spec/models/update_template_request_spec.rb +13 -1
  362. data/spec/models/update_webhook_request_spec.rb +1 -1
  363. data/spec/models/upload_method_spec.rb +1 -1
  364. data/spec/models/upload_presign_spec.rb +1 -1
  365. data/spec/models/url_source_pdf_spec.rb +1 -1
  366. data/spec/models/validate_submission_request_spec.rb +1 -1
  367. data/spec/models/webhook_event_type_spec.rb +1 -1
  368. data/spec/models/webhook_list_spec.rb +1 -1
  369. data/spec/models/webhook_mode_spec.rb +1 -1
  370. data/spec/models/webhook_spec.rb +1 -1
  371. data/spec/spec_helper.rb +1 -1
  372. metadata +25 -2
data/docs/CombinedPdf.md CHANGED
@@ -7,7 +7,7 @@
7
7
  | **id** | **String** | The combined PDF's ID. | |
8
8
  | **state** | [**CombinedPdfState**](CombinedPdfState.md) | `pending` until the PDF has been generated, then `processed`. `insufficient_credits`: waiting for credits; `error_message` says whether the PDF is generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. `error`: the PDFs couldn't be merged (see `error_message`). Waiting ends in `error` if it's discarded or takes over 30 days. | |
9
9
  | **source_pdfs** | [**Array<CombinedPdfSource>**](CombinedPdfSource.md) | The PDFs to merge, in order. | |
10
- | **metadata** | **Hash<String, Object>** | Your own data about the combined PDF, such as an ID from your app. | |
10
+ | **metadata** | **Hash<String, Object>** | Your own data about the combined PDF, such as an ID from your app. Its `pdf_filename` key names the PDF's file (`files.pdf.filename`, and its download): a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the combined PDF's ID (`com_1234567890abcdef01.pdf`). | |
11
11
  | **has_password** | **Boolean** | Whether the PDF needs a password to open (`password`). | |
12
12
  | **delete_custom_files** | **Boolean** | Delete the custom files in `source_pdfs` once the combined PDF has been generated (they're kept if it fails). Other combined PDFs can't use them after that. A test API token can't delete custom files. | |
13
13
  | **error_message** | **String** | Why the PDFs couldn't be merged, when `state` is `error`. | |
@@ -5,7 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **source_pdfs** | [**Array<CombinedPdfSourceInput>**](CombinedPdfSourceInput.md) | The PDFs to merge, in order. | |
8
- | **metadata** | **Hash<String, Object>** | Your own data about the combined PDF, such as an ID from your app. | [optional] |
8
+ | **metadata** | **Hash<String, Object>** | Your own data about the combined PDF, such as an ID from your app. Its `pdf_filename` key names the PDF's file (`files.pdf.filename`, and its download): a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the combined PDF's ID (`com_1234567890abcdef01.pdf`). | [optional] |
9
9
  | **password** | **String** | A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. | [optional] |
10
10
  | **delete_custom_files** | **Boolean** | Delete the custom files in `source_pdfs` once the combined PDF has been generated (they're kept if it fails). Other combined PDFs can't use them after that. A test API token can't delete custom files. | [optional] |
11
11
  | **expires_in** | **Integer** | Seconds after the PDF is generated until the combined PDF expires, up to 10 years (315360000). One that fails is kept for at least 48 hours. Without it, the combined PDF is kept until you delete it. | [optional] |
@@ -6,14 +6,14 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **test** | **Boolean** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | [optional] |
8
8
  | **editable** | **Boolean** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | [optional] |
9
- | **data** | **Hash<String, Object>** | The values of the template's fields, by field name. Required for a PDF template, unless `signature_requests` collects the values. | [optional] |
10
- | **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. | [optional] |
11
- | **password** | **String** | A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. | [optional] |
12
- | **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission. | [optional] |
9
+ | **data** | **Hash<String, Object>** | The values of the template's fields, by field name. Required for PDF and Word templates, unless `signature_requests` collects them (PDF templates only). | [optional] |
10
+ | **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | [optional] |
11
+ | **password** | **String** | A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. Word documents and OpenDocument files can't be password-protected, so a submission with a password can't make them. | [optional] |
12
+ | **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, `docx` (a Word document, from a Word template), `odt` (an OpenDocument file, the format LibreOffice uses, converted from a Word template's Word document), and `png` (an image of each page of the PDF, up to 100 pages, which adds `pdf`) when you ask for it. Default `["pdf"]`, or a Word template's `output_format`. POST /submissions/{submission_id}/generate_files adds `png`, and a Word template's submission's `pdf`, `docx` or `odt`, to a processed submission. | [optional] |
13
13
  | **expires_in** | **Integer** | Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours. | [optional] |
14
14
  | **field_overrides** | [**Hash<String, FieldOverride>**](FieldOverride.md) | Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. With `signature_requests`, `editable: true` is a 422, and a `default` for a signature or initials field makes the submission `invalid_data`. | [optional] |
15
15
  | **html** | **String** | For an HTML template, HTML to use instead of the template's. | [optional] |
16
- | **css** | **String** | For an HTML template, CSS to use instead of the template's. | [optional] |
16
+ | **css** | **String** | For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity. | [optional] |
17
17
  | **signature_requests** | [**Array<SignatureRequestInput>**](SignatureRequestInput.md) | The people who sign the PDF, and fill in their fields first. The PDF is generated once every signature request is completed. PDF templates only. Without `role`s, the first signature request is `Signer 1`, the second `Signer 2`, and so on. To leave a signer out, give every signature request its `role` and leave that one's out. Only the signers sign: a value for a signature or initials field in `data` makes the submission `invalid_data`. | [optional] |
18
18
 
19
19
  ## Example
@@ -0,0 +1,18 @@
1
+ # DocSpring::CreateTemplatePreviewRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | **Hash<String, Object>** | The values of the template's fields, by field name, as you'd send them to create a submission. They're rendered as they are: they aren't checked against the template's fields. A value that a field can't print, such as an image URL that doesn't download, makes the preview's `state` `error`, with an `error_message`. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'docspring'
13
+
14
+ instance = DocSpring::CreateTemplatePreviewRequest.new(
15
+ data: null
16
+ )
17
+ ```
18
+
@@ -6,26 +6,27 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **name** | **String** | The template's name. | [optional] |
8
8
  | **description** | **String** | Shown under the template's name at the top of its hosted forms, and used as their meta description. Not shown on embedded forms or signature requests. | [optional] |
9
- | **template_type** | [**TemplateType**](TemplateType.md) | `pdf`: fields placed on an uploaded PDF. `html`: a PDF rendered from HTML and SCSS. It can't be changed after the template is created. | |
9
+ | **template_type** | [**TemplateType**](TemplateType.md) | `pdf`: fields placed on an uploaded PDF. `html`: a PDF rendered from HTML and SCSS. `docx`: a Word document with tags where the data goes, which makes Word documents or PDFs. It can't be changed after the template is created. | |
10
+ | **output_format** | [**OutputFormat**](OutputFormat.md) | What each submission makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. A Word template's is chosen when it's created; PDF and HTML templates always make PDFs. A Word template that encrypts its PDFs makes PDFs, because Word documents and OpenDocument files can't be password-protected. | [optional] |
10
11
  | **parent_folder_id** | **String** | The ID of the folder the template is in. Null for a template at the root. Setting it moves the template and all of its published versions. | [optional] |
11
12
  | **locked** | **Boolean** | A locked template can't be changed or deleted until it's unlocked (`locked` can always be changed). | [optional] |
12
13
  | **add_signature_request_submission_id_footers** | **Boolean** | Print the submission ID in the footer of each page of PDFs signed through signature requests. | [optional] |
13
14
  | **ai_field_naming_language** | [**AiFieldNamingLanguage**](AiFieldNamingLanguage.md) | The language AI field setup names fields in: `auto` uses the form's language when it's written in the Latin alphabet without accents, and English otherwise; `english` always uses English; `form_language` uses the form's language and script. New templates take it from your account's template settings. Null for HTML templates. | [optional] |
14
15
  | **allow_additional_properties** | **Boolean** | Accept submission data with properties that aren't fields of the template. | [optional] |
15
16
  | **allow_skipping_optional_fields** | **Boolean** | Visual forms and signature request forms show the Continue button as soon as the required fields are filled in, without visiting each optional field. The `allowSkippingOptionalFields` embed option overrides it. | [optional] |
16
- | **default_form_mode** | [**TemplateFormMode**](TemplateFormMode.md) | The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). HTML templates have no visual form, so `web` is the only value they accept. | [optional] |
17
+ | **default_form_mode** | [**TemplateFormMode**](TemplateFormMode.md) | The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). Only PDF templates have a visual form, so other templates accept only `web`. | [optional] |
17
18
  | **editable_submissions** | **Boolean** | Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it. | [optional] |
18
- | **embed_domains** | **Array<String>** | The sites where the template's signature requests, forms and embedded template editor can be loaded: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). When it's empty, live signature requests don't load on any site, and the embedded template editor loads on every site. | [optional] |
19
+ | **embed_domains** | **Array<String>** | The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted. | [optional] |
19
20
  | **embed_edit_allow_settings** | **Boolean** | Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on). | [optional] |
20
21
  | **embed_edit_allow_versioning** | **Boolean** | Allow the embedded template editor to publish, restore, compare and delete published versions. | [optional] |
21
22
  | **embed_edit_allow_document_replacement** | **Boolean** | Allow the embedded template editor to replace the template's PDF. | [optional] |
22
- | **encrypt_pdfs** | **Boolean** | Encrypt generated PDFs with `encrypt_pdfs_password`. | [optional] |
23
+ | **encrypt_pdfs** | **Boolean** | Encrypt generated PDFs with `encrypt_pdfs_password`. A Word template can only encrypt its PDFs when its `output_format` is `pdf`, because Word documents and OpenDocument files can't be password-protected. | [optional] |
23
24
  | **encrypt_pdfs_password** | **String** | The password that opens encrypted PDFs. It's never returned; `has_encrypt_pdfs_password` says if it's set. | [optional] |
24
25
  | **expire_submissions** | **Boolean** | Delete each submission's data and PDF after `expire_after` `expiration_interval`. | [optional] |
25
26
  | **expire_after** | **Integer** | How many `expiration_interval`s a submission's data and PDF are kept for, when `expire_submissions` is on. At most 5256000 (10 years in minutes). | [optional] |
26
27
  | **expiration_interval** | [**ExpirationInterval**](ExpirationInterval.md) | The unit of `expire_after`. | [optional] |
27
28
  | **merge_audit_trail_pdf** | **Boolean** | Add the audit trail to the end of PDFs signed through signature requests. | [optional] |
28
- | **parse_dates_using_template_date_format** | **Boolean** | Date fields also accept NN/NN/YYYY dates (with slashes, dashes or dots), read in the order of the template's default date format: month first for %m/%d/%Y, day first for %d/%m/%Y. When false, date fields only accept YYYY-MM-DD. Applies to PDF templates: an HTML template's date fields only accept YYYY-MM-DD. Date fields that include a time take RFC 3339 date-times either way. | [optional] |
29
+ | **parse_dates_using_template_date_format** | **Boolean** | Date fields also accept NN/NN/YYYY dates (with slashes, dashes or dots), read in the order of the template's default date format: month first for %m/%d/%Y, day first for %d/%m/%Y. When false, date fields only accept YYYY-MM-DD. Applies to PDF templates: an HTML or Word template's date fields only accept YYYY-MM-DD. Date fields that include a time take RFC 3339 date-times either way. | [optional] |
29
30
  | **public_submissions** | **Boolean** | Allow anyone with a submission's ID to download its PDF. | [optional] |
30
31
  | **public_web_form** | **Boolean** | Allow anyone to fill in the template's web form. | [optional] |
31
32
  | **redirect_url** | **String** | Where the web form sends people after they submit it. | [optional] |
@@ -34,15 +35,16 @@
34
35
  | **field_dependencies** | [**Array<TemplateFieldDependencyInput>**](TemplateFieldDependencyInput.md) | The template's conditional logic rules. Setting them replaces all of the rules. | [optional] |
35
36
  | **predefined_fields** | [**Array<PredefinedFieldInput>**](PredefinedFieldInput.md) | The field names that people using the embedded template editor choose from, each with the data type and settings a field gets when it's given that name. Setting it replaces the whole list; an empty list turns them off. | [optional] |
36
37
  | **predefined_fields_sample_data** | **Hash<String, Object>** | Sample submission data that sets `predefined_fields`: each value becomes a predefined field, with a type that fits it (`string`, `number`, `boolean`, `date`, `email` or `url`) and `required_in_template` true. Nested objects and arrays become names with `/`, such as `customer/email`. Without `predefined_fields` in the same request, it replaces them; with them, it adds to them and sets the types of the ones it has values for. | [optional] |
37
- | **html** | **String** | The HTML of an HTML template, as a Liquid template. Null for PDF templates. | [optional] |
38
+ | **html** | **String** | The HTML of an HTML template, as a Liquid template. Null for PDF and Word templates. | [optional] |
38
39
  | **scss** | **String** | The SCSS of an HTML template. | [optional] |
39
40
  | **header_html** | **String** | The HTML printed at the top of each page of an HTML template. | [optional] |
40
41
  | **footer_html** | **String** | The HTML printed at the bottom of each page of an HTML template. | [optional] |
41
42
  | **html_engine_options** | [**HtmlEngineOptionsInput**](HtmlEngineOptionsInput.md) | Null resets the options to their defaults. | [optional] |
42
- | **cache_id** | **String** | A PDF template's document: the `fields.key` of a file you uploaded with the presigned upload (GET /uploads/presign). A PDF template needs one of `cache_id`, `document_url` and `document_base64`. To upload the PDF with the request, use POST /templates/upload. | [optional] |
43
- | **document_url** | **String** | An https:// link to the template's PDF (up to 100 MB), instead of `cache_id`. DocSpring downloads it after responding, following redirects to other https:// links: the template's `document.state` is `downloading` until then (sync.api hosts wait for it). If it can't be downloaded, the state is `download_failed` and `document.error_message` says why. | [optional] |
44
- | **document_base64** | **String** | The template's PDF, encoded as base64 (a `data:` URI works too), instead of `cache_id`. Up to 7 MB before it's encoded: send a larger file with `cache_id` or `document_url`. | [optional] |
45
- | **filename** | **String** | The PDF's file name, for a `cache_id` (presigned uploads don't send one) or `document_base64`. A `document_url`'s is the last part of its path unless you set it. | [optional] |
43
+ | **html_escape_data** | **Boolean** | Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for PDF templates. | [optional] |
44
+ | **cache_id** | **String** | The template's document, a PDF or a Word document (.docx or .odt): the `fields.key` of a file you uploaded with the presigned upload (GET /uploads/presign). PDF and Word templates need one of `cache_id`, `document_url` and `document_base64`. To upload the file with the request, use POST /templates/upload. | [optional] |
45
+ | **document_url** | **String** | An https:// link to the template's document, instead of `cache_id`: a PDF template's PDF (up to 100 MB) or a Word template's Word document (.docx or .odt, up to 50 MB). DocSpring downloads it after responding, following redirects to other https:// links: the template's `document.state` is `downloading` until then, and `converting` while an .odt is converted (sync.api hosts wait for both). If it can't be downloaded, the state is `download_failed` and `document.error_message` says why. | [optional] |
46
+ | **document_base64** | **String** | The template's document (a PDF, or a Word template's Word document), encoded as base64 (a `data:` URI works too), instead of `cache_id`. Up to 7 MB before it's encoded: send a larger file with `cache_id` or `document_url`. | [optional] |
47
+ | **filename** | **String** | The file's name, for a `cache_id` (presigned uploads don't send one) or `document_base64`. A `document_url`'s is the last part of its path unless you set it. | [optional] |
46
48
  | **detect_fields** | **Boolean** | Set up the PDF's fields as DocSpring's "Automatically detect fields" upload option does: import or detect the fields, name them with AI, and set up conditional logic. `field_source`, `field_naming` and `field_logic` choose how. Default false. `document.page_processing_statuses` and `document.field_logic_status` show how it's going, and `document.state` becomes `processed` once every page's fields are set up. | [optional] |
47
49
  | **field_source** | [**FieldSetupSource**](FieldSetupSource.md) | With `detect_fields`, where the fields come from. `auto` (the default) imports the form fields of a fillable PDF and detects the fields of a PDF without them; `pdf_detection` detects the fields from the page layout, even on a fillable PDF; `pdf_form_fields` only imports the PDF's form fields. | [optional] |
48
50
  | **field_naming** | [**FieldSetupNaming**](FieldSetupNaming.md) | With `detect_fields`, how the fields are named. `ai` (the default) names them and sets their types and settings with AI; `preserve` keeps the names of the PDF's form fields, and AI only names the fields it detected. `preserve` needs `field_source` `auto` or `pdf_form_fields`. | [optional] |
@@ -57,6 +59,7 @@ instance = DocSpring::CreateTemplateRequest.new(
57
59
  name: null,
58
60
  description: null,
59
61
  template_type: null,
62
+ output_format: null,
60
63
  parent_folder_id: null,
61
64
  locked: null,
62
65
  add_signature_request_submission_id_footers: null,
@@ -89,6 +92,7 @@ instance = DocSpring::CreateTemplateRequest.new(
89
92
  header_html: null,
90
93
  footer_html: null,
91
94
  html_engine_options: null,
95
+ html_escape_data: null,
92
96
  cache_id: null,
93
97
  document_url: null,
94
98
  document_base64: null,
data/docs/ErrorDetail.md CHANGED
@@ -7,7 +7,7 @@
7
7
  | **code** | **String** | What's wrong: `required`, `unknown_property`, `type`, `enum`, `format`, a JSON Schema keyword such as `minLength`, or a DocSpring code. New codes can be added. | |
8
8
  | **message** | **String** | A human-readable explanation of the problem. | |
9
9
  | **pointer** | **String** | A JSON pointer to the value in the request body (RFC 6901). An empty string means the whole body. In a submission's `data_errors`, it points into the request that created the submission. | [optional] |
10
- | **parameter** | **String** | The query parameter the detail is about. | [optional] |
10
+ | **parameter** | **String** | The query parameter or header the detail is about. | [optional] |
11
11
  | **submission_id** | **String** | For a batch item that failed validation, the ID of the submission recorded for it. | [optional] |
12
12
 
13
13
  ## Example
data/docs/ErrorInfo.md CHANGED
@@ -4,13 +4,13 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **code** | [**ErrorCode**](ErrorCode.md) | A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `upgrade_required` (403): your plan doesn't include this, such as more templates or the embedded template editor. `account_suspended` (403): the account is suspended, so it can't create submissions. `polling_timeout`: on a sync.api host, the PDF wasn't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id` or `template_id`. Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created. | |
7
+ | **code** | [**ErrorCode**](ErrorCode.md) | A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `upgrade_required` (403): your plan doesn't include this, such as more templates, another active integration (webhooks count) or the embedded template editor. `account_suspended` (403): the account is suspended, so it can't create submissions. `polling_timeout`: on a sync.api host, the files weren't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id` or `template_id`. Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created. `idempotency_key_in_use` (409): a request with the same Idempotency-Key is still being processed. Send the request again in a few seconds; when the first request has already created its record, its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `idempotency_key_reused` (422): the Idempotency-Key was already used for a different request. | |
8
8
  | **message** | **String** | A human-readable explanation, safe to show to developers. | |
9
9
  | **details** | [**Array<ErrorDetail>**](ErrorDetail.md) | What was wrong with each part of the request. Empty when the error isn't about one part of it. | |
10
10
  | **request_id** | **String** | The ID of the request. Include it when you contact support. | |
11
- | **submission_id** | **String** | When a submission's data fails validation, the submission is still recorded (state `invalid_data`) so you can see it in the dashboard. This is its ID. With `insufficient_credits`, the submission that waits for credits. With `polling_timeout`, the submission that's still being processed. | [optional] |
12
- | **submission_batch_id** | **String** | The ID of the recorded batch, when items in a batch fail validation. With `insufficient_credits`, the batch whose submissions wait for credits. With `polling_timeout`, the batch that's still being processed. | [optional] |
13
- | **combined_pdf_id** | **String** | With `insufficient_credits`, the combined PDF that waits for credits. With `polling_timeout`, the combined PDF that's still being processed. | [optional] |
11
+ | **submission_id** | **String** | When a submission's data fails validation, the submission is still recorded (state `invalid_data`) so you can see it in the dashboard. This is its ID. With `insufficient_credits`, the submission that waits for credits. With `polling_timeout` or `idempotency_key_in_use`, the submission that's still being processed. | [optional] |
12
+ | **submission_batch_id** | **String** | The ID of the recorded batch, when items in a batch fail validation. With `insufficient_credits`, the batch whose submissions wait for credits. With `polling_timeout` or `idempotency_key_in_use`, the batch that's still being processed. | [optional] |
13
+ | **combined_pdf_id** | **String** | With `insufficient_credits`, the combined PDF that waits for credits. With `polling_timeout` or `idempotency_key_in_use`, the combined PDF that's still being processed. | [optional] |
14
14
  | **template_id** | **String** | With `polling_timeout`, the template whose PDF is still being processed. | [optional] |
15
15
 
16
16
  ## Example
data/docs/FieldGroup.md CHANGED
@@ -5,12 +5,12 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **name** | **String** | The group's name: `address` for the field `address/city`. A list's item numbers are written as `~`, so the fields `items/0/price` and `items/1/price` are in the groups `items` and `items/~`, the list's items. | |
8
- | **type** | [**FieldGroupType**](FieldGroupType.md) | `array` for a list, whose fields' names number its items after the group's name (`items/0/price`, or `items/~/price` in an HTML template), and `object` for the other groups. | |
8
+ | **type** | [**FieldGroupType**](FieldGroupType.md) | `array` for a list, whose fields' names number its items after the group's name (`items/0/price`, or `items/~/price` in an HTML or Word template), and `object` for the other groups. | |
9
9
  | **title** | **String** | The group's title in the template's data schema and on forms. When it's empty, a title is made from the group's name. | |
10
10
  | **description** | **String** | Help text for the group, added to the template's data schema and shown on forms. | |
11
11
  | **metadata** | **String** | Text for your own use, added to the template's data schema as `x-metadata`. DocSpring doesn't use it. | |
12
12
  | **min_items** | **Integer** | Lists only (`type` `array`): the fewest items submission data must have. Null for no minimum. | |
13
- | **max_items** | **Integer** | HTML templates' lists only: the most items submission data can have. Null for no limit. A PDF template's list takes as many items as its fields are numbered for, or more with `allow_additional_items`. | |
13
+ | **max_items** | **Integer** | HTML and Word templates' lists only: the most items submission data can have. Null for no limit. A PDF template's list takes as many items as its fields are numbered for, or more with `allow_additional_items`. | |
14
14
  | **allow_additional_items** | **Boolean** | PDF templates' lists only: submission data can have more items than the list's fields are numbered for. Default false. | |
15
15
 
16
16
  ## Example
@@ -9,7 +9,7 @@
9
9
  | **description** | **String** | Help text for the group, added to the template's data schema and shown on forms. | [optional] |
10
10
  | **metadata** | **String** | Text for your own use, added to the template's data schema as `x-metadata`. DocSpring doesn't use it. | [optional] |
11
11
  | **min_items** | **Integer** | Lists only (`type` `array`): the fewest items submission data must have. Null for no minimum. | [optional] |
12
- | **max_items** | **Integer** | HTML templates' lists only: the most items submission data can have. Null for no limit. A PDF template's list takes as many items as its fields are numbered for, or more with `allow_additional_items`. | [optional] |
12
+ | **max_items** | **Integer** | HTML and Word templates' lists only: the most items submission data can have. Null for no limit. A PDF template's list takes as many items as its fields are numbered for, or more with `allow_additional_items`. | [optional] |
13
13
  | **allow_additional_items** | **Boolean** | PDF templates' lists only: submission data can have more items than the list's fields are numbered for. Default false. | [optional] |
14
14
 
15
15
  ## Example
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **formats** | [**Array<GenerateFilesFormat>**](GenerateFilesFormat.md) | The formats to add to the submission's files: `png`, an image of each page of the submission's PDF (up to 100 pages). A format the submission already has (or is making) is left as it is. | |
7
+ | **formats** | [**Array<GenerateFilesFormat>**](GenerateFilesFormat.md) | The formats to add to the submission's files: `pdf`, the PDF of a Word template's submission that didn't make one (converted from its Word document); `docx`, the Word document of a Word template's submission that didn't make one (made again from the submission's data and the template version it used); `odt`, the OpenDocument file of a Word template's submission that didn't make one (converted from its Word document); and `png`, an image of each page of the PDF (up to 100 pages), which makes the PDF first if the submission doesn't have one. A submission without a Word document makes it again for `pdf` and `odt`, without keeping it. A format the submission already has (or is making) is left as it is. | |
8
8
 
9
9
  ## Example
10
10
 
@@ -8,8 +8,8 @@
8
8
  | **error_message** | **String** | Why the file couldn't be made, when `state` is `error`. | |
9
9
  | **download_url** | **String** | A temporary link to download the file. Null until the file has been made, and when your account turns off download links for submissions. | |
10
10
  | **permanent_url** | **String** | A link to download the file that doesn't expire: it redirects to a new temporary link. It needs your API token or a signed-in session, except for a submission of a template that makes its submissions public. Null until the file has been made. | |
11
- | **filename** | **String** | The file's name, such as `sub_123.pdf`. | |
12
- | **content_type** | **String** | The file's media type, such as `application/pdf`. | |
11
+ | **filename** | **String** | The file's name, such as `sub_123.pdf`, `sub_123.docx` or `sub_123.odt`. | |
12
+ | **content_type** | **String** | The file's media type: `application/pdf`, `application/vnd.openxmlformats-officedocument.wordprocessingml.document` for a Word document, or `application/vnd.oasis.opendocument.text` for an OpenDocument file. | |
13
13
  | **size** | **Integer** | The file's size in bytes. Null until the file has been made. | |
14
14
  | **sha256** | **String** | The SHA-256 hash of the file. Null until the file has been made. | |
15
15
 
data/docs/Submission.md CHANGED
@@ -6,29 +6,29 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **id** | **String** | The submission's ID. | |
8
8
  | **template_id** | **String** | Null once the template has been permanently deleted. | |
9
- | **template_type** | [**TemplateType**](TemplateType.md) | The template's type: `pdf` or `html`. | |
9
+ | **template_type** | [**TemplateType**](TemplateType.md) | The template's type: `pdf`, `html` or `docx`. | |
10
10
  | **template_version** | **String** | The published version of the template the submission used. Null for the draft. | |
11
11
  | **batch_id** | **String** | The ID of the batch the submission was created in. | |
12
12
  | **source** | [**SubmissionSource**](SubmissionSource.md) | `api`: created with the API. `web`: a web form. `reprocess`: a copy of another submission, made to generate its PDF again. | |
13
- | **state** | [**SubmissionState**](SubmissionState.md) | `pending` until the PDF has been generated, then `processed`. `waiting_for_signature_requests` until every signature request is completed. `insufficient_credits`: waiting for credits; `error_message` says whether the PDF is generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. Waiting ends in `error` if it's discarded or takes over 30 days. Every other state is final, with no PDF: `invalid_data` (the data doesn't match the template's fields: see `data_errors`), `declined` (a signature request was declined), and the states where generating the PDF failed, which have an `error_message`: `syntax_error` (a mistake in an HTML template's Liquid or SCSS), `image_download_failed` or `image_processing_failed` (an image in the data or the template couldn't be downloaded or read) and `error` (anything else). Older submissions can also be `license_revoked` or `accidental`. | |
13
+ | **state** | [**SubmissionState**](SubmissionState.md) | `pending` until the files have been generated, then `processed`. `waiting_for_signature_requests` until every signature request is completed. `insufficient_credits`: waiting for credits; `error_message` says whether the files are generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. Waiting ends in `error` if it's discarded or takes over 30 days. Every other state is final, with no files: `invalid_data` (the data doesn't match the template's fields: see `data_errors`), `declined` (a signature request was declined), and the states where generating the files failed, which have an `error_message`: `syntax_error` (a mistake in an HTML template's Liquid or SCSS, or in a Word template's tags), `image_download_failed` or `image_processing_failed` (an image in the data or the template couldn't be downloaded or read) and `error` (anything else). Older submissions can also be `license_revoked` or `accidental`. | |
14
14
  | **test** | **Boolean** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | |
15
15
  | **editable** | **Boolean** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | |
16
- | **data** | **Hash<String, Object>** | The submission's data, with the values entered in completed signature requests. Lists leave it out (null) unless you pass `include_data=true`. Empty once the submission has expired. | |
16
+ | **data** | **Hash<String, Object>** | The submission's data, with the values entered in completed signature requests. Empty once the submission has expired. Null in a batch's submissions unless you pass `include_data=true`, and in the events of a webhook that leaves out submission data. | |
17
17
  | **data_errors** | [**Array<ErrorDetail>**](ErrorDetail.md) | Why the data doesn't match the template's fields, when `state` is `invalid_data`: the same details as the 422 response that recorded it, with pointers into the request that created the submission (`/data/name`). Cleared once the submission has expired. | |
18
18
  | **error_message** | **String** | Why the PDF couldn't be generated, when `state` is `error`. | |
19
- | **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. | |
20
- | **has_password** | **Boolean** | Whether the PDF needs a password to open (`password`). | |
21
- | **signature_requests** | [**Array<SignatureRequest>**](SignatureRequest.md) | The people asked to sign the submission (and fill in their fields), in order. | |
22
- | **actions** | [**Array<SubmissionAction>**](SubmissionAction.md) | The uploads of the submission's PDF to your storage (account integrations). | |
23
- | **truncated_text** | **Hash<String, Array<String>>** | The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired. | |
24
- | **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission. | |
25
- | **files** | [**SubmissionFiles**](SubmissionFiles.md) | The generated files: `pdf` once the submission has been processed, `png` (the images of the PDF's pages, when `output_formats` has it: `files.png.pages[0]` is page 1), `audit_trail` once its signature requests are completed, and `preview` once a preview PDF has been generated. Empty once the submission has expired. | |
26
- | **preview_generated_at** | **Time** | When the preview PDF was generated. Null if there is no preview. | |
19
+ | **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | |
20
+ | **files** | [**SubmissionFiles**](SubmissionFiles.md) | The generated files: `pdf`, `docx` and `odt` (by `output_formats`) once the submission has been processed, `png` (the images of the PDF's pages, when `output_formats` has it: `files.png.pages[0]` is page 1), `audit_trail` once its signature requests are completed, and `preview` once a preview PDF has been generated. Empty once the submission has expired. | |
27
21
  | **expired** | **Boolean** | An expired submission's data, metadata, password and PDF have been deleted. | |
28
22
  | **expires_at** | **Time** | When the submission expires. Null if it's kept until you delete it. | |
29
23
  | **processed_at** | **Time** | When the PDF was generated. Null until then. | |
30
24
  | **created_at** | **Time** | When the submission was created. | |
31
25
  | **updated_at** | **Time** | When the submission was last updated. | |
26
+ | **has_password** | **Boolean** | Whether the PDF needs a password to open (`password`). | |
27
+ | **signature_requests** | [**Array<SignatureRequest>**](SignatureRequest.md) | The people asked to sign the submission (and fill in their fields), in order. | |
28
+ | **actions** | [**Array<SubmissionAction>**](SubmissionAction.md) | The uploads of the submission's PDF to your storage (account integrations). | |
29
+ | **truncated_text** | **Hash<String, Array<String>>** | The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired. | |
30
+ | **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, `docx` (a Word document, from a Word template), `odt` (an OpenDocument file, the format LibreOffice uses, converted from a Word template's Word document), and `png` (an image of each page of the PDF, up to 100 pages, which adds `pdf`) when you ask for it. Default `["pdf"]`, or a Word template's `output_format`. POST /submissions/{submission_id}/generate_files adds `png`, and a Word template's submission's `pdf`, `docx` or `odt`, to a processed submission. | |
31
+ | **preview_generated_at** | **Time** | When the preview PDF was generated. Null if there is no preview. | |
32
32
 
33
33
  ## Example
34
34
 
@@ -49,18 +49,18 @@ instance = DocSpring::Submission.new(
49
49
  data_errors: null,
50
50
  error_message: null,
51
51
  metadata: null,
52
- has_password: null,
53
- signature_requests: null,
54
- actions: null,
55
- truncated_text: null,
56
- output_formats: null,
57
52
  files: null,
58
- preview_generated_at: null,
59
53
  expired: null,
60
54
  expires_at: null,
61
55
  processed_at: null,
62
56
  created_at: null,
63
- updated_at: null
57
+ updated_at: null,
58
+ has_password: null,
59
+ signature_requests: null,
60
+ actions: null,
61
+ truncated_text: null,
62
+ output_formats: null,
63
+ preview_generated_at: null
64
64
  )
65
65
  ```
66
66
 
@@ -5,11 +5,11 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **id** | **String** | The batch's ID. | |
8
- | **state** | [**SubmissionBatchState**](SubmissionBatchState.md) | `pending` while the PDFs are being generated, then `processed`. `error` as soon as a submission fails, while the others can still be pending: the batch has finished once `processed_at` is set. | |
8
+ | **state** | [**SubmissionBatchState**](SubmissionBatchState.md) | `pending` while the files are being generated, then `processed`. `error` as soon as a submission fails, while the others can still be pending: the batch has finished once `processed_at` is set. | |
9
9
  | **metadata** | **Hash<String, Object>** | Your own data about the batch, such as an ID from your app. | |
10
10
  | **total_count** | **Integer** | The number of submissions in the request. | |
11
- | **pending_count** | **Integer** | The submissions whose PDFs haven't been generated yet. | |
12
- | **error_count** | **Integer** | The submissions that were invalid or whose PDFs couldn't be generated. | |
11
+ | **pending_count** | **Integer** | The submissions whose files haven't been generated yet. | |
12
+ | **error_count** | **Integer** | The submissions that were invalid or whose files couldn't be generated. | |
13
13
  | **completion_percentage** | **Integer** | The percentage of the batch's submissions that have finished, from 0 to 100. | |
14
14
  | **submissions** | [**Array<Submission>**](Submission.md) | The batch's submissions, in the order of the request. Their `data` is null unless you pass `include_data=true`. A batch that failed validation only has the submissions that were recorded as `invalid_data`. | |
15
15
  | **processed_at** | **Time** | When every submission had finished. | |
@@ -7,6 +7,8 @@
7
7
  | **pdf** | [**GeneratedFile**](GeneratedFile.md) | The submission's PDF. | [optional] |
8
8
  | **audit_trail** | [**GeneratedFile**](GeneratedFile.md) | The audit trail of a submission with signature requests: who signed, when and how. It's also added to the end of the PDF when the template's `merge_audit_trail_pdf` is on. | [optional] |
9
9
  | **preview** | [**GeneratedFile**](GeneratedFile.md) | The preview PDF from POST /submissions/{submission_id}/generate_preview, such as for a submission still waiting for its signature requests. | [optional] |
10
+ | **docx** | [**GeneratedFile**](GeneratedFile.md) | The Word document of a Word template's submission, when the submission makes one (`output_formats`). | [optional] |
11
+ | **odt** | [**GeneratedFile**](GeneratedFile.md) | The OpenDocument file (.odt, the format LibreOffice uses) of a Word template's submission, converted from its Word document, when the submission makes one (`output_formats`). | [optional] |
10
12
  | **png** | [**PageImages**](PageImages.md) | | [optional] |
11
13
 
12
14
  ## Example
@@ -18,6 +20,8 @@ instance = DocSpring::SubmissionFiles.new(
18
20
  pdf: null,
19
21
  audit_trail: null,
20
22
  preview: null,
23
+ docx: null,
24
+ odt: null,
21
25
  png: null
22
26
  )
23
27
  ```
@@ -6,14 +6,14 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **test** | **Boolean** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | [optional] |
8
8
  | **editable** | **Boolean** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | [optional] |
9
- | **data** | **Hash<String, Object>** | The values of the template's fields, by field name. Required for a PDF template. | [optional] |
10
- | **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. | [optional] |
11
- | **password** | **String** | A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. | [optional] |
12
- | **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission. | [optional] |
9
+ | **data** | **Hash<String, Object>** | The values of the template's fields, by field name. Required for PDF and Word templates. | [optional] |
10
+ | **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | [optional] |
11
+ | **password** | **String** | A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. Word documents and OpenDocument files can't be password-protected, so a submission with a password can't make them. | [optional] |
12
+ | **output_formats** | [**Array<OutputFormat>**](OutputFormat.md) | What the submission makes: `pdf`, `docx` (a Word document, from a Word template), `odt` (an OpenDocument file, the format LibreOffice uses, converted from a Word template's Word document), and `png` (an image of each page of the PDF, up to 100 pages, which adds `pdf`) when you ask for it. Default `["pdf"]`, or a Word template's `output_format`. POST /submissions/{submission_id}/generate_files adds `png`, and a Word template's submission's `pdf`, `docx` or `odt`, to a processed submission. | [optional] |
13
13
  | **expires_in** | **Integer** | Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours. | [optional] |
14
14
  | **field_overrides** | [**Hash<String, FieldOverride>**](FieldOverride.md) | Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. With `signature_requests`, `editable: true` is a 422, and a `default` for a signature or initials field makes the submission `invalid_data`. | [optional] |
15
15
  | **html** | **String** | For an HTML template, HTML to use instead of the template's. | [optional] |
16
- | **css** | **String** | For an HTML template, CSS to use instead of the template's. | [optional] |
16
+ | **css** | **String** | For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity. | [optional] |
17
17
  | **template_id** | **String** | The submission's template. Default the batch's `template_id`. | [optional] |
18
18
  | **template_version** | **String** | The version of the submission's template. Default the batch's `template_version`. | [optional] |
19
19
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **data** | [**Array<Submission>**](Submission.md) | The items on this page. | |
7
+ | **data** | [**Array<SubmissionSummary>**](SubmissionSummary.md) | The items on this page. | |
8
8
  | **next_cursor** | **String** | Pass it as `cursor` to get the next page. Null on the last page. | |
9
9
 
10
10
  ## Example
@@ -0,0 +1,54 @@
1
+ # DocSpring::SubmissionSummary
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | The submission's ID. | |
8
+ | **template_id** | **String** | Null once the template has been permanently deleted. | |
9
+ | **template_type** | [**TemplateType**](TemplateType.md) | The template's type: `pdf`, `html` or `docx`. | |
10
+ | **template_version** | **String** | The published version of the template the submission used. Null for the draft. | |
11
+ | **batch_id** | **String** | The ID of the batch the submission was created in. | |
12
+ | **source** | [**SubmissionSource**](SubmissionSource.md) | `api`: created with the API. `web`: a web form. `reprocess`: a copy of another submission, made to generate its PDF again. | |
13
+ | **state** | [**SubmissionState**](SubmissionState.md) | `pending` until the files have been generated, then `processed`. `waiting_for_signature_requests` until every signature request is completed. `insufficient_credits`: waiting for credits; `error_message` says whether the files are generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. Waiting ends in `error` if it's discarded or takes over 30 days. Every other state is final, with no files: `invalid_data` (the data doesn't match the template's fields: see `data_errors`), `declined` (a signature request was declined), and the states where generating the files failed, which have an `error_message`: `syntax_error` (a mistake in an HTML template's Liquid or SCSS, or in a Word template's tags), `image_download_failed` or `image_processing_failed` (an image in the data or the template couldn't be downloaded or read) and `error` (anything else). Older submissions can also be `license_revoked` or `accidental`. | |
14
+ | **test** | **Boolean** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | |
15
+ | **editable** | **Boolean** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | |
16
+ | **data** | **Hash<String, Object>** | The submission's data, with the values entered in completed signature requests. Null unless you pass `include_data=true`. Empty once the submission has expired. | |
17
+ | **data_errors** | [**Array<ErrorDetail>**](ErrorDetail.md) | Why the data doesn't match the template's fields, when `state` is `invalid_data`: the same details as the 422 response that recorded it, with pointers into the request that created the submission (`/data/name`). Cleared once the submission has expired. | |
18
+ | **error_message** | **String** | Why the PDF couldn't be generated, when `state` is `error`. | |
19
+ | **metadata** | **Hash<String, Object>** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | |
20
+ | **files** | [**SubmissionFiles**](SubmissionFiles.md) | Empty unless you pass `include_files=true`: then the generated files, as when you get the submission, without the `png` pages' links (`files.png.pages` is null). Get the submission for its page images. | |
21
+ | **expired** | **Boolean** | An expired submission's data, metadata, password and PDF have been deleted. | |
22
+ | **expires_at** | **Time** | When the submission expires. Null if it's kept until you delete it. | |
23
+ | **processed_at** | **Time** | When the PDF was generated. Null until then. | |
24
+ | **created_at** | **Time** | When the submission was created. | |
25
+ | **updated_at** | **Time** | When the submission was last updated. | |
26
+
27
+ ## Example
28
+
29
+ ```ruby
30
+ require 'docspring'
31
+
32
+ instance = DocSpring::SubmissionSummary.new(
33
+ id: null,
34
+ template_id: null,
35
+ template_type: null,
36
+ template_version: null,
37
+ batch_id: null,
38
+ source: null,
39
+ state: null,
40
+ test: null,
41
+ editable: null,
42
+ data: null,
43
+ data_errors: null,
44
+ error_message: null,
45
+ metadata: null,
46
+ files: null,
47
+ expired: null,
48
+ expires_at: null,
49
+ processed_at: null,
50
+ created_at: null,
51
+ updated_at: null
52
+ )
53
+ ```
54
+
data/docs/Template.md CHANGED
@@ -7,50 +7,52 @@
7
7
  | **id** | **String** | The template's ID. | |
8
8
  | **name** | **String** | The template's name. | |
9
9
  | **description** | **String** | Shown under the template's name at the top of its hosted forms, and used as their meta description. Not shown on embedded forms or signature requests. | |
10
- | **template_type** | [**TemplateType**](TemplateType.md) | `pdf`: fields placed on an uploaded PDF. `html`: a PDF rendered from HTML and SCSS. It can't be changed after the template is created. | |
11
- | **ready** | **Boolean** | Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once its document has been processed (`document.state` is `processed`). | |
12
- | **document** | [**TemplateDocument**](TemplateDocument.md) | The PDF of a PDF template. Null for HTML templates, and for a PDF template that has no PDF yet. | |
10
+ | **template_type** | [**TemplateType**](TemplateType.md) | `pdf`: fields placed on an uploaded PDF. `html`: a PDF rendered from HTML and SCSS. `docx`: a Word document with tags where the data goes, which makes Word documents or PDFs. It can't be changed after the template is created. | |
11
+ | **output_format** | [**OutputFormat**](OutputFormat.md) | What each submission makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. A Word template's is chosen when it's created; PDF and HTML templates always make PDFs. A Word template that encrypts its PDFs makes PDFs, because Word documents and OpenDocument files can't be password-protected. | |
12
+ | **ready** | **Boolean** | Whether the template can make documents. HTML templates are always ready. A PDF template is ready once DocSpring has stored its PDF, made an image of each page and finished looking for fields on each page, which can be after `document.state` becomes `processed`. A PDF template with no PDF (`document` is null) isn't ready. A Word template is ready once it has a Word document (a `document_url`'s has been downloaded). | |
13
+ | **document** | [**TemplateDocument**](TemplateDocument.md) | The PDF of a PDF template, or the Word document of a Word template. Null for HTML templates, and for a PDF template that has no PDF yet. A template created from a `document_url` has one, with no file, while it's downloaded. | |
13
14
  | **parent_folder_id** | **String** | The ID of the folder the template is in. Null for a template at the root. Setting it moves the template and all of its published versions. | |
14
15
  | **path** | **String** | The path of the folder the template is in, such as `/Contracts`. `/` for a template at the root. | |
15
- | **version** | **String** | The published version this is, such as `1.2.0`. Null for the draft. | |
16
16
  | **latest_version** | **String** | The template's latest published version. Null if no version has been published. | |
17
17
  | **version_published_at** | **Time** | When this version was published. Null for the draft. | |
18
18
  | **locked** | **Boolean** | A locked template can't be changed or deleted until it's unlocked (`locked` can always be changed). | |
19
+ | **last_changed_at** | **Time** | When the draft was last changed. | |
20
+ | **created_at** | **Time** | When the template was created. | |
21
+ | **updated_at** | **Time** | When the template was last updated. | |
22
+ | **version** | **String** | The published version this is, such as `1.2.0`. Null for the draft. | |
19
23
  | **add_signature_request_submission_id_footers** | **Boolean** | Print the submission ID in the footer of each page of PDFs signed through signature requests. | |
20
24
  | **ai_field_naming_language** | [**AiFieldNamingLanguage**](AiFieldNamingLanguage.md) | The language AI field setup names fields in: `auto` uses the form's language when it's written in the Latin alphabet without accents, and English otherwise; `english` always uses English; `form_language` uses the form's language and script. New templates take it from your account's template settings. Null for HTML templates. | |
21
25
  | **allow_additional_properties** | **Boolean** | Accept submission data with properties that aren't fields of the template. | |
22
26
  | **allow_skipping_optional_fields** | **Boolean** | Visual forms and signature request forms show the Continue button as soon as the required fields are filled in, without visiting each optional field. The `allowSkippingOptionalFields` embed option overrides it. | |
23
- | **default_form_mode** | [**TemplateFormMode**](TemplateFormMode.md) | The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). HTML templates have no visual form, so `web` is the only value they accept. | |
27
+ | **default_form_mode** | [**TemplateFormMode**](TemplateFormMode.md) | The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). Only PDF templates have a visual form, so other templates accept only `web`. | |
24
28
  | **editable_submissions** | **Boolean** | Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it. | |
25
- | **embed_domains** | **Array<String>** | The sites where the template's signature requests, forms and embedded template editor can be loaded: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). When it's empty, live signature requests don't load on any site, and the embedded template editor loads on every site. | |
29
+ | **embed_domains** | **Array<String>** | The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted. | |
26
30
  | **embed_edit_allow_settings** | **Boolean** | Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on). | |
27
31
  | **embed_edit_allow_versioning** | **Boolean** | Allow the embedded template editor to publish, restore, compare and delete published versions. | |
28
32
  | **embed_edit_allow_document_replacement** | **Boolean** | Allow the embedded template editor to replace the template's PDF. | |
29
- | **encrypt_pdfs** | **Boolean** | Encrypt generated PDFs with `encrypt_pdfs_password`. | |
33
+ | **encrypt_pdfs** | **Boolean** | Encrypt generated PDFs with `encrypt_pdfs_password`. A Word template can only encrypt its PDFs when its `output_format` is `pdf`, because Word documents and OpenDocument files can't be password-protected. | |
30
34
  | **has_encrypt_pdfs_password** | **Boolean** | Whether `encrypt_pdfs_password` is set. | |
31
35
  | **expire_submissions** | **Boolean** | Delete each submission's data and PDF after `expire_after` `expiration_interval`. | |
32
36
  | **expire_after** | **Integer** | How many `expiration_interval`s a submission's data and PDF are kept for, when `expire_submissions` is on. At most 5256000 (10 years in minutes). | |
33
37
  | **expiration_interval** | [**ExpirationInterval**](ExpirationInterval.md) | The unit of `expire_after`. | |
34
38
  | **merge_audit_trail_pdf** | **Boolean** | Add the audit trail to the end of PDFs signed through signature requests. | |
35
- | **parse_dates_using_template_date_format** | **Boolean** | Date fields also accept NN/NN/YYYY dates (with slashes, dashes or dots), read in the order of the template's default date format: month first for %m/%d/%Y, day first for %d/%m/%Y. When false, date fields only accept YYYY-MM-DD. Applies to PDF templates: an HTML template's date fields only accept YYYY-MM-DD. Date fields that include a time take RFC 3339 date-times either way. | |
39
+ | **parse_dates_using_template_date_format** | **Boolean** | Date fields also accept NN/NN/YYYY dates (with slashes, dashes or dots), read in the order of the template's default date format: month first for %m/%d/%Y, day first for %d/%m/%Y. When false, date fields only accept YYYY-MM-DD. Applies to PDF templates: an HTML or Word template's date fields only accept YYYY-MM-DD. Date fields that include a time take RFC 3339 date-times either way. | |
36
40
  | **public_submissions** | **Boolean** | Allow anyone with a submission's ID to download its PDF. | |
37
41
  | **public_web_form** | **Boolean** | Allow anyone to fill in the template's web form. | |
38
42
  | **redirect_url** | **String** | Where the web form sends people after they submit it. | |
39
43
  | **has_slack_webhook_url** | **Boolean** | Whether `slack_webhook_url` is set. | |
40
- | **last_changed_at** | **Time** | When the draft was last changed. | |
41
44
  | **last_changed_by** | [**TemplateActor**](TemplateActor.md) | Who last changed the draft: a user in your account, an API token, or someone using the embedded template editor. Null if no change has been recorded. | |
42
- | **created_at** | **Time** | When the template was created. | |
43
- | **updated_at** | **Time** | When the template was last updated. | |
44
45
  | **defaults** | [**TemplateDefaults**](TemplateDefaults.md) | | |
45
46
  | **field_dependencies** | [**Array<TemplateFieldDependency>**](TemplateFieldDependency.md) | Conditional logic: each rule shows or hides its target fields, or makes them required, depending on the values of other fields. | |
46
47
  | **field_groups** | [**Array<FieldGroup>**](FieldGroup.md) | The groups of the template's fields, with their settings. A field's name puts it in groups: `address/city` is in the group `address`, and `items/0/price` is in the list `items` and its items' group `items/~`. | |
47
48
  | **predefined_fields** | [**Array<PredefinedField>**](PredefinedField.md) | The field names that people using the embedded template editor choose from, each with the data type and settings a field gets when it's given that name. Setting it replaces the whole list; an empty list turns them off. | |
48
49
  | **predefined_fields_sample_data** | **Hash<String, Object>** | Sample submission data that sets `predefined_fields`: each value becomes a predefined field, with a type that fits it (`string`, `number`, `boolean`, `date`, `email` or `url`) and `required_in_template` true. Nested objects and arrays become names with `/`, such as `customer/email`. Without `predefined_fields` in the same request, it replaces them; with them, it adds to them and sets the types of the ones it has values for. | |
49
- | **html** | **String** | The HTML of an HTML template, as a Liquid template. Null for PDF templates. | |
50
+ | **html** | **String** | The HTML of an HTML template, as a Liquid template. Null for PDF and Word templates. | |
50
51
  | **scss** | **String** | The SCSS of an HTML template. | |
51
52
  | **header_html** | **String** | The HTML printed at the top of each page of an HTML template. | |
52
53
  | **footer_html** | **String** | The HTML printed at the bottom of each page of an HTML template. | |
53
- | **html_engine_options** | [**HtmlEngineOptions**](HtmlEngineOptions.md) | How an HTML template's PDFs are printed. Null for PDF templates. Setting it replaces the whole object: options left out use their defaults. | |
54
+ | **html_engine_options** | [**HtmlEngineOptions**](HtmlEngineOptions.md) | How an HTML template's PDFs are printed. Null for PDF and Word templates. Setting it replaces the whole object: options left out use their defaults. | |
55
+ | **html_escape_data** | **Boolean** | Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for PDF templates. | |
54
56
  | **embed_edit_token** | **String** | The token that opens the template in the embedded template editor. | |
55
57
  | **versions** | [**Array<TemplateVersion>**](TemplateVersion.md) | The template's published versions, newest first (up to 100). | |
56
58
 
@@ -64,14 +66,18 @@ instance = DocSpring::Template.new(
64
66
  name: null,
65
67
  description: null,
66
68
  template_type: null,
69
+ output_format: null,
67
70
  ready: null,
68
71
  document: null,
69
72
  parent_folder_id: null,
70
73
  path: null,
71
- version: null,
72
74
  latest_version: null,
73
75
  version_published_at: null,
74
76
  locked: null,
77
+ last_changed_at: null,
78
+ created_at: null,
79
+ updated_at: null,
80
+ version: null,
75
81
  add_signature_request_submission_id_footers: null,
76
82
  ai_field_naming_language: null,
77
83
  allow_additional_properties: null,
@@ -93,10 +99,7 @@ instance = DocSpring::Template.new(
93
99
  public_web_form: null,
94
100
  redirect_url: null,
95
101
  has_slack_webhook_url: null,
96
- last_changed_at: null,
97
102
  last_changed_by: null,
98
- created_at: null,
99
- updated_at: null,
100
103
  defaults: null,
101
104
  field_dependencies: null,
102
105
  field_groups: null,
@@ -107,6 +110,7 @@ instance = DocSpring::Template.new(
107
110
  header_html: null,
108
111
  footer_html: null,
109
112
  html_engine_options: null,
113
+ html_escape_data: null,
110
114
  embed_edit_token: null,
111
115
  versions: null
112
116
  )
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **type** | [**TemplateActorType**](TemplateActorType.md) | `user`: a user in your account. `api`: an API token. `external_user`: someone using the embedded template editor, as identified by your app. | |
7
+ | **type** | [**TemplateActorType**](TemplateActorType.md) | `user`: a user in your account, also when they make the change with an app they connected (an OAuth access token). `api`: an API token. `external_user`: someone using the embedded template editor, as identified by your app. | |
8
8
  | **user_id** | **String** | The user's ID, for `user`. | |
9
9
  | **external_id** | **String** | The ID your app gave the embedded editor's user, for `external_user`. | |
10
10
  | **name** | **String** | The user's name, or the name your app gave the embedded editor's user. | |