This repository was archived by the owner on Oct 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathTemplateUpdateFiles.java
More file actions
46 lines (37 loc) · 1.63 KB
/
TemplateUpdateFiles.java
File metadata and controls
46 lines (37 loc) · 1.63 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
import com.sun.tools.javac.util.List;
import com.dropbox.sign.ApiClient;
import com.dropbox.sign.ApiException;
import com.dropbox.sign.Configuration;
import com.dropbox.sign.api.*;
import com.dropbox.sign.auth.HttpBasicAuth;
import com.dropbox.sign.model.*;
import java.io.File;
public class Example {
public static void main(String[] args) {
ApiClient apiClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: api_key
HttpBasicAuth apiKey = (HttpBasicAuth) apiClient
.getAuthentication("api_key");
apiKey.setUsername("YOUR_API_KEY");
// or, configure Bearer (JWT) authorization: oauth2
/*
HttpBearerAuth oauth2 = (HttpBearerAuth) apiClient
.getAuthentication("oauth2");
oauth2.setBearerToken("YOUR_ACCESS_TOKEN");
*/
TemplateApi templateApi = new TemplateApi(apiClient);
TemplateUpdateFilesRequest data = new TemplateUpdateFilesRequest()
.addFilesItem(new File("example_signature_request.pdf"));
String templateId = "21f920ec2b7f4b6bb64d3ed79f26303843046536";
try {
TemplateUpdateFilesResponse result = templateApi.templateUpdateFiles(templateId, data);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#accountCreate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}