-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathApiAppCreateExample.ts
39 lines (34 loc) · 1017 Bytes
/
ApiAppCreateExample.ts
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
import * as fs from 'fs';
import api from "@dropbox/sign"
import models from "@dropbox/sign"
const apiCaller = new api.ApiAppApi();
apiCaller.username = "YOUR_API_KEY";
// apiCaller.accessToken = "YOUR_ACCESS_TOKEN";
const oauth: models.SubOAuth = {
callbackUrl: "https://example.com/oauth",
scopes: [
models.SubOAuth.ScopesEnum.BasicAccountInfo,
models.SubOAuth.ScopesEnum.RequestSignature,
],
};
const whiteLabelingOptions: models.SubWhiteLabelingOptions = {
primaryButtonColor: "#00b3e6",
primaryButtonTextColor: "#ffffff",
};
const apiAppCreateRequest: models.ApiAppCreateRequest = {
name: "My Production App",
domains: [
"example.com",
],
customLogoFile: fs.createReadStream("CustomLogoFile.png"),
oauth: oauth,
whiteLabelingOptions: whiteLabelingOptions,
};
apiCaller.apiAppCreate(
apiAppCreateRequest,
).then(response => {
console.log(response.body);
}).catch(error => {
console.log("Exception when calling ApiAppApi#apiAppCreate:");
console.log(error.body);
});