-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.java
More file actions
2343 lines (2218 loc) · 139 KB
/
Client.java
File metadata and controls
2343 lines (2218 loc) · 139 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package com.docspring;
import com.docspring.ApiException;
import com.docspring.ApiClient;
import com.docspring.ApiResponse;
import com.docspring.Configuration;
import com.docspring.Pair;
import javax.ws.rs.core.GenericType;
import com.docspring.AddFieldsData;
import com.docspring.BatchGeneratePdfs201Response;
import com.docspring.CombinePdfsData;
import com.docspring.CombinedSubmission;
import com.docspring.CopyTemplateOptions;
import com.docspring.CreateCombinedSubmissionResponse;
import com.docspring.CreateCustomFileData;
import com.docspring.CreateCustomFileResponse;
import com.docspring.CreateFolderData;
import com.docspring.CreateHtmlTemplate;
import com.docspring.CreatePdfSubmissionData;
import com.docspring.CreatePdfTemplate;
import com.docspring.CreateSubmissionDataRequestEventRequest;
import com.docspring.CreateSubmissionDataRequestEventResponse;
import com.docspring.CreateSubmissionDataRequestResponse;
import com.docspring.CreateSubmissionDataRequestTokenResponse;
import com.docspring.CreateSubmissionResponse;
import com.docspring.ErrorOrMultipleErrorsResponse;
import com.docspring.ErrorResponse;
import java.io.File;
import com.docspring.Folder;
import com.docspring.JsonSchema;
import com.docspring.ListSubmissionsResponse;
import com.docspring.MoveFolderData;
import com.docspring.MoveTemplateData;
import com.docspring.MultipleErrorsResponse;
import com.docspring.PublishVersionData;
import com.docspring.RenameFolderData;
import com.docspring.RestoreVersionData;
import com.docspring.Submission;
import com.docspring.Submission422Response;
import com.docspring.SubmissionBatchData;
import com.docspring.SubmissionBatchWithSubmissions;
import com.docspring.SubmissionDataRequestShow;
import com.docspring.SubmissionPreview;
import com.docspring.SuccessErrorResponse;
import com.docspring.SuccessMultipleErrorsResponse;
import com.docspring.Template;
import com.docspring.TemplateAddFieldsResponse;
import com.docspring.TemplateDeleteResponse;
import com.docspring.TemplatePreview;
import com.docspring.TemplatePublishVersionResponse;
import com.docspring.UpdateHtmlTemplate;
import com.docspring.UpdatePdfTemplate;
import com.docspring.UpdateSubmissionDataRequestData;
import com.docspring.UploadPresignResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0-DOCSPRING")
public class Client {
private ApiClient apiClient;
public Client() {
this(Configuration.getDefaultApiClient());
}
public Client(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get the API client
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API client
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Add new fields to a Template
* Adds fields to a PDF template. Configure field types, positions, defaults, and formatting options.
* @param templateId (required)
* @param data (required)
* @return TemplateAddFieldsResponse
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> add fields success </td><td> - </td></tr>
<tr><td> 422 </td><td> add fields error </td><td> - </td></tr>
</table>
* View the field schema to see all available properties and types
* @see <a href="https://docspring.com/docs/reference/field-schema/">Add new fields to a Template Documentation</a>
*/
public TemplateAddFieldsResponse addFieldsToTemplate(@javax.annotation.Nonnull String templateId, @javax.annotation.Nonnull AddFieldsData data) throws ApiException {
return addFieldsToTemplateWithHttpInfo(templateId, data).getData();
}
/**
* Add new fields to a Template
* Adds fields to a PDF template. Configure field types, positions, defaults, and formatting options.
* @param templateId (required)
* @param data (required)
* @return ApiResponse<TemplateAddFieldsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> add fields success </td><td> - </td></tr>
<tr><td> 422 </td><td> add fields error </td><td> - </td></tr>
</table>
* View the field schema to see all available properties and types
* @see <a href="https://docspring.com/docs/reference/field-schema/">Add new fields to a Template Documentation</a>
*/
public ApiResponse<TemplateAddFieldsResponse> addFieldsToTemplateWithHttpInfo(@javax.annotation.Nonnull String templateId, @javax.annotation.Nonnull AddFieldsData data) throws ApiException {
// Check required parameters
if (templateId == null) {
throw new ApiException(400, "Missing the required parameter 'templateId' when calling addFieldsToTemplate");
}
if (data == null) {
throw new ApiException(400, "Missing the required parameter 'data' when calling addFieldsToTemplate");
}
// Path parameters
String localVarPath = "/templates/{template_id}/add_fields"
.replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString()));
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<TemplateAddFieldsResponse> localVarReturnType = new GenericType<TemplateAddFieldsResponse>() {};
return apiClient.invokeAPI("Client.addFieldsToTemplate", localVarPath, "PUT", new ArrayList<>(), data,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Generate multiple PDFs
* Generates up to 50 PDFs in a single request. Each submission can use a different template and data. Supports both synchronous (wait for all PDFs) and asynchronous processing. More efficient than individual requests when creating multiple PDFs. See also: - [Batch and Combine PDFs](https://docspring.com/docs/api-guide/generate-pdfs/batch-generate-pdfs/) - Generate and merge PDFs in one request
* @param data (required)
* @param wait Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional, default to true)
* @return BatchGeneratePdfs201Response
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> submissions created </td><td> - </td></tr>
<tr><td> 200 </td><td> some PDFs with invalid data </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
<tr><td> 422 </td><td> array of arrays </td><td> - </td></tr>
<tr><td> 400 </td><td> invalid JSON </td><td> - </td></tr>
</table>
* Learn more about generating multiple PDFs in batches
* @see <a href="https://docspring.com/docs/api-guide/generate-pdfs/batch-generate-pdfs/">Generate multiple PDFs Documentation</a>
*/
public BatchGeneratePdfs201Response batchGeneratePdfs(@javax.annotation.Nonnull SubmissionBatchData data, @javax.annotation.Nullable Boolean wait) throws ApiException {
return batchGeneratePdfsWithHttpInfo(data, wait).getData();
}
/**
* Generate multiple PDFs
* Generates up to 50 PDFs in a single request. Each submission can use a different template and data. Supports both synchronous (wait for all PDFs) and asynchronous processing. More efficient than individual requests when creating multiple PDFs. See also: - [Batch and Combine PDFs](https://docspring.com/docs/api-guide/generate-pdfs/batch-generate-pdfs/) - Generate and merge PDFs in one request
* @param data (required)
* @param wait Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional, default to true)
* @return ApiResponse<BatchGeneratePdfs201Response>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> submissions created </td><td> - </td></tr>
<tr><td> 200 </td><td> some PDFs with invalid data </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
<tr><td> 422 </td><td> array of arrays </td><td> - </td></tr>
<tr><td> 400 </td><td> invalid JSON </td><td> - </td></tr>
</table>
* Learn more about generating multiple PDFs in batches
* @see <a href="https://docspring.com/docs/api-guide/generate-pdfs/batch-generate-pdfs/">Generate multiple PDFs Documentation</a>
*/
public ApiResponse<BatchGeneratePdfs201Response> batchGeneratePdfsWithHttpInfo(@javax.annotation.Nonnull SubmissionBatchData data, @javax.annotation.Nullable Boolean wait) throws ApiException {
// Check required parameters
if (data == null) {
throw new ApiException(400, "Missing the required parameter 'data' when calling batchGeneratePdfs");
}
// Query parameters
List<Pair> localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "wait", wait)
);
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<BatchGeneratePdfs201Response> localVarReturnType = new GenericType<BatchGeneratePdfs201Response>() {};
return apiClient.invokeAPI("Client.batchGeneratePdfs", "/submissions/batches", "POST", localVarQueryParams, data,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Merge submission PDFs, template PDFs, or custom files
* Combines multiple PDFs from various sources into a single PDF file. Supports merging submission PDFs, template PDFs, custom files, other merged PDFs, and PDFs from URLs. Merges the PDFs in the order provided.
* @param data (required)
* @return CreateCombinedSubmissionResponse
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> combined submission created </td><td> - </td></tr>
<tr><td> 422 </td><td> invalid request </td><td> - </td></tr>
<tr><td> 400 </td><td> invalid JSON </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Complete guide to combining PDFs with DocSpring
* @see <a href="https://docspring.com/docs/api-guide/combine-pdfs/">Merge submission PDFs, template PDFs, or custom files Documentation</a>
*/
public CreateCombinedSubmissionResponse combinePdfs(@javax.annotation.Nonnull CombinePdfsData data) throws ApiException {
return combinePdfsWithHttpInfo(data).getData();
}
/**
* Merge submission PDFs, template PDFs, or custom files
* Combines multiple PDFs from various sources into a single PDF file. Supports merging submission PDFs, template PDFs, custom files, other merged PDFs, and PDFs from URLs. Merges the PDFs in the order provided.
* @param data (required)
* @return ApiResponse<CreateCombinedSubmissionResponse>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> combined submission created </td><td> - </td></tr>
<tr><td> 422 </td><td> invalid request </td><td> - </td></tr>
<tr><td> 400 </td><td> invalid JSON </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Complete guide to combining PDFs with DocSpring
* @see <a href="https://docspring.com/docs/api-guide/combine-pdfs/">Merge submission PDFs, template PDFs, or custom files Documentation</a>
*/
public ApiResponse<CreateCombinedSubmissionResponse> combinePdfsWithHttpInfo(@javax.annotation.Nonnull CombinePdfsData data) throws ApiException {
// Check required parameters
if (data == null) {
throw new ApiException(400, "Missing the required parameter 'data' when calling combinePdfs");
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<CreateCombinedSubmissionResponse> localVarReturnType = new GenericType<CreateCombinedSubmissionResponse>() {};
return apiClient.invokeAPI("Client.combinePdfs", "/combined_submissions", "POST", new ArrayList<>(), data,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Copy a template
* Creates a copy of an existing template with all its fields and configuration. Optionally specify a new name and target folder. The copied template starts as a new draft that can be modified independently of the original.
* @param templateId (required)
* @param options (optional)
* @return TemplatePreview
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> copy template success </td><td> - </td></tr>
<tr><td> 404 </td><td> folder not found </td><td> - </td></tr>
</table>
*/
public TemplatePreview copyTemplate(@javax.annotation.Nonnull String templateId, @javax.annotation.Nullable CopyTemplateOptions options) throws ApiException {
return copyTemplateWithHttpInfo(templateId, options).getData();
}
/**
* Copy a template
* Creates a copy of an existing template with all its fields and configuration. Optionally specify a new name and target folder. The copied template starts as a new draft that can be modified independently of the original.
* @param templateId (required)
* @param options (optional)
* @return ApiResponse<TemplatePreview>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> copy template success </td><td> - </td></tr>
<tr><td> 404 </td><td> folder not found </td><td> - </td></tr>
</table>
*/
public ApiResponse<TemplatePreview> copyTemplateWithHttpInfo(@javax.annotation.Nonnull String templateId, @javax.annotation.Nullable CopyTemplateOptions options) throws ApiException {
// Check required parameters
if (templateId == null) {
throw new ApiException(400, "Missing the required parameter 'templateId' when calling copyTemplate");
}
// Path parameters
String localVarPath = "/templates/{template_id}/copy"
.replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString()));
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<TemplatePreview> localVarReturnType = new GenericType<TemplatePreview>() {};
return apiClient.invokeAPI("Client.copyTemplate", localVarPath, "POST", new ArrayList<>(), options,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create a new custom file from a cached S3 upload
* The Custom Files API endpoint allows you to upload PDFs to DocSpring and then merge them with other PDFs. First upload your file using the presigned URL endpoint, then use the returned cache_id to create the custom file.
* @param data (required)
* @return CreateCustomFileResponse
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> returns the custom file </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Learn how to merge custom files with other PDFs
* @see <a href="https://docspring.com/docs/api-guide/combine-pdfs/">Create a new custom file from a cached S3 upload Documentation</a>
*/
public CreateCustomFileResponse createCustomFileFromUpload(@javax.annotation.Nonnull CreateCustomFileData data) throws ApiException {
return createCustomFileFromUploadWithHttpInfo(data).getData();
}
/**
* Create a new custom file from a cached S3 upload
* The Custom Files API endpoint allows you to upload PDFs to DocSpring and then merge them with other PDFs. First upload your file using the presigned URL endpoint, then use the returned cache_id to create the custom file.
* @param data (required)
* @return ApiResponse<CreateCustomFileResponse>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> returns the custom file </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Learn how to merge custom files with other PDFs
* @see <a href="https://docspring.com/docs/api-guide/combine-pdfs/">Create a new custom file from a cached S3 upload Documentation</a>
*/
public ApiResponse<CreateCustomFileResponse> createCustomFileFromUploadWithHttpInfo(@javax.annotation.Nonnull CreateCustomFileData data) throws ApiException {
// Check required parameters
if (data == null) {
throw new ApiException(400, "Missing the required parameter 'data' when calling createCustomFileFromUpload");
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<CreateCustomFileResponse> localVarReturnType = new GenericType<CreateCustomFileResponse>() {};
return apiClient.invokeAPI("Client.createCustomFileFromUpload", "/custom_files", "POST", new ArrayList<>(), data,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create a new event for emailing a signee a request for signature
* Records user notification events for data requests. Use this to create an audit trail showing when and how users were notified about data request forms. Supports email, SMS, and other notification types. Records the notification time for compliance tracking. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/) - User notification workflow
* @param dataRequestId (required)
* @param event (required)
* @return CreateSubmissionDataRequestEventResponse
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> event created </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
<tr><td> 422 </td><td> message recipient must not be blank </td><td> - </td></tr>
</table>
* Track user notification events for audit trail logging
* @see <a href="https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/#2-notify-the-user">Create a new event for emailing a signee a request for signature Documentation</a>
*/
public CreateSubmissionDataRequestEventResponse createDataRequestEvent(@javax.annotation.Nonnull String dataRequestId, @javax.annotation.Nonnull CreateSubmissionDataRequestEventRequest event) throws ApiException {
return createDataRequestEventWithHttpInfo(dataRequestId, event).getData();
}
/**
* Create a new event for emailing a signee a request for signature
* Records user notification events for data requests. Use this to create an audit trail showing when and how users were notified about data request forms. Supports email, SMS, and other notification types. Records the notification time for compliance tracking. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/) - User notification workflow
* @param dataRequestId (required)
* @param event (required)
* @return ApiResponse<CreateSubmissionDataRequestEventResponse>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> event created </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
<tr><td> 422 </td><td> message recipient must not be blank </td><td> - </td></tr>
</table>
* Track user notification events for audit trail logging
* @see <a href="https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/#2-notify-the-user">Create a new event for emailing a signee a request for signature Documentation</a>
*/
public ApiResponse<CreateSubmissionDataRequestEventResponse> createDataRequestEventWithHttpInfo(@javax.annotation.Nonnull String dataRequestId, @javax.annotation.Nonnull CreateSubmissionDataRequestEventRequest event) throws ApiException {
// Check required parameters
if (dataRequestId == null) {
throw new ApiException(400, "Missing the required parameter 'dataRequestId' when calling createDataRequestEvent");
}
if (event == null) {
throw new ApiException(400, "Missing the required parameter 'event' when calling createDataRequestEvent");
}
// Path parameters
String localVarPath = "/data_requests/{data_request_id}/events"
.replaceAll("\\{data_request_id}", apiClient.escapeString(dataRequestId.toString()));
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<CreateSubmissionDataRequestEventResponse> localVarReturnType = new GenericType<CreateSubmissionDataRequestEventResponse>() {};
return apiClient.invokeAPI("Client.createDataRequestEvent", localVarPath, "POST", new ArrayList<>(), event,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create a new data request token for form authentication
* Creates an authentication token for accessing a data request form. Tokens can be created for API access (1 hour expiration) or email links (30 day expiration). Returns a token and a pre-authenticated URL for the data request form. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/)
* @param dataRequestId (required)
* @param type (optional)
* @return CreateSubmissionDataRequestTokenResponse
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> token created </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
<tr><td> 422 </td><td> invalid request </td><td> - </td></tr>
</table>
* Generate authentication tokens for embedded data requests
* @see <a href="https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/#3-request-an-authentication-token">Create a new data request token for form authentication Documentation</a>
*/
public CreateSubmissionDataRequestTokenResponse createDataRequestToken(@javax.annotation.Nonnull String dataRequestId, @javax.annotation.Nullable String type) throws ApiException {
return createDataRequestTokenWithHttpInfo(dataRequestId, type).getData();
}
/**
* Create a new data request token for form authentication
* Creates an authentication token for accessing a data request form. Tokens can be created for API access (1 hour expiration) or email links (30 day expiration). Returns a token and a pre-authenticated URL for the data request form. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/)
* @param dataRequestId (required)
* @param type (optional)
* @return ApiResponse<CreateSubmissionDataRequestTokenResponse>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> token created </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
<tr><td> 422 </td><td> invalid request </td><td> - </td></tr>
</table>
* Generate authentication tokens for embedded data requests
* @see <a href="https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/#3-request-an-authentication-token">Create a new data request token for form authentication Documentation</a>
*/
public ApiResponse<CreateSubmissionDataRequestTokenResponse> createDataRequestTokenWithHttpInfo(@javax.annotation.Nonnull String dataRequestId, @javax.annotation.Nullable String type) throws ApiException {
// Check required parameters
if (dataRequestId == null) {
throw new ApiException(400, "Missing the required parameter 'dataRequestId' when calling createDataRequestToken");
}
// Path parameters
String localVarPath = "/data_requests/{data_request_id}/tokens"
.replaceAll("\\{data_request_id}", apiClient.escapeString(dataRequestId.toString()));
// Query parameters
List<Pair> localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "type", type)
);
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<CreateSubmissionDataRequestTokenResponse> localVarReturnType = new GenericType<CreateSubmissionDataRequestTokenResponse>() {};
return apiClient.invokeAPI("Client.createDataRequestToken", localVarPath, "POST", localVarQueryParams, null,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create a folder
* Creates a new folder for organizing templates. Folders can be nested within other folders by providing a `parent_folder_id`. Folder names must be unique within the same parent.
* @param data (required)
* @return Folder
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 422 </td><td> name already exist </td><td> - </td></tr>
<tr><td> 404 </td><td> parent folder doesn't exist </td><td> - </td></tr>
<tr><td> 200 </td><td> folder created inside another folder </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public Folder createFolder(@javax.annotation.Nonnull CreateFolderData data) throws ApiException {
return createFolderWithHttpInfo(data).getData();
}
/**
* Create a folder
* Creates a new folder for organizing templates. Folders can be nested within other folders by providing a `parent_folder_id`. Folder names must be unique within the same parent.
* @param data (required)
* @return ApiResponse<Folder>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 422 </td><td> name already exist </td><td> - </td></tr>
<tr><td> 404 </td><td> parent folder doesn't exist </td><td> - </td></tr>
<tr><td> 200 </td><td> folder created inside another folder </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public ApiResponse<Folder> createFolderWithHttpInfo(@javax.annotation.Nonnull CreateFolderData data) throws ApiException {
// Check required parameters
if (data == null) {
throw new ApiException(400, "Missing the required parameter 'data' when calling createFolder");
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<Folder> localVarReturnType = new GenericType<Folder>() {};
return apiClient.invokeAPI("Client.createFolder", "/folders/", "POST", new ArrayList<>(), data,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create a new HTML template
* Creates a new HTML template using HTML, CSS/SCSS, and Liquid templating. Allows complete control over PDF layout and styling. Supports headers, footers, and dynamic content using Liquid syntax for field values, conditions, loops, and filters.
* @param data (required)
* @return TemplatePreview
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> returns a created template </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Learn more about HTML/SCSS templates and Liquid templating
* @see <a href="https://docspring.com/docs/html-templates/overview/">Create a new HTML template Documentation</a>
*/
public TemplatePreview createHtmlTemplate(@javax.annotation.Nonnull CreateHtmlTemplate data) throws ApiException {
return createHtmlTemplateWithHttpInfo(data).getData();
}
/**
* Create a new HTML template
* Creates a new HTML template using HTML, CSS/SCSS, and Liquid templating. Allows complete control over PDF layout and styling. Supports headers, footers, and dynamic content using Liquid syntax for field values, conditions, loops, and filters.
* @param data (required)
* @return ApiResponse<TemplatePreview>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> returns a created template </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Learn more about HTML/SCSS templates and Liquid templating
* @see <a href="https://docspring.com/docs/html-templates/overview/">Create a new HTML template Documentation</a>
*/
public ApiResponse<TemplatePreview> createHtmlTemplateWithHttpInfo(@javax.annotation.Nonnull CreateHtmlTemplate data) throws ApiException {
// Check required parameters
if (data == null) {
throw new ApiException(400, "Missing the required parameter 'data' when calling createHtmlTemplate");
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<TemplatePreview> localVarReturnType = new GenericType<TemplatePreview>() {};
return apiClient.invokeAPI("Client.createHtmlTemplate", "/templates?endpoint_variant=create_html_template", "POST", new ArrayList<>(), data,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create a new PDF template with a form POST file upload
* Creates a new PDF template by uploading a PDF file. The uploaded PDF becomes the foundation for your template, and you can then add fillable fields using the template editor. Use the wait parameter to control whether the request waits for document processing to complete.
* @param templateDocument (required)
* @param templateName (required)
* @param wait Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional, default to true)
* @param templateDescription (optional)
* @param templateParentFolderId (optional)
* @return TemplatePreview
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> returns a pending template </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public TemplatePreview createPdfTemplate(@javax.annotation.Nonnull File templateDocument, @javax.annotation.Nonnull String templateName, @javax.annotation.Nullable Boolean wait, @javax.annotation.Nullable String templateDescription, @javax.annotation.Nullable String templateParentFolderId) throws ApiException {
return createPdfTemplateWithHttpInfo(templateDocument, templateName, wait, templateDescription, templateParentFolderId).getData();
}
/**
* Create a new PDF template with a form POST file upload
* Creates a new PDF template by uploading a PDF file. The uploaded PDF becomes the foundation for your template, and you can then add fillable fields using the template editor. Use the wait parameter to control whether the request waits for document processing to complete.
* @param templateDocument (required)
* @param templateName (required)
* @param wait Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional, default to true)
* @param templateDescription (optional)
* @param templateParentFolderId (optional)
* @return ApiResponse<TemplatePreview>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> returns a pending template </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public ApiResponse<TemplatePreview> createPdfTemplateWithHttpInfo(@javax.annotation.Nonnull File templateDocument, @javax.annotation.Nonnull String templateName, @javax.annotation.Nullable Boolean wait, @javax.annotation.Nullable String templateDescription, @javax.annotation.Nullable String templateParentFolderId) throws ApiException {
// Check required parameters
if (templateDocument == null) {
throw new ApiException(400, "Missing the required parameter 'templateDocument' when calling createPdfTemplate");
}
if (templateName == null) {
throw new ApiException(400, "Missing the required parameter 'templateName' when calling createPdfTemplate");
}
// Query parameters
List<Pair> localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "wait", wait)
);
// Form parameters
Map<String, Object> localVarFormParams = new LinkedHashMap<>();
localVarFormParams.put("template[document]", templateDocument);
localVarFormParams.put("template[name]", templateName);
if (templateDescription != null) {
localVarFormParams.put("template[description]", templateDescription);
}
if (templateParentFolderId != null) {
localVarFormParams.put("template[parent_folder_id]", templateParentFolderId);
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<TemplatePreview> localVarReturnType = new GenericType<TemplatePreview>() {};
return apiClient.invokeAPI("Client.createPdfTemplate", "/templates", "POST", localVarQueryParams, null,
new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create a new PDF template from a cached S3 file upload
* Creates a new PDF template from a file previously uploaded to S3 using a presigned URL. This two-step process allows for more reliable large file uploads by first uploading the file to S3, then creating the template using the cached upload ID.
* @param data (required)
* @return TemplatePreview
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> returns a pending template </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public TemplatePreview createPdfTemplateFromUpload(@javax.annotation.Nonnull CreatePdfTemplate data) throws ApiException {
return createPdfTemplateFromUploadWithHttpInfo(data).getData();
}
/**
* Create a new PDF template from a cached S3 file upload
* Creates a new PDF template from a file previously uploaded to S3 using a presigned URL. This two-step process allows for more reliable large file uploads by first uploading the file to S3, then creating the template using the cached upload ID.
* @param data (required)
* @return ApiResponse<TemplatePreview>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> returns a pending template </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public ApiResponse<TemplatePreview> createPdfTemplateFromUploadWithHttpInfo(@javax.annotation.Nonnull CreatePdfTemplate data) throws ApiException {
// Check required parameters
if (data == null) {
throw new ApiException(400, "Missing the required parameter 'data' when calling createPdfTemplateFromUpload");
}
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<TemplatePreview> localVarReturnType = new GenericType<TemplatePreview>() {};
return apiClient.invokeAPI("Client.createPdfTemplateFromUpload", "/templates?endpoint_variant=create_template_from_cached_upload", "POST", new ArrayList<>(), data,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Delete a folder
* Deletes an empty folder. The folder must not contain any templates or subfolders. Move or delete all contents before attempting to delete the folder.
* @param folderId (required)
* @return Folder
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> folder doesn't exist </td><td> - </td></tr>
<tr><td> 422 </td><td> folder has contents </td><td> - </td></tr>
<tr><td> 200 </td><td> folder is empty </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public Folder deleteFolder(@javax.annotation.Nonnull String folderId) throws ApiException {
return deleteFolderWithHttpInfo(folderId).getData();
}
/**
* Delete a folder
* Deletes an empty folder. The folder must not contain any templates or subfolders. Move or delete all contents before attempting to delete the folder.
* @param folderId (required)
* @return ApiResponse<Folder>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> folder doesn't exist </td><td> - </td></tr>
<tr><td> 422 </td><td> folder has contents </td><td> - </td></tr>
<tr><td> 200 </td><td> folder is empty </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public ApiResponse<Folder> deleteFolderWithHttpInfo(@javax.annotation.Nonnull String folderId) throws ApiException {
// Check required parameters
if (folderId == null) {
throw new ApiException(400, "Missing the required parameter 'folderId' when calling deleteFolder");
}
// Path parameters
String localVarPath = "/folders/{folder_id}"
.replaceAll("\\{folder_id}", apiClient.escapeString(folderId.toString()));
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<Folder> localVarReturnType = new GenericType<Folder>() {};
return apiClient.invokeAPI("Client.deleteFolder", localVarPath, "DELETE", new ArrayList<>(), null,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Delete a template
* Deletes a template or a specific template version. When no version is specified, deletes the entire template including all versions. When a version is specified, deletes only that version while preserving others. Returns remaining version information.
* @param templateId (required)
* @param version (optional)
* @return TemplateDeleteResponse
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> template version deleted successfully </td><td> - </td></tr>
<tr><td> 404 </td><td> template not found </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public TemplateDeleteResponse deleteTemplate(@javax.annotation.Nonnull String templateId, @javax.annotation.Nullable String version) throws ApiException {
return deleteTemplateWithHttpInfo(templateId, version).getData();
}
/**
* Delete a template
* Deletes a template or a specific template version. When no version is specified, deletes the entire template including all versions. When a version is specified, deletes only that version while preserving others. Returns remaining version information.
* @param templateId (required)
* @param version (optional)
* @return ApiResponse<TemplateDeleteResponse>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> template version deleted successfully </td><td> - </td></tr>
<tr><td> 404 </td><td> template not found </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
*/
public ApiResponse<TemplateDeleteResponse> deleteTemplateWithHttpInfo(@javax.annotation.Nonnull String templateId, @javax.annotation.Nullable String version) throws ApiException {
// Check required parameters
if (templateId == null) {
throw new ApiException(400, "Missing the required parameter 'templateId' when calling deleteTemplate");
}
// Path parameters
String localVarPath = "/templates/{template_id}"
.replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString()));
// Query parameters
List<Pair> localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "version", version)
);
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<TemplateDeleteResponse> localVarReturnType = new GenericType<TemplateDeleteResponse>() {};
return apiClient.invokeAPI("Client.deleteTemplate", localVarPath, "DELETE", localVarQueryParams, null,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Expire a combined submission
* Expiring a combined submission deletes the PDF from our system. This is useful for invalidating sensitive documents.
* @param combinedSubmissionId (required)
* @return CombinedSubmission
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> submission was expired </td><td> - </td></tr>
<tr><td> 404 </td><td> combined submission not found </td><td> - </td></tr>
<tr><td> 403 </td><td> test API token used </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Complete guide to combining PDFs with DocSpring
* @see <a href="https://docspring.com/docs/api-guide/combine-pdfs/">Expire a combined submission Documentation</a>
*/
public CombinedSubmission expireCombinedSubmission(@javax.annotation.Nonnull String combinedSubmissionId) throws ApiException {
return expireCombinedSubmissionWithHttpInfo(combinedSubmissionId).getData();
}
/**
* Expire a combined submission
* Expiring a combined submission deletes the PDF from our system. This is useful for invalidating sensitive documents.
* @param combinedSubmissionId (required)
* @return ApiResponse<CombinedSubmission>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> submission was expired </td><td> - </td></tr>
<tr><td> 404 </td><td> combined submission not found </td><td> - </td></tr>
<tr><td> 403 </td><td> test API token used </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Complete guide to combining PDFs with DocSpring
* @see <a href="https://docspring.com/docs/api-guide/combine-pdfs/">Expire a combined submission Documentation</a>
*/
public ApiResponse<CombinedSubmission> expireCombinedSubmissionWithHttpInfo(@javax.annotation.Nonnull String combinedSubmissionId) throws ApiException {
// Check required parameters
if (combinedSubmissionId == null) {
throw new ApiException(400, "Missing the required parameter 'combinedSubmissionId' when calling expireCombinedSubmission");
}
// Path parameters
String localVarPath = "/combined_submissions/{combined_submission_id}"
.replaceAll("\\{combined_submission_id}", apiClient.escapeString(combinedSubmissionId.toString()));
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<CombinedSubmission> localVarReturnType = new GenericType<CombinedSubmission>() {};
return apiClient.invokeAPI("Client.expireCombinedSubmission", localVarPath, "DELETE", new ArrayList<>(), null,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Expire a PDF submission
* Expiring a PDF submission deletes the PDF and removes the data from our database. This is useful for invalidating sensitive documents after they've been downloaded. You can also [configure a data retention policy for your submissions](https://docspring.com/docs/template-editor/settings/#expire-submissions) so that they automatically expire.
* @param submissionId (required)
* @return SubmissionPreview
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> submission was expired </td><td> - </td></tr>
<tr><td> 404 </td><td> submission not found </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
<tr><td> 403 </td><td> test API token used </td><td> - </td></tr>
</table>
*/
public SubmissionPreview expireSubmission(@javax.annotation.Nonnull String submissionId) throws ApiException {
return expireSubmissionWithHttpInfo(submissionId).getData();
}
/**
* Expire a PDF submission
* Expiring a PDF submission deletes the PDF and removes the data from our database. This is useful for invalidating sensitive documents after they've been downloaded. You can also [configure a data retention policy for your submissions](https://docspring.com/docs/template-editor/settings/#expire-submissions) so that they automatically expire.
* @param submissionId (required)
* @return ApiResponse<SubmissionPreview>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> submission was expired </td><td> - </td></tr>
<tr><td> 404 </td><td> submission not found </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
<tr><td> 403 </td><td> test API token used </td><td> - </td></tr>
</table>
*/
public ApiResponse<SubmissionPreview> expireSubmissionWithHttpInfo(@javax.annotation.Nonnull String submissionId) throws ApiException {
// Check required parameters
if (submissionId == null) {
throw new ApiException(400, "Missing the required parameter 'submissionId' when calling expireSubmission");
}
// Path parameters
String localVarPath = "/submissions/{submission_id}"
.replaceAll("\\{submission_id}", apiClient.escapeString(submissionId.toString()));
String localVarAccept = apiClient.selectHeaderAccept("application/json");
String localVarContentType = apiClient.selectHeaderContentType();
String[] localVarAuthNames = new String[] {"api_token_basic"};
GenericType<SubmissionPreview> localVarReturnType = new GenericType<SubmissionPreview>() {};
return apiClient.invokeAPI("Client.expireSubmission", localVarPath, "DELETE", new ArrayList<>(), null,
new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Generate a PDF
* Creates a PDF submission by filling in a template with data. Supports both synchronous (default) and asynchronous processing. Set `wait: false` to return immediately. See also: - [Customize the PDF Title and Filename](https://docspring.com/docs/api-guide/generate-pdfs/customize-pdf-title-and-filename/) - Set custom metadata - [Handling Truncated Text](https://docspring.com/docs/api-guide/generate-pdfs/handle-truncated-text/) - Handle text that doesn't fit in fields
* @param templateId (required)
* @param submission (required)
* @param wait Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional, default to true)
* @return CreateSubmissionResponse
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> submission created </td><td> - </td></tr>
<tr><td> 422 </td><td> invalid request </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Complete guide to generating PDFs with DocSpring
* @see <a href="https://docspring.com/docs/api-guide/generate-pdfs/generate-pdfs-via-api/">Generate a PDF Documentation</a>
*/
public CreateSubmissionResponse generatePdf(@javax.annotation.Nonnull String templateId, @javax.annotation.Nonnull CreatePdfSubmissionData submission, @javax.annotation.Nullable Boolean wait) throws ApiException {
return generatePdfWithHttpInfo(templateId, submission, wait).getData();
}
/**
* Generate a PDF
* Creates a PDF submission by filling in a template with data. Supports both synchronous (default) and asynchronous processing. Set `wait: false` to return immediately. See also: - [Customize the PDF Title and Filename](https://docspring.com/docs/api-guide/generate-pdfs/customize-pdf-title-and-filename/) - Set custom metadata - [Handling Truncated Text](https://docspring.com/docs/api-guide/generate-pdfs/handle-truncated-text/) - Handle text that doesn't fit in fields
* @param templateId (required)
* @param submission (required)
* @param wait Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional, default to true)
* @return ApiResponse<CreateSubmissionResponse>
* @throws ApiException if fails to make API call
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> submission created </td><td> - </td></tr>
<tr><td> 422 </td><td> invalid request </td><td> - </td></tr>
<tr><td> 401 </td><td> authentication failed </td><td> - </td></tr>
</table>
* Complete guide to generating PDFs with DocSpring
* @see <a href="https://docspring.com/docs/api-guide/generate-pdfs/generate-pdfs-via-api/">Generate a PDF Documentation</a>
*/
public ApiResponse<CreateSubmissionResponse> generatePdfWithHttpInfo(@javax.annotation.Nonnull String templateId, @javax.annotation.Nonnull CreatePdfSubmissionData submission, @javax.annotation.Nullable Boolean wait) throws ApiException {
// Check required parameters
if (templateId == null) {
throw new ApiException(400, "Missing the required parameter 'templateId' when calling generatePdf");
}
if (submission == null) {
throw new ApiException(400, "Missing the required parameter 'submission' when calling generatePdf");
}
// Path parameters
String localVarPath = "/templates/{template_id}/submissions"
.replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString()));
// Query parameters
List<Pair> localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "wait", wait)
);
String localVarAccept = apiClient.selectHeaderAccept("application/json");