Quick Start: Send with Template

The quickest way to get started with our Custom Apex SDK is to use our easy-to-implement SendWithTemplate class! Here's how to get started:

  1. Create a template that has default signers. Make a note of the template's record ID is. (For this example, we're using an Account object template with a record ID of a095w000011EYhWAAW.)
  2. Use the following code to easily send a signature request using that template from Apex.
    1. You'll need to know the parent/source record ID and specify it as the first parameter when instantiating a HelloSign.SendWithTemplate.SendObject. In this example, since we're using an Account object-based template, we're specifying an Account with record ID 0015w00002KgtpFAAR. For your use case, though, you'll probably want to dynamically supply this value.
    2. Specify your template record ID as the second parameter when instantiating a HelloSign.SendWithTemplate.SendObject.
    3. You can send multiple signature requests at the same time by adding more send objects to the List you pass into the HelloSign.SendWithTemplate.sendWithTemplate() method.
// Create List for send objects
List<HelloSign.SendWithTemplate.SendObject> sos = 
  new List<HelloSign.SendWithTemplate.SendObject>();

// Create individual send objects specifying parent record ID 
// and HelloSign template record ID as constructor parameters.
HelloSign.SendWithTemplate.SendObject so = 
  new HelloSign.SendWithTemplate.SendObject('0015w00002KgtpFAAR', 'a095w000011EYhWAAW');

// Add send objects to List.
// Create more send objects if you'd like to send 
// multiple requests at the same time.

// Pass List to sendWithTemplate method

// Your signature requests will be sent asynchronously.

// NOTE: sendWithTemplate() is currently a void method, 
// so no values are returned.
// HelloSign__HelloSign_Batch_Queue__c records are created for each
// signature request you're sending, so you can check send status on those.

For more complex use cases, check out the rest of the Custom Apex SDK documentation...


HelloSign.SendWithTemplate.sendWithTemplate() only works from synchronous Apex.

HelloSign.SendWithTemplate.sendWithTemplate() cannot be called from Batchable, Schedulable, or Queueable Apex.

HelloSign.SendWithTemplate.sendWithTemplate() utilizes Batchable Apex to handle large amounts of Signature Requests sent asynchronously.

If you need to schedule Signature Request sends from asynchronous Apex, use the Send with Template or Send Signature Request methods.