-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathApiAppCreateExample.java
61 lines (53 loc) · 2.08 KB
/
ApiAppCreateExample.java
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
package com.dropbox.sign_sandbox;
import com.dropbox.sign.ApiException;
import com.dropbox.sign.Configuration;
import com.dropbox.sign.api.*;
import com.dropbox.sign.auth.*;
import com.dropbox.sign.JSON;
import com.dropbox.sign.model.*;
import java.io.File;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class ApiAppCreateExample
{
public static void main(String[] args)
{
var config = Configuration.getDefaultApiClient();
((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY");
// ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN");
var oauth = new SubOAuth();
oauth.callbackUrl("https://example.com/oauth");
oauth.scopes(List.of (
SubOAuth.ScopesEnum.BASIC_ACCOUNT_INFO,
SubOAuth.ScopesEnum.REQUEST_SIGNATURE
));
var whiteLabelingOptions = new SubWhiteLabelingOptions();
whiteLabelingOptions.primaryButtonColor("#00b3e6");
whiteLabelingOptions.primaryButtonTextColor("#ffffff");
var apiAppCreateRequest = new ApiAppCreateRequest();
apiAppCreateRequest.name("My Production App");
apiAppCreateRequest.domains(List.of (
"example.com"
));
apiAppCreateRequest.customLogoFile(new File("CustomLogoFile.png"));
apiAppCreateRequest.oauth(oauth);
apiAppCreateRequest.whiteLabelingOptions(whiteLabelingOptions);
try
{
var response = new ApiAppApi(config).apiAppCreate(
apiAppCreateRequest
);
System.out.println(response);
} catch (ApiException e) {
System.err.println("Exception when calling ApiAppApi#apiAppCreate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}