forked from hellosign/hellosign-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApiAppCreate.ts
40 lines (32 loc) · 1.03 KB
/
ApiAppCreate.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
import * as HelloSignSDK from "hellosign-sdk";
const fs = require('fs');
const api = new HelloSignSDK.ApiAppApi();
// Configure HTTP basic authorization: api_key
api.username = "YOUR_API_KEY";
// or, configure Bearer (JWT) authorization: oauth2
// api.accessToken = "YOUR_ACCESS_TOKEN";
const oauth: HelloSignSDK.SubOAuth = {
callbackUrl: "https://example.com/oauth",
scopes: [
HelloSignSDK.SubOAuth.ScopesEnum.BasicAccountInfo,
HelloSignSDK.SubOAuth.ScopesEnum.RequestSignature,
],
};
const whiteLabelingOptions: HelloSignSDK.SubWhiteLabelingOptions = {
primaryButtonColor: "#00b3e6",
primaryButtonTextColor: "#ffffff",
};
const data: HelloSignSDK.ApiAppCreateRequest = {
name: "My Production App",
domains: ["example.com"],
customLogoFile: fs.createReadStream("CustomLogoFile.png"),
oauth,
whiteLabelingOptions,
};
const result = api.apiAppCreate(data);
result.then(response => {
console.log(response.body);
}).catch(error => {
console.log("Exception when calling HelloSign API:");
console.log(error.body);
});