-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathApiAppUpdateExample.ts
41 lines (36 loc) · 1.08 KB
/
ApiAppUpdateExample.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
40
41
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 apiAppUpdateRequest: models.ApiAppUpdateRequest = {
callbackUrl: "https://example.com/dropboxsign",
name: "New Name",
domains: [
"example.com",
],
customLogoFile: fs.createReadStream("CustomLogoFile.png"),
oauth: oauth,
whiteLabelingOptions: whiteLabelingOptions,
};
apiCaller.apiAppUpdate(
"0dd3b823a682527788c4e40cb7b6f7e9", // clientId
apiAppUpdateRequest,
).then(response => {
console.log(response.body);
}).catch(error => {
console.log("Exception when calling ApiAppApi#apiAppUpdate:");
console.log(error.body);
});