Sha256: fd83b9bada5992ec12465d66bc0b42916c09dd68379ca646a4c55896e4d80abc

Contents?: true

Size: 1.45 KB

Versions: 1

Compression:

Stored size: 1.45 KB

Contents

import * as HelloSignSDK from "hellosign-sdk";

const api = new HelloSignSDK.TemplateApi();

// Configure HTTP basic authorization: api_key
api.username = "YOUR_API_KEY";

// or, configure Bearer (JWT) authorization: oauth2
// $config->setAccessToken("YOUR_ACCESS_TOKEN");

const role1: HelloSignSDK.SubTemplateRole = {
  name: "Client",
  order: 0,
};

const role2: HelloSignSDK.SubTemplateRole = {
  name: "Witness",
  order: 1,
};

const mergeField1: HelloSignSDK.SubMergeField = {
  name: "Full Name",
  type: HelloSignSDK.SubMergeField.TypeEnum.Text,
};

const mergeField2: HelloSignSDK.SubMergeField = {
  name: "Is Registered?",
  type: HelloSignSDK.SubMergeField.TypeEnum.Checkbox,
};

const fieldOptions: HelloSignSDK.SubFieldOptions = {
  dateFormat: HelloSignSDK.SubFieldOptions.DateFormatEnum.DD_MM_YYYY,
};

const data: HelloSignSDK.TemplateCreateEmbeddedDraftRequest = {
  clientId: "37dee8d8440c66d54cfa05d92c160882",
  fileUrl: ["https://app.hellosign.com/docs/example_signature_request.pdf"],
  title: "Test Template",
  subject: "Please sign this document",
  message: "For your approval",
  signerRoles: [
    role1,
    role2,
  ],
  ccRoles: ["Manager"],
  mergeFields: [
    mergeField1,
    mergeField2,
  ],
  fieldOptions,
  testMode: true,
};

const result = api.templateCreateEmbeddedDraft(data);
result.then(response => {
  console.log(response.body);
}).catch(error => {
  console.log("Exception when calling HelloSign API:");
  console.log(error.body);
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hellosign-ruby-sdk-6.0.0.pre.beta oas/examples/TemplateCreateEmbeddedDraft.ts