Skip to navigation

_all Apex Toolkit

View as Markdown

Recipient

global virtual class Recipient implements Comparable
Description
Representation of a Docusign envelope recipient.
authentication
@AuraEnabled global Authentication authentication
The recipient authentication options.
email
@AuraEnabled global String email
The email of the recipient.
emailSettings
@AuraEnabled global EmailSettings emailSettings
The email settings for the recipient.
hostEmail
@AuraEnabled global String hostEmail
The host email of the recipient. Used only for in-person signing.
hostName
@AuraEnabled global String hostName
The host name of the recipient. Used only for in-person signing.
id
@AuraEnabled global Id id
The ID of the associated dfsle__Recipient__c record.
isSigningGroup
@AuraEnabled global Boolean isSigningGroup
Read-only property indicating whether the recipient is a signing group.
name
@AuraEnabled global String name
The name of the recipient.
note
@AuraEnabled global String note
The private note sent to the recipient.
phone
@AuraEnabled global String phone
The phone number of the recipient. Can be used for SMS authentication.
readOnly
@AuraEnabled global Boolean readOnly
Whether this recipient may be modified. Used with Docusign templates.
required
@AuraEnabled global Boolean required
Whether this recipient is required. Used with Docusign templates.
role
@AuraEnabled global Role role
The role of the recipient. Used to tie the recipient to Docusign template roles or for use with automatic anchor tags.
routingOrder
@AuraEnabled global Integer routingOrder
The routing order of the recipient. This is distinct from sequence and need not be unique across an envelope's recipients.
sequence
@AuraEnabled global Integer sequence
The ordinal sequence of the recipient as displayed on the Docusign envelope.
signatureProviders
@AuraEnabled global List<SignatureProvider> signatureProviders
signingGroup
@AuraEnabled global SigningGroup signingGroup
The Docusign signing group.
signNow
@AuraEnabled global Boolean signNow
Whether the recipient should sign now. Honored only for in-person signing or when the first signer is the current user.
source
@AuraEnabled global Entity source
The Salesforce source object for the recipient (Contact, Lead, or User).
type
@AuraEnabled global String type
The type of the recipient.
TYPE_SIGNER
global static final String TYPE_SIGNER
Signer (Needs to Sign) recipient type constant.
'Signer'
TYPE_IN_PERSON_SIGNER
global static final String TYPE_IN_PERSON_SIGNER
In person signer recipient type constant.
'InPersonSigner'
TYPE_EMBEDDED_SIGNER
global static final String TYPE_EMBEDDED_SIGNER
Embedded signer recipient type constant.
'EmbeddedSigner'
TYPE_CARBON_COPY
global static final String TYPE_CARBON_COPY
Carbon copy (Receives a Copy) recipient type constant.
'CarbonCopy'
TYPE_CERTIFIED_DELIVERY
global static final String TYPE_CERTIFIED_DELIVERY
Certified delivery (Needs to View) recipient type constant.
'CertifiedDelivery'
TYPE_AGENT
global static final String TYPE_AGENT
Agent (Specify Recipients) recipient type constant.
'Agent'
TYPE_EDITOR
global static final String TYPE_EDITOR
Editor (Allow to Edit) recipient type constant.
'Editor'
TYPE_INTERMEDIARY
global static final String TYPE_INTERMEDIARY
Intermediary (Update Recipients) recipient type constant.
'Intermediary'
STATUS_CREATED
global static final String STATUS_CREATED
Created status constant.
'created'
STATUS_SENT
global static final String STATUS_SENT
Sent status constant.
'sent'
STATUS_DELIVERED
global static final String STATUS_DELIVERED
Delivered status constant.
'delivered'
STATUS_DECLINED
global static final String STATUS_DECLINED
Declined status constant.
'declined'
STATUS_COMPLETED
global static final String STATUS_COMPLETED
Completed status constant.
'completed'
STATUS_SIGNED
global static final String STATUS_SIGNED
Signed status constant.
'signed'
STATUS_CANCELED
global static final String STATUS_CANCELED
Canceled status constant.
'canceled'

Methods

global static Recipient fromSource(final String name, final String email, final String phone, final String role, final Entity source)
Description
Factory method to construct a recipient from a Salesforce source.
Returns
The recipient based on the Salesforce source entity.
Parameters
name
final String name
The recipient name.
email
final String email
The recipient email.
phone
final String phone
The recipient phone that may be used for SMS authentication.
role
final String role
The recipient role.
source
final Entity source
The source Salesforce entity.
global static Recipient newBulkRecipient(final String name, final String email, final Entity source)
Description
Factory method to create a bulk recipient suitable for bulk envelope copies.
Returns
The new Docusign bulk envelope copy recipient.
Parameters
name
final String name
The recipient name.
email
final String email
The recipient email.
source
final Entity source
The Salesforce source object.
global static Recipient newEmbeddedSigner()
Description
Creates an embedded signer recipient for the current user. This recipient is expected to sign an envelope immediately, and will not receive an email requesting signature.
Returns
The newly-created embedded signer.
global static Recipient newEmbeddedSigner(final String name, final String email, final Id sourceId)
Description
Creates an embedded signer recipient. This recipient is expected to sign an envelope within a custom application and will not receive an email requesting signature. The name, email, and ID must match the logged-in user's during signing.
Returns
The newly-created embedded signer.
Parameters
name
final String name
The signer's Salesforce user name.
email
final String email
The signer's Salesforce user email.
sourceId
final Id sourceId
The signer's Salesforce user ID.
global Recipient( final Id id, final String type, final Integer sequence, final Integer routingOrder, final Role role, final String name, final String email, final SigningGroup signingGroup, final String phone, final Authentication authentication, final String note, final EmailSettings emailSettings, final String hostName, final String hostEmail, final Boolean signNow, final Entity source, final Boolean readOnly, final Boolean required )
Description
Constructs a Docusign envelope recipient.
Parameters
id
final Id id
The ID of the associated dfsle__Recipient__c record.
type
final String type
The type of recipient.
sequence
final Integer sequence
The ordinal sequence of the recipient.
routingOrder
final Integer routingOrder
The routing order of the recipient.
role
final Role role
The recipient role.
name
final String name
The name of the recipient.
email
final String email
The email of the recipient.
signingGroup
final SigningGroup signingGroup
The Docusign signing group.
phone
final String phone
The phone number of the recipient.
authentication
final Authentication authentication
Optional authentication method for the recipient.
note
final String note
Optional private note sent to the recipient.
emailSettings
final EmailSettings emailSettings
The email settings for the recipient.
hostName
final String hostName
The host name of the recipient, used for in-person signing.
hostEmail
final String hostEmail
The host email of the recipient, used for in-person signing.
signNow
final Boolean signNow
Whether the recipient should sign now.
source
final Entity source
The Salesforce source object for the recipient.
readOnly
final Boolean readOnly
Whether this recipient may be modified. Used with Docusign templates.
required
final Boolean required
Whether this recipient is required. Used with Docusign templates.
global Recipient withAuthentication(final Authentication authentication)
Description
Sets the recipient authentication property.
Returns
The recipient with updated authentication.
Parameters
authentication
final Authentication authentication
The new recipient authentication.
global Recipient withEmailSettings(final EmailSettings emailSettings)
Description
Sets the recipient emailSettings property.
Returns
The recipient with updated emailSettings.
Parameters
emailSettings
final EmailSettings emailSettings
The new recipient email settings.
global virtual Recipient withEmbeddedRecipientStartURL(final String embeddedRecipientStartURL)
Description
Sets the Recipient's embeddedRecipientStartURL property.
Returns
The recipient with updated embeddedRecipientStartURL.
Parameters
embeddedRecipientStartURL
final String embeddedRecipientStartURL
The valid URL string for redirecting an embedded recipient. If set to SIGN_AT_DOCUSIGN, the recipient is directed to an embedded signing or viewing process directly at Docusign.
global Recipient withNote(final String note)
Description
Sets the recipient note property.
Returns
The recipient with updated note.
Parameters
note
final String note
The new recipient note.
global virtual Recipient withRole(final Role role)
Description
Sets the recipient role property.
Returns
The recipient with updated role.
Parameters
role
final Role role
The new recipient role.
global virtual Recipient withRole(final String role)
Description
Sets the recipient role property.
Returns
The recipient with updated role.
Parameters
role
final String role
The new recipient role.
global Recipient withRoutingOrder(final Integer routingOrder)
Description
Sets the recipient routingOrder property.
Returns
The recipient with updated routingOrder.
Parameters
routingOrder
final Integer routingOrder
The new recipient routing order.
global virtual Recipient withSignatureProviders(final List<SignatureProvider> signatureProviders)
Description
Sets the Recipient's signatureProviders property.
Returns
The Recipient with an updated signatureProviders property.
Parameters
signatureProviders
final List<SignatureProvider> signatureProviders
One or more Standards-Based Signature (digital signature) providers for the signer to use. By default, signers will use electronic signatures without certificates.
global virtual Recipient withSmsDelivery(final String phone)
Description
Enables SMS delivery for a recipient to the specified phone number.
Returns
The recipient with updated phone and deliverBySms.
Parameters
phone
final String phone
The phone number where the envelope will be delivered via SMS.
global virtual Recipient withTabs(final List<Tab> tabs)
Description
Sets the recipient tabs property.
Returns
The recipient with updated tabs.
Parameters
tabs
final List<Tab> tabs
Tabs (e.g. merge fields) associated with the recipient.
global virtual Recipient withType(final String type)
Description
Sets the recipient type property.
Returns
The recipient with updated type.
Parameters
type
final String type
The new recipient type.

Recipient.Role

global class Role implements Comparable
Description
Representation of a Docusign envelope recipient role used for automatic anchor tags or template role matching.
name
@AuraEnabled global String name
The role name.
value
@AuraEnabled global Integer value
The role ordinal used for mapping to automatic anchor tags.

Methods

global Role(final String name, final Integer value)
Description
Constructs a Docusign envelope recipient role.
Parameters
name
final String name
The role name.
value
final Integer value
The role ordinal used for mapping to automatic anchor tags.

Recipient.Authentication

global class Authentication
Description
Representation of Docusign envelope recipient authentication methods.
accessCode
@AuraEnabled global String accessCode
Access code a recipient must enter before opening an envelope.
idCheckRequired
@AuraEnabled global Boolean idCheckRequired
Whether the recipient's ID should be checked.
smsPhoneNumbers
@AuraEnabled global List<String> smsPhoneNumbers
A list of phone numbers to which a SMS authentication code may be sent. Currently only one phone number is supported.

Methods

global Authentication(final String accessCode, final Boolean idCheckRequired, final List<String> smsPhoneNumbers)
Description
Constructs recipient authentication.
Parameters
accessCode
final String accessCode
Access code a recipient must enter before opening an envelope.
idCheckRequired
final Boolean idCheckRequired
Whether the recipient's ID should be checked.
smsPhoneNumbers
final List<String> smsPhoneNumbers
A list of phone numbers to which a SMS authentication code may be sent.

Recipient.EmailSettings

global class EmailSettings
Description
Represents localized Docusign envelope recipient email settings.
language
@AuraEnabled global String language
The language code for the localized emails (e.g 'en', 'pt_BR').
languageLabel
@AuraEnabled global String languageLabel
The localized language label.
message
@AuraEnabled global String message
The localized email message.
subject
@AuraEnabled global String subject
The localized email subject.

Methods

global EmailSettings(final String language, final String languageLabel, final String subject, final String message)
Description
Constructs localized Docusign envelope recipient email settings.
Parameters
language
final String language
The language code for the localized emails.
languageLabel
final String languageLabel
The localized language label.
subject
final String subject
The localized email subject.
message
final String message
The localized email message.

Recipient.Status

global class Status implements Comparable
Description
Docusign recipient status.
completed
@AuraEnabled global Datetime completed
Date and time when the recipient completed signing the envelope.
email
@AuraEnabled global String email
The email address of the recipient.
id
@AuraEnabled global Id id
The ID of the underlying dfsle__RecipientStatus__c record.
lastStatusUpdate
@AuraEnabled global Datetime lastStatusUpdate
Date and time when the status was last updated.
name
@AuraEnabled global String name
The name of the recipient.
reason
@AuraEnabled global String reason
The reason the recipient declined signing the envelope.
routingOrder
@AuraEnabled global Integer routingOrder
The routing order of the recipient.
sent
@AuraEnabled global Datetime sent
Date and time when the recipient received the envelope.
sequence
@AuraEnabled global Integer sequence
The recipient sequence.
source
@AuraEnabled global Entity source
The Salesforce source entity.
status
@AuraEnabled global String status
The current status.
type
@AuraEnabled global String type
The Docusign recipient type.

Methods

global Status( final Id id, final Entity source, final String type, final Integer sequence, final String status, final String name, final String email, final Integer routingOrder, final Datetime sent, final Datetime completed, final String reason, final Datetime lastStatusUpdate )
Description
Constructs a Docusign recipient status.
Parameters
id
final Id id
The ID of the underlying dfsle__RecipientStatus__c record.
source
final Entity source
The Salesforce source entity.
type
final String type
The Docusign recipient type.
sequence
final Integer sequence
The recipient sequence.
status
final String status
The current status.
name
final String name
The name of the recipient.
email
final String email
The email address of the recipient.
routingOrder
final Integer routingOrder
The routing order of the recipient.
sent
final Datetime sent
Date and time when the recipient received the envelope.
completed
final Datetime completed
Date and time when the recipient completed signing the envelope.
reason
final String reason
The reason the recipient declined signing the envelope.
lastStatusUpdate
final Datetime lastStatusUpdate
Date and time when the status was last updated.

Recipient.ResendResult

global class ResendResult
Description
Recipient resend result.
email
@AuraEnabled global String email
The recipient email address.
error
@AuraEnabled global APIError error
The error encountered during update, if any.
routingOrder
@AuraEnabled global Integer routingOrder
The recipient routing order.
sequence
@AuraEnabled global Integer sequence
The recipient sequence.

BulkList

global class BulkList
Description
Docusign envelope bulk send list.

Exactly one bulk signer recipient per envelope is supported.

copies
@AuraEnabled global List<Envelope> copies
Copies of the Docusign envelope to be sent.
docuSignId
@AuraEnabled global UUID docuSignId
The Docusign bulk send list identifier.
id
@AuraEnabled global Id id
The bulk list identifier.
name
@AuraEnabled global String name
The name of the bulk send list.
source
@AuraEnabled global Entity source
The Salesforce source object from which the list was generated.
STATUS_QUEUED
global static final String STATUS_QUEUED
Constant for queued status.
'queued'
STATUS_PROCESSING
global static final String STATUS_PROCESSING
Constant for processing status.
'processing'
STATUS_SENT
global static final String STATUS_SENT
Constant for sent status.
'sent'
STATUS_FAILED
global static final String STATUS_FAILED
Constant for failed status.
'failed'

Methods

global static BulkList newList(final String name, final List<Envelope> copies, final Entity source)
Description
Creates a new bulk send list.
Returns
The new bulk send list.
Parameters
name
final String name
Required name of the bulk send list.
copies
final List<Envelope> copies
The bulk envelope copies. At least one is required.
source
final Entity source
Optional Salesforce source object for the list (e.g. CollaborationGroup.Id).

BulkList.Result

global class Result
Description
The result of testing or sending a bulk list.
bulkStatusId
@AuraEnabled global Id bulkStatusId
The ID of the bulk status record.
errors
@AuraEnabled global List<APIError> errors
A list of validation or sending errors.
success
@AuraEnabled global Boolean success
Read-only property indicating whether the batch job submission was successful.

BulkList.Status

global class Status
Description
The status of a bulk send batch job.
batchSize
@AuraEnabled global Integer batchSize
The size of the batch.
docuSignId
@AuraEnabled global UUID docuSignId
The Docusign batch job ID.
failedEnvelopes
@AuraEnabled global Integer failedEnvelopes
The number of envelopes that failed to send.
id
global Id id
The ID of the status.
isFinal
@AuraEnabled global Boolean isFinal
Whether or not the status is in a final state.
lastStatusUpdate
@AuraEnabled global Datetime lastStatusUpdate
Date and time when the status was last updated.
queuedEnvelopes
@AuraEnabled global Integer queuedEnvelopes
The number of envelopes remaining to be sent.
sentEnvelopes
@AuraEnabled global Integer sentEnvelopes
The number of envelopes sent successfully.
source
@AuraEnabled global Entity source
The Salesforce source object for the batch.
submitted
@AuraEnabled global Datetime submitted
Date and time when the job was submitted.

ExpressSignatureProvider

Description
Docusign-generated generic, on-the-fly digital signatures that include a certificate.

Methods

Description
Constructs an express signature provider.

IDNowProvider

global class IDNowProvider extends SignatureProvider
Description
EU Qualified electronic signatures from IDnow. IDnow is a leading European online video-identification service based in Germany.

Methods

global IDNowProvider()
Description
Constructs an IDnow signature provider.

IcpBrasilProvider

Description
ICP-Brasil is the official Brazilian public key infrastructure. It provides digital certificates for virtual identification of Brazilian citizens.
cpfNumber
global String cpfNumber
Brazilian individual taxpayer registry identification number.
role
global String role
The role or capacity of the signing recipient. Examples: Manager, Approver, etc.

Methods

global IcpBrasilProvider(final String cpfNumber, final String role)
Description
Constructs an ICP-Brasil signature provider.
Parameters
cpfNumber
final String cpfNumber
Brazilian individual taxpayer registry identification number.
role
final String role
The role or capacity of the signing recipient. Examples: Manager, Approver, etc.

SigningService

global with sharing class SigningService
Description
Encapsulates signing-related operations.

Methods

global static Url getEmbeddedSigningUrl(final UUID envelopeId, final Url returnUrl)
Description
Retrieves the signing URL for embedded recipients. These recipients do not have to click on an email link to initiate the signing process. Instead, the signing process is initiated from within a custom application.
Returns
The signing URL.
Parameters
envelopeId
final UUID envelopeId
The Docusign envelope ID.
returnUrl
final Url returnUrl
Where to redirect after signing.
global static Url getRecipientPreviewUrl(final UUID envelopeId, final Integer recipientSequence)
Description
This method returns a URL for an envelope recipient preview in the Docusign UI that you can embed in your application. You use this method to enable the sender to preview the recipients' experience.

The caller must be the owner of the envelope.

Returns
The recipient preview URL.
Parameters
envelopeId
final UUID envelopeId
The Docusign envelope ID.
recipientSequence
final Integer recipientSequence
The recipient sequence in the envelope. Must be a positive integer.
global static Url getSigningUrl(final Envelope envelope, final Url returnUrl, final Boolean checkFirstRecipientOnly)
Description
Retrieves the signing URL for the next 'sign now' signer, either in-person or the current user as signer.

The caller must be the owner of the envelope.

Returns
The signing URL.
Parameters
envelope
final Envelope envelope
The Docusign envelope.
returnUrl
final Url returnUrl
Where to redirect after signing.
checkFirstRecipientOnly
final Boolean checkFirstRecipientOnly
Whether to check only the first recipient or all recipients.
global static Boolean shouldSignNow(final Envelope envelope)
Description
Determines whether the next Docusign envelope recipient can sign now. Either the signer or host must match the current Salesforce user.

The caller must be the owner of the envelope.

Returns
true if the next recipient can sign now, false otherwise.
Parameters
envelope
final Envelope envelope
The Docusign envelope.

EmailAddressTab

global class EmailAddressTab extends ReadOnlyTab
Description
An email address tab displays the recipient's email as entered in the recipient information. This value can't be set.

Methods

Description
Constructs an email address tab.

ESignatureAPIMock

@IsTest global class ESignatureAPIMock extends OAuthTokenMock implements HttpCalloutMock
Description
Test mock for the Docusign eSignature REST API. Numerous service methods result in a callout to Docusign, so the web service API must be mocked.

Service methods also require a user with the DocuSign Administrator or DocuSign User permission set as well as a Docusign test account configuration. The dfsle.UserMock.createDocuSignAdministrator and dfsle.UserMock.createDocuSignUser test helper methods are typically used in conjunction with the web service API mock to accomplish this. Example:

 static testMethod void myTest() {
   dfsle.ESignatureAPIMock().success();
   System.runAs(dfsle.UserMock.createDocuSignUser()) {
     // Call Docusign service methods
   }
 }
 

Methods

Description
Constructs a new success mock for the Docusign eSignature REST API.
global ESignatureAPIMock(final Boolean success)
Description
Constructs a new mock for the Docusign eSignature REST API.
Parameters
success
final Boolean success
Whether the requests should be successful.
global static ESignatureAPIMock failure()
Description
Factory constructor for the Docusign eSignature REST API with failure responses. This also sets the test mock via dfsle.Test.setMock.
Returns
The failure API test mock.
global static ESignatureAPIMock success()
Description
Factory constructor for the Docusign eSignature REST API with success responses. This also sets the test mock via dfsle.Test.setMock.
Returns
The success API test mock.

APIErrorCode

global class APIErrorCode
Description
Constants for API error codes.

SUCCESS
global static final Integer SUCCESS
No error occurred.
0
FAILURE
global static final Integer FAILURE
An unspecified error occurred.
1
NOT_FOUND
global static final Integer NOT_FOUND
Entity not found.
404
ACCOUNT_LACKS_PERMISSIONS
global static final Integer ACCOUNT_LACKS_PERMISSIONS
The account does not have access to a Docusign feature.
1003
USER_ALREADY_EXISTS_IN_ACCOUNT
global static final Integer USER_ALREADY_EXISTS_IN_ACCOUNT
The user is already a member of the account.
1004
UNKNOWN_RECIPIENT
global static final Integer UNKNOWN_RECIPIENT
The envelope recipient is unknown.
1005
USER_PENDING
global static final Integer USER_PENDING
The user is in a pending activation state.
1006
UNKNOWN_USER
global static final Integer UNKNOWN_USER
The user is unknown to Docusign.
1007
INVALID_RECIPIENT_SEQUENCE
global static final Integer INVALID_RECIPIENT_SEQUENCE
The recipient sequence is invalid for the envelope.
1008
TRIAL_ACCOUNT_EXPIRED
global static final Integer TRIAL_ACCOUNT_EXPIRED
The Docusign trial has expired.
1011
USER_NOT_ACTIVATED
global static final Integer USER_NOT_ACTIVATED
The user has not yet been activated in Docusign.
1013
HOURLY_API_LIMIT_EXCEEDED
global static final Integer HOURLY_API_LIMIT_EXCEEDED
The hourly API limit has been exceeded for the Docusign account.
1014
INVALID_DOCUMENT
global static final Integer INVALID_DOCUMENT
The envelope document is invalid.
1015
INVALID_RECIPIENT
global static final Integer INVALID_RECIPIENT
The envelope recipient is invalid.
1016
CONSENT_REQUIRED
global static final Integer CONSENT_REQUIRED
The user has not granted consent to be impersonated by this application.
1017
INVALID_SIGNING_GROUP
global static final Integer INVALID_SIGNING_GROUP
The envelope recipient signing group is invalid.
1022

SignatureTab

global abstract class SignatureTab extends Tab
Description
Base class for signature type tabs. This class may not be directly instantiated.
required
global Boolean required
When set to true, the signer is required to fill out this tab.

Corresponds to the optional API property.

scale
global Decimal scale
Scales the size of the tab. This field accepts values from 0.5 to 2.0, where 0.5 is half the normal size, 1.0 is normal size, and 2.0 is twice the normal size.

Corresponds to the scaleValue API property.

Methods

global SignatureTab withRequired(final Boolean required)
Description
Updates the tab required property.
Returns
The tab with an updated required value.
Parameters
required
final Boolean required
When set to true, the signer is required to fill out this tab.
global SignatureTab withScale(final Decimal scale)
Description
Updates the tab scale property.
Returns
The tab with an updated scale value.
Parameters
scale
final Decimal scale
Scales the size of the tab. This field accepts values from 0.5 to 2.0, where 0.5 is half the normal size, 1.0 is normal size, and 2.0 is twice the normal size.

NoteTab

global class NoteTab extends ReadOnlyTab
Description
A note tab displays additional information to the recipient in the form of a note. This value can be set.

Methods

global NoteTab()
Description
Constructs a note tab.

LoggerService

global with sharing class LoggerService
Description
Responsible for writing errors, warnings, info and debug statements to logs

This class is intended for Docusign internal use only.

Methods

@HttpPost global static void writeLogs()

ButtonTab

global abstract class ButtonTab extends Tab
Description
Base class for button type tabs. This class may not be directly instantiated.
buttonText
global String buttonText
Specifies the text that displays on the button tab.

Methods

global ButtonTab withButtonText(final String buttonText)
Description
Updates the tab buttonText property.
Returns
The tab with an updated buttonText value.
Parameters
buttonText
final String buttonText
Specifies the text that displays on the button tab.

Document

global virtual class Document implements Comparable
Description
Representation of a Docusign envelope document.
extension
@AuraEnabled global String extension
The file extension of the document.
id
@AuraEnabled global Id id
The ID of the associated dfsle__Document__c record.
lastModified
@AuraEnabled global Datetime lastModified
Date and time when the document was last modified.
name
@AuraEnabled global String name
The name of the document.
pdfOptions
@AuraEnabled global PdfOptions pdfOptions
PDF document options.
replacement
@AuraEnabled global Document replacement
The document replacing a template document in an envelope.
sequence
@AuraEnabled global Integer sequence
The ordinal sequence of the document as it appears in an envelope.
size
@AuraEnabled global Integer size
The size of the document in bytes.
sourceId
@AuraEnabled global String sourceId
The Salesforce source record ID or the Docusign template ID.
supplementalOptions
@AuraEnabled global SupplementalOptions supplementalOptions
Supplemental document options. If this is a non-null value, the document will be treated as supplemental.
type
@AuraEnabled global String type
The type of the document.
TYPE_TEMPLATE
global static final String TYPE_TEMPLATE
Docusign template document type constant.
'Template'
TYPE_FILE
global static final String TYPE_FILE
Salesforce file/content version document type constant.
'ContentVersion'
TYPE_DOCUMENT
global static final String TYPE_DOCUMENT
Salesforce document type constant.
'Document'
WRITE_BACK_NAME
global static final String WRITE_BACK_NAME
Use document name for the completed document name. Only valid when all completed documents are written back separately.
'Name'
WRITE_BACK_NAME_ENVELOPE_STATUS
global static final String WRITE_BACK_NAME_ENVELOPE_STATUS
Use document name and envelope status for the completed document name. Only valid when all completed documents are written back separately.
'NameEnvStatus'
WRITE_BACK_NAME_PDF
global static final String WRITE_BACK_NAME_PDF
Use document name with PDF extension for the completed document name. Only valid when all completed documents are written back separately.
'NamePDF'
WRITE_BACK_NAME_PDF_REPLACE_EXTENSION
global static final String WRITE_BACK_NAME_PDF_REPLACE_EXTENSION
Use document name and replace the extension with PDF for the completed document name. Only valid when all completed documents are written back separately.
'NamePDFReplaceExt'
WRITE_BACK_NAME_ENVELOPE_STATUS_PDF
global static final String WRITE_BACK_NAME_ENVELOPE_STATUS_PDF
Use document name with envelope status and PDF extension for the completed document name. Only valid when all completed documents are written back separately.
'NameEnvStatusPDF'
WRITE_BACK_NAME_ENVELOPE_STATUS_PDF_REPLACE_EXTENSION
global static final String WRITE_BACK_NAME_ENVELOPE_STATUS_PDF_REPLACE_EXTENSION
Use document name with envelope status and replace the extension with PDF for the completed document name. Only valid when all completed documents are written back separately.
'NameEnvStatusPDFReplaceExt'
WRITE_BACK_ENVELOPE_PDF
global static final String WRITE_BACK_ENVELOPE_PDF
Use envelope name and PDF extension for the completed document name. Only valid when completed documents are combined.
'EnvelopePDF'
WRITE_BACK_ENVELOPE_STATUS_PDF
global static final String WRITE_BACK_ENVELOPE_STATUS_PDF
Use envelope name, status, and PDF extension for the completed document name. Only valid when completed documents are combined.
'EnvelopeEnvStatusPDF'
SIGNER_ACKNOWLEDGEMENT_NONE
global static final String SIGNER_ACKNOWLEDGEMENT_NONE
Signer has no mandated interaction with a supplemental document.
'no_interaction'
SIGNER_ACKNOWLEDGEMENT_VIEW
global static final String SIGNER_ACKNOWLEDGEMENT_VIEW
Signer must view the supplemental document.
'view'
SIGNER_ACKNOWLEDGEMENT_ACCEPT
global static final String SIGNER_ACKNOWLEDGEMENT_ACCEPT
Signer must accept the supplemental document.
'accept'
SIGNER_ACKNOWLEDGEMENT_VIEW_ACCEPT
global static final String SIGNER_ACKNOWLEDGEMENT_VIEW_ACCEPT
Signer must view and accept the supplemental document.
'view_accept'
SIGNER_ACKNOWLEDGEMENT_READ_ACCEPT
global static final String SIGNER_ACKNOWLEDGEMENT_READ_ACCEPT
Signer must view, scroll to the end, and accept the supplemental document.
'view_read_accept'

Methods

global Document( final Id id, final String type, final Integer sequence, final String name, final String extension, final Integer size, final Datetime lastModified, final String sourceId )
Description
Constructs a new Docusign envelope document.
Parameters
id
final Id id
The ID of the associated dfsle__Document__c record.
type
final String type
The type of the document.
sequence
final Integer sequence
The ordinal sequence of the document as it appears in an envelope.
name
final String name
The name of the document.
extension
final String extension
The file extension of the document.
size
final Integer size
The file extension of the document.
lastModified
final Datetime lastModified
Date and time when the document was created.
sourceId
final String sourceId
The Salesforce source record ID or the Docusign template ID.
global static Document fromFile(final ContentVersion file)
Description
Converts a Salesforce content version (file) into a Docusign envelope document.
Returns
The Docusign envelope document representation of the content version.
Parameters
file
final ContentVersion file
The content version from which to construct a document.
global static Document fromTemplate(final UUID docuSignId, final String name)
Description
Creates a Docusign envelope document from a Docusign template.
Returns
The newly-created Docusign envelope document.
Parameters
docuSignId
final UUID docuSignId
The Docusign template ID.
name
final String name
The Docusign template name.
global virtual Document withPdfOptions(final PdfOptions pdfOptions)
Description
Sets the Docusign envelope document pdfOptions property.

This method will throw a DocuSignException if this document is not a PDF.

Returns
The Docusign envelope document with updated pdfOptions.
Parameters
pdfOptions
final PdfOptions pdfOptions
PDF document options.
global virtual Document withReplacement(final Document replacement)
Description
Replaces a Docusign template document in an envelope. Only one document may be replaced per template.

If the parent document type is not a template or if the replacement document type is a template, a DocuSignException is thrown.

If the Docusign template has multiple documents, they will all be replaced by this document. Depending on how tabs are assigned, the API may return an TAB_REFERS_TO_MISSING_DOCUMENT error. For this reason, this method should be used only with templates containing only a single document to replace.

Returns
The template with the replacement document.
Parameters
replacement
final Document replacement
The template replacement document. If null, no template document will be replaced.
global virtual Document withSupplementalOptions(final SupplementalOptions supplementalOptions)
Description
Sets the Docusign envelope document supplementalOptions property.

This method will throw a DocuSignException if this document is a Docusign envelope template.

Returns
@return The Docusign envelope document with updated supplementalOptions.
Parameters
supplementalOptions
final SupplementalOptions supplementalOptions
Supplemental document options. If this is a non-null value, the document will be treated as supplemental.

Document.Folder

global class Folder
Description
Representation of a Salesforce file folder.
id
@AuraEnabled global Id id
The Salesforce folder ID.
name
@AuraEnabled global String name
The Salesforce folder name.

Methods

global Folder(final Id id, final String name)
Description
Constructs a folder.
Parameters
id
final Id id
The Salesforce folder ID.
name
final String name
The Salesforce folder name.

Document.Folders

global class Folders
Description
Representation of a list of Salesforce file folders and documents contained within.
documents
@AuraEnabled global List<Document> documents
The list of Docusign envelope documents contained within the folders.
folders
@AuraEnabled global List<Folder> folders
The list of Salesforce folders.

Methods

global Folders(final List<Folder> folders, final List<Document> documents)
Description
Constructs a new list of folders and documents.
Parameters
folders
final List<Folder> folders
The list of Salesforce folders.
documents
final List<Document> documents
The list of Docusign envelope documents contained within the folders.

Document.PdfOptions

global class PdfOptions
Description
PDF document options.
recipientSequence
@AuraEnabled global Integer recipientSequence
The envelope sequence of the recipient for whom to assign the transformed PDF tabs. If not a valid positive integer, the transformed tabs will be assigned to the first recipient. Ignored if transformFields is false.
transformFields
@AuraEnabled global Boolean transformFields
When set to true, PDF form field data is transformed into document tab values when the PDF form field name matches the Docusign custom tab dataLabel. The resulting PDF form data is also returned in the PDF meta data when requesting the document PDF.

Methods

global PdfOptions(final Boolean transformFields, final Integer recipientSequence)
Description
Constructs PDF document options.
Parameters
transformFields
final Boolean transformFields
When set to true, PDF form field data is transformed into document tab values when the PDF form field name matches the Docusign custom tab dataLabel. The resulting PDF form data is also returned in the PDF meta data when requesting the document PDF.
recipientSequence
final Integer recipientSequence
The envelope sequence of the recipient for whom to assign the transformed PDF tabs. If not a valid positive integer, the transformed tabs will be assigned to the first recipient. Ignored if transformFields is false.

Document.WriteBack

global class WriteBack
Description
Options related to writing back completed envelope documents.
combineDocuments
@AuraEnabled global Boolean combineDocuments
Whether to combine the documents into one PDF.
includeCertificateOfCompletion
@AuraEnabled global Boolean includeCertificateOfCompletion
Whether to include the Certificate of Completion (CoC).
linkedEntityId
@AuraEnabled global Id linkedEntityId
Where to link the completed envelope documents. Defaults to the envelope source ID.
nameFormat
@AuraEnabled global String nameFormat
The naming format for the completed envelope documents.

Methods

global WriteBack( final Id linkedEntityId, final String nameFormat, final Boolean combineDocuments, final Boolean includeCertificateOfCompletion )
Description
Constructs document write-back options.
Parameters
linkedEntityId
final Id linkedEntityId
Where to link the completed envelope documents. Defaults to the envelope source ID.
nameFormat
final String nameFormat
The naming format for the completed envelope documents. Refer to the dfsle.Document.WRITE_BACK_* constants for supported options.
combineDocuments
final Boolean combineDocuments
Whether to combine the documents into one PDF.
includeCertificateOfCompletion
final Boolean includeCertificateOfCompletion
Whether to include the Certificate of Completion (CoC).

Document.SupplementalOptions

global class SupplementalOptions
Description
Supplemental document options.
includeInDownload
global Boolean includeInDownload
When set to true, the document is included in the combined document download. The default value is true.
signerAcknowledgement
global String signerAcknowledgement
Sets how the signer interacts with the supplemental document. Supported constants:
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_NONE: Signer has no mandated interaction with a supplemental document.
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_VIEW: Signer must view the supplemental document.
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_ACCEPT: Signer must accept the supplemental document.
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_VIEW_ACCEPT: Signer must view and accept the supplemental document.
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_VIEW_READ_ACCEPT: Signer must view, read, and accept the supplemental document.
The default value is dfsle.Document.SIGNER_ACKNOWLEDGEMENT_NONE.

Methods

global SupplementalOptions(final String signerAcknowledgement, final Boolean includeInDownload)
Description
Constructs supplemental document options.
Parameters
signerAcknowledgement
final String signerAcknowledgement
Sets how the signer interacts with the supplemental document. Supported constants:
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_NONE: Signer has no mandated interaction with a supplemental document.
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_VIEW: Signer must view the supplemental document.
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_ACCEPT: Signer must accept the supplemental document.
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_VIEW_ACCEPT: Signer must view and accept the supplemental document.
  • dfsle.Document.SIGNER_ACKNOWLEDGEMENT_VIEW_READ_ACCEPT: Signer must view, read, and accept the supplemental document.
The default value is dfsle.Document.SIGNER_ACKNOWLEDGEMENT_NONE.
includeInDownload
final Boolean includeInDownload
When set to true, the document is included in the combined document download. The default value is true.

PaymentTab

global class PaymentTab extends FormulaTab
Description
A Docusign envelope recipient payment tab.

To learn more about payments, see Requesting Payments Along with Signatures.

payment
global Payment payment
This property indicates that this formula tab is a payment item.

See Requesting Payments Along with Signatures in the Docusign Support Center to learn more about payments.

Corresponds to the paymentDetails API property.

Methods

global PaymentTab()
Description
Constructs a payment tab.
global PaymentTab withPayment(final Payment payment)
Description
Updates the tab payment property.
Returns
The tab with an updated payment value.
Parameters
payment
final Payment payment
This property indicates that this formula tab is a payment item.

PaymentTab.LineItem

global class LineItem
Description
A payment line item.
amountReference
global String amountReference
This is a the tab dataLabel that specifies the amount paid for the line items.
description
global String description
A sender-defined description of the line item.
itemCode
global String itemCode
This is the sender-defined SKU, inventory number, or other item code for the line item.
name
global String name
This is a sender-defined product name, service name, or other designation for the line item.

Methods

global LineItem(final String name, final String description, final String itemCode, final String amountReference)
Description
Constructs a payment line item.
Parameters
name
final String name
This is a sender-defined product name, service name, or other designation for the line item.
description
final String description
A sender-defined description of the line item.
itemCode
final String itemCode
This is the sender-defined SKU, inventory number, or other item code for the line item.
amountReference
final String amountReference
This is a the tab dataLabel that specifies the amount paid for the line items.

PaymentTab.Payment

global class Payment
Description
Payment details.
authorize
global Boolean authorize
When true, the payment details will be used to collect payment.

Corresponds to the paymentOption API property.

currencyCode
global String currencyCode
Specifies the three-letter ISO 4217 currency code for the payment. Supported currencies are:
  • AUD: Australian dollar
  • CAD: Canadian dollar
  • EUR: Euro
  • GBP: Great Britain pound
  • USD: United States dollar
  • Specifying any other ISO 4217 code for payments is an error.

customerId
global String customerId
The customer ID.
customMetadata
global String customMetadata
This is a sender-defined field that passes any extra metadata about the payment that will show up in the Authorize.net transaction under Description in the merchant gateway portal. The custom metadata will be recorded in downloaded Authorize.net reports.
customMetadataRequired
global Boolean customMetadataRequired
A sender-defined field that specifies whether custom metadata is required for the transaction. When set to true, custom metadata is required. This property only applies if you are using an Authorize.net payment gateway account.
docuSignGatewayId
global UUID docuSignGatewayId
A GUID that identifies the payment gateway connected to the sender's Docusign account.

There is no public API for connecting payment gateway accounts You must connect and manage payment gateway accounts through the Docusign Admin console and through your chosen payment gateway. You can get the gateway account ID in the Payments section of the Docusign Admin console.

Corresponds to the gatewayAccountId API property.

lineItems
global List<LineItem> lineItems
A payment formula can have one or more line items that provide detail about individual items in a payment request. The list of line items are returned as metadata to the payment gateway.
methods
global List<String> methods
An array of accepted payment methods:
  • CreditCard
  • ApplePay
  • AndroidPay
  • BankAccount

For example, if you only accept credit cards and ACH transfers, you would set this property to: '["BankAccount", "CreditCard"]'.

Do not specify BankAccount (ACH) if you are also using in-person signing.

Corresponds to the allowedPaymentMethods API property.

save
global Boolean save
When true, the signer's payment method (credit card or bank account) will be saved to the sender's payment gateway.

Corresponds to the paymentOption API property.

sourceId
global String sourceId
The payment source ID.

Corresponds to the paymentSourceId API property.

Methods

global Payment( final UUID docuSignGatewayId, final String customerId, final String sourceId, final List<String> methods, final String currencyCode, final List<LineItem> lineItems, final Boolean authorize, final Boolean save, final String customMetadata, final Boolean customMetadataRequired )
Description
Constructs payment details.
Parameters
docuSignGatewayId
final UUID docuSignGatewayId
A GUID that identifies the payment gateway connected to the sender's Docusign account.
customerId
final String customerId
The customer ID.
sourceId
final String sourceId
The payment source ID.
methods
final List<String> methods
An array of accepted payment methods.
currencyCode
final String currencyCode
Specifies the three-letter ISO 4217 currency code for the payment.
lineItems
final List<LineItem> lineItems
A payment formula can have one or more line items that provide detail about individual items in a payment request. The list of line items are returned as metadata to the payment gateway.
authorize
final Boolean authorize
When true, the payment details will be used to collect payment.
save
final Boolean save
When true, the signer's payment method (credit card or bank account) will be saved to the sender's payment gateway.
customMetadata
final String customMetadata
This is a sender-defined field that passes any extra metadata about the payment that will show up in the Authorize.net transaction under Description in the merchant gateway portal.
customMetadataRequired
final Boolean customMetadataRequired
A sender-defined field that specifies whether custom metadata is required for the transaction. When set to true, custom metadata is required.

ValidationResult

global class ValidationResult
Description
The result of a validation.
messages
global List<String> messages
Validation error messages.

EUAdvancedAccessCodeProvider

Description
Docusign-generated, eIDAS AES compliant signatures with access code authentication.
accessCode
global String accessCode
A pre-shared secret that the signer must enter to complete the signing process. Eg last six digits of the signer's government ID or Social Security number. Or a newly created pre-shared secret for the transaction. Note: some signature providers may require an exact (case-sensitive) match if alphabetic characters are included in the field.

Methods

global EUAdvancedAccessCodeProvider(final String accessCode)
Description
Constructs an EU Advanced signature provider with access code authentication.
Parameters
accessCode
final String accessCode
A pre-shared secret that the signer must enter to complete the signing process.

TestUtils

@IsTest global class TestUtils
Description
Utility methods to support unit testing.

Methods

global static HttpCalloutMock setMock(final HttpCalloutMock mock)
Description
Sets an HTTP callout mock for a unit test. This method must be called from external code requiring use of the Docusign REST API mocks instead of calling Test.setMock directly.
Returns
The HTTP callout mock.
Parameters
mock
final HttpCalloutMock mock
An instance of a class implementing the HttpCalloutMock interface.
global static WebServiceMock setMock(final WebServiceMock mock)
Description
Sets an SOAP callout mock for a unit test. This method must be called from external code requiring use of the Docusign SOAP API mocks instead of calling Test.setMock directly.
Returns
The SOAP callout mock.
Parameters
mock
final WebServiceMock mock
An instance of a class implementing the WebServiceMock interface.

UserMock

@IsTest global class UserMock
Description
Test utility methods to mock Docusign users. Most service operations require either a Docusign administrator or Docusign user context.

Methods

global static User createDocuSignAdministrator()
Description
Creates a user and assigns the DocuSign Administrator permission set for unit tests. This may be used for Docusign administrative methods.

This method also creates a test Docusign account configuration. As such, may only be called once per test method, and it may not be combined with any other dfsle.UserMock.create* method. Example:

 static testMethod void myTest() {
   dfsle.TestUtils.setMock(dfsle.DocuSignAPIMock.success());
   System.runAs(dfsle.UserMock.createDocuSignAdministrator()) {
     // Call service method requiring the DocuSign Administrator permission set.
   }
 }
 
Returns
A user with the DocuSign Administrator permission set.
global static User createDocuSignSender()
Description
Creates a user and assigns the DocuSign Sender permission set for unit tests. This may be used for Docusign eSignature methods that create, send, or sign envelopes.

This method also creates a test Docusign account configuration. As such, may only be called once per test method, and it may not be combined with any other dfsle.UserMock.create* method. Example:

 static testMethod void myTest() {
   dfsle.TestUtils.setMock(dfsle.DocuSignAPIMock.success());
   System.runAs(dfsle.UserMock.createDocuSignSender()) {
     // Call service method requiring the DocuSign Sender permission set.
   }
 }
 
Returns
A user with the DocuSign Sender permission set.
global static User createDocuSignUser()
Description
Creates a user and assigns the DocuSign User permission set for unit tests. This may be used for most Docusign eSignature methods.

This method also creates a test Docusign account configuration. As such, may only be called once per test method, and it may not be combined with any other dfsle.UserMock.create* method. Example:

 static testMethod void myTest() {
   dfsle.TestUtils.setMock(dfsle.DocuSignAPIMock.success());
   System.runAs(dfsle.UserMock.createDocuSignUser()) {
     // Call service method requiring the DocuSign User permission set.
   }
 }
 
Returns
A user with the DocuSign User permission set.

AccountService

global with sharing class AccountService
Description
Primary interface point for Docusign account management.

Methods

global static Url getDocuSignUrl()
Description
Retrieves a URL that can be used to display the Docusign console. This URL can only be used once.

The caller must be assigned the DocuSign User permission set, and must be an active member of the Docusign account.

Returns
The Docusign console URL.

PivProvider

global class PivProvider extends SignatureProvider
Description
The US federal government specifies Personal Identity Verification (PIV) smart card requirements for federal employees and contractors. This provider enables PIV card holders to digitally sign documents.
isProduction
global Boolean isProduction
Set to true when using a production PIV signature provider or false when testing.

Methods

global PivProvider(final Boolean isProduction)
Description
Constructs a PIV signature provider.
Parameters
isProduction
final Boolean isProduction
Set to true when using a production PIV signature provider or false when testing.

EmailTab

global class EmailTab extends ReadWriteTab
Description
An email tab enables the recipient to enter an email address. This is a one-line field that checks that a valid email address is entered. It uses the same parameters as a text tab, with the validation message and pattern set for email information. This value can be set.

Methods

global EmailTab()
Description
Constructs an email tab.

Envelope

global class Envelope
Description
Representation of a Docusign envelope.
customFields
@AuraEnabled global List<CustomField> customFields
A list of envelope custom fields. These are not persisted via the dfsle__Envelope__c object.
documents
@AuraEnabled global List<Document> documents
A list of documents contained by the envelope.
docuSignId
@AuraEnabled global UUID docuSignId
The Docusign ID of the envelope, assigned when the envelope is sent or a draft envelope is created.
emailMessage
@AuraEnabled global String emailMessage
The message of the email recipients receive. This is contained within the standard Docusign email body.
emailSubject
@AuraEnabled global String emailSubject
The subject of the email recipients receive.
envelopeConfigurationId
@AuraEnabled global Id envelopeConfigurationId
The ID of the configuration used to create the envelope.
error
@AuraEnabled global APIError error
The error returned by the API in multi-send scenarios.
id
@AuraEnabled global Id id
The ID of the associated dfsle__Envelope__c record.
name
@AuraEnabled global String name
The name of the envelope.
notifications
@AuraEnabled global Notifications notifications
The reminder and expiration settings for the envelope.
options
@AuraEnabled global Envelope.Options options
The envelope options controlling default auto-place text and data and document write-back.
recipients
@AuraEnabled global List<Recipient> recipients
A list of recipients who receive the envelope.
sent
@AuraEnabled global Datetime sent
The date and time when the envelope was sent.
source
@AuraEnabled global Entity source
The Salesforce source object for the envelope (e.g. Opportunity or Lead).
transactionId
@AuraEnabled global UUID transactionId
Sender-generated identifier of the envelope used to prevent envelopes from being sent multiple times in cases where the status is indeterminate. For example, when the network connection drops while waiting for a response. This value is valid in the Docusign system for 7 days.
STATUS_CREATED
global static final String STATUS_CREATED
Created status constant.
'created'
STATUS_SENT
global static final String STATUS_SENT
Sent status constant.
'sent'
STATUS_DELIVERED
global static final String STATUS_DELIVERED
Delivered status constant.
'delivered'
STATUS_DECLINED
global static final String STATUS_DECLINED
Declined status constant.
'declined'
STATUS_VOIDED
global static final String STATUS_VOIDED
Voided status constant.
'voided'
STATUS_COMPLETED
global static final String STATUS_COMPLETED
Completed status constant.
'completed'

Methods

global Envelope( final Id id, final String name, final UUID docuSignId, final Id envelopeConfigurationId, final List<Document> documents, final List<Recipient> recipients, final List<CustomField> customFields, final Notifications notifications, final String emailSubject, final String emailMessage, final Entity source, final Datetime sent )
Description
Constructs a Docusign envelope.
Parameters
id
final Id id
The ID of the associated dfsle__Envelope__c record.
name
final String name
The name of the envelope.
docuSignId
final UUID docuSignId
The Docusign ID of the envelope.
envelopeConfigurationId
final Id envelopeConfigurationId
The ID of the configuration used to create the envelope.
documents
final List<Document> documents
A list of documents contained by the envelope.
recipients
final List<Recipient> recipients
A list of recipients who receive the envelope.
customFields
final List<CustomField> customFields
A list of envelope custom fields.
notifications
final Notifications notifications
The reminder and expiration settings for the envelope.
emailSubject
final String emailSubject
The subject of the email recipients receive.
emailMessage
final String emailMessage
The message of the email recipients receive.
source
final Entity source
The Salesforce source object for the envelope.
sent
final Datetime sent
The date and time when the envelope was sent.
global static Envelope newBulkCopy(final Recipient recipient)
Description
Creates an empty bulk copy of an envelope with the specified recipient.
Returns
A bulk envelope copy with a single recipient.
Parameters
recipient
final Recipient recipient
The new recipient for the bulk copy.
global static Envelope newBulkCopy(final List<Recipient> recipients)
Description
Creates an empty bulk copy of an envelope with the specified recipients.
Returns
A bulk envelope copy.
Parameters
recipients
final List<Recipient> recipients
The new recipients for the bulk copy.
global Envelope withCustomFields(final List<CustomField> customFields)
Description
Sets the envelope's customFields property.
Returns
This envelope with the updated customFields property.
Parameters
customFields
final List<CustomField> customFields
The new list of custom fields.
global Envelope withDocuments(final List<Document> documents)
Description
Sets the envelope's documents property.
Returns
This envelope with the updated documents property.
Parameters
documents
final List<Document> documents
The new list of documents.
global Envelope withDocuSignId(final UUID docuSignId)
Description
Sets the envelope's docuSignId property.
Returns
This envelope with the updated docuSignId property.
Parameters
docuSignId
final UUID docuSignId
The new Docusign ID of the envelope.
global Envelope withEmail(final String emailSubject, final String emailMessage)
Description
Sets the envelope's emailSubject and emailMessage properties.
Returns
This envelope with the updated emailSubject and emailMessage properties.
Parameters
emailSubject
final String emailSubject
The new email subject.
emailMessage
final String emailMessage
The new email message.
global Envelope withNotifications(final Notifications notifications)
Description
Sets the envelope's notifications property.
Returns
This envelope with the updated notifications property.
Parameters
notifications
final Notifications notifications
The new notification settings.
global Envelope withOptions(final Envelope.Options options)
Description
Sets the envelope's options property.
Returns
This envelope with the updated options property.
Parameters
options
final Envelope.Options options
The new envelope options. If null, default options will apply.
global Envelope withRecipients(final List<Recipient> recipients)
Description
Sets the envelope's recipients property.
Returns
This envelope with the updated recipients property.
Parameters
recipients
final List<Recipient> recipients
The new list of recipients.
global Envelope withSent(final Datetime sent)
Description
Sets the envelope's sent property.
Returns
This envelope with the updated sent property.
Parameters
sent
final Datetime sent
The new date and time when the envelope was sent.

Envelope.Options

global class Options
Description
Representation of Docusign envelope options.
documentWriteBack
@AuraEnabled global Document.WriteBack documentWriteBack
Document write-back options for completed envelopes.
envelopeEventUpdates
@AuraEnabled global Map<String, Map<String, Object>> envelopeEventUpdates
Map of envelope status to map of field updates. Refer to the dfsle.Envelope.STATUS_* constants for possible keys.

For data write-back to function properly:

  1. The envelope must be persisted to the database.
  2. The updates must be related to the envelope source object.
  3. The sending user must have update permissions on the target objects and fields.
For example, to update Opportunity.StageName to Closed Won when an envelope is complete:
 envelopeEventUpdates = new Map<String, Map<String, Object>> {
   dfsle.Envelope.STATUS_COMPLETED => new Map<String, Object> {
     'StageName' => 'Closed Won'
   }
 };
 
includeDefaultAutoPlaceTags
@AuraEnabled global Boolean includeDefaultAutoPlaceTags
Whether to include default anchor tabs that map to recipient roles.
recipientEventUpdates
@AuraEnabled global Map<String, Map<String, Object>> recipientEventUpdates
Map of recipient status to map of field updates. Refer to the dfsle.Recipient.STATUS_* constants for possible keys.

For data write-back to function properly:

  1. The envelope must be persisted to the database.
  2. The updates must be related to the recipient source object.
  3. The sending user must have update permissions on the target objects and fields.
For example, to update Contact.ContractDelivered__c to true when a recipient has received the envelope:
 recipientEventUpdates = new Map<String, Map<String, Object>> {
   dfsle.Recipient.STATUS_DELIVERED => new Map<String, Object> {
     'ContractDelivered__c' => true
   }
 };
 

Methods

global Options( final Boolean includeDefaultAutoPlaceTags, final Document.WriteBack documentWriteBack, final Map<String, Map<String, Object>> envelopeEventUpdates, final Map<String, Map<String, Object>> recipientEventUpdates )
Description
Constructs Docusign envelope options.
Parameters
includeDefaultAutoPlaceTags
final Boolean includeDefaultAutoPlaceTags
Whether to include default anchor tabs that map to recipient roles.
documentWriteBack
final Document.WriteBack documentWriteBack
Document write-back options for completed envelopes.
envelopeEventUpdates
final Map<String
Map of envelope status to map of field updates.
recipientEventUpdates
Map<String
Map of recipient status to map of field updates.

Envelope.Status

global class Status implements Comparable
Description
Docusign envelope status.
completed
@AuraEnabled global Datetime completed
Date and time when the envelope was completed.
docuSignId
@AuraEnabled global UUID docuSignId
The Docusign envelope ID.
emailSubject
@AuraEnabled global String emailSubject
The subject of the email message sent.
expires
@AuraEnabled global Datetime expires
Date and time when the envelope expires.
id
@AuraEnabled global Id id
The ID of the underlying dfsle__EnvelopeStatus__c record.
lastStatusUpdate
@AuraEnabled global Datetime lastStatusUpdate
Date and time when the status was last updated.
reason
@AuraEnabled global String reason
The reason the envelope was declined or voided.
recipients
@AuraEnabled global List<Recipient.Status> recipients
Associated recipient statuses.
senderEmail
@AuraEnabled global String senderEmail
The sender email address.
senderName
@AuraEnabled global String senderName
The sender name.
sent
@AuraEnabled global Datetime sent
Date and time when the envelope was sent.
source
@AuraEnabled global Entity source
The Salesforce source entity.
status
@AuraEnabled global String status
The current status.

Methods

global Status( final Id id, final Entity source, final UUID docuSignId, final String status, final String senderName, final String senderEmail, final List<Recipient.Status> recipients, final Datetime sent, final Datetime expires, final Datetime completed, final String emailSubject, final String reason, final Datetime lastStatusUpdate )
Description
Constructs a Docusign envelope status.
Parameters
id
final Id id
The ID of the underlying dfsle__EnvelopeStatus__c record.
source
final Entity source
The Salesforce source entity.
docuSignId
final UUID docuSignId
The Docusign envelope ID.
status
final String status
The current status.
senderName
final String senderName
The sender name.
senderEmail
final String senderEmail
The sender email address.
recipients
final List<Recipient.Status> recipients
Associated recipient statuses.
sent
final Datetime sent
Date and time when the envelope was sent.
expires
final Datetime expires
Date and time when the envelope expires.
completed
final Datetime completed
Date and time when the envelope was completed.
emailSubject
final String emailSubject
The subject of the email message sent.
reason
final String reason
The reason the envelope was declined or voided.
lastStatusUpdate
final Datetime lastStatusUpdate
Date and time when the status was last updated.

AuthService

global with sharing class AuthService
Description
This class encapsulates methods to support Authorization for Docusign Apps Launcher

Methods

global static Url getLoginUrl(final String redirectTo)
Description
Generates a Docusign login URL where a user can grant consent to this application. The calling application should redirect the user to this URL. Once login is complete, the user will be redirected to the path specified by redirectTo.

The redirectTo parameter must be a path to a page in the current Salesforce org. The org domain base URL will be prepended to this. Upon redirect, two additional parameters are appended:

  • dfsle__status: either Success or Failure.
  • dfsle__message: additional details in the case of failures.

The resulting URL is valid for only a single use by the current user.

Callers must be assigned the DocuSign Login permission set or better.

Example:

 Url loginUrl = dfsle.AuthService.getLoginUrl('/apex/MyReturnPage');
 // Redirect the user to loginUrl. There they can authenticate with Docusign and grant consent to the application.
 // After successful authorization, the user is redirected to
 // https://your-domain.my.salesforce.com/apex/MyReturnPage?dfsle__status=Success.
 
Returns
The Docusign login URL.
Parameters
redirectTo
final String redirectTo
Where to redirect the user to after login. This must be a local path to a page that will handle the authorization result.

FirstNameTab

global class FirstNameTab extends ReadOnlyTab
Description
A first name tab displays the recipient's first name. The system automatically populates this field by splitting the name in the recipient information on spaces. This value can't be set.

Methods

global FirstNameTab()
Description
Constructs a first name tab.

SigningGroup

global class SigningGroup
Description
A Docusign signing group.
id
@AuraEnabled global Integer id
The Docusign signing group ID.
name
@AuraEnabled global String name
The Docusign signing group name.

Methods

global SigningGroup(final Integer id, final String name)
Description
Constructs a Docusign signing group.
Parameters
id
final Integer id
The Docusign signing group ID.
name
final String name
The Docusign signing group name.

EventService

global with sharing class EventService
Description
Handles envelope and recipient events sent by the Docusign platform.

This class is intended for Docusign internal use only.

Methods

@HttpPut global static void publishEvents()
Description
Publishes envelope and recipient events to Docusign Apps Launcher.

This class is intended for Docusign internal use only.

UUID

global class UUID
Description
Represents a UUID/GUID.

Methods

global static UUID parse(final String s)
Description
Parses a string as a UUID. Throws a StringException if the input string is blank or does not match the UUID pattern.
Returns
The parsed UUID, assuming the input string is valid.
Parameters
s
final String s
The input string matching the pattern [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}.
global static UUID randomUUID()
Description
Generates a cryptographically-random UUID. Useful for generating secrets or unit testing methods requiring a UUID argument.
Returns
The generated UUID.
global static UUID tryParse(final String s)
Description
Attempts to parse a string as a UUID.
Returns
The parsed UUID if the input string is valid, or null if the input string is invalid.
Parameters
s
final String s
The input string matching the pattern [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}.

CompanyTab

global class CompanyTab extends ReadWriteTab
Description
A company tab displays a field for the name of the recipient's company. This value can't be set.

Methods

global CompanyTab()
Description
Constructs a company tab.

TabGroup

global class TabGroup extends Tab
Description
A Docusign envelope recipient tab group.

To assign a tab to a group, you assign the group's dataLabel to the tab's tabDataLabels array.

maximumTabs
global Integer maximumTabs
The maximum number of tabs within the group that should be checked, populated, or signed. This property is used for validation.

Corresponds to the maximumAllowed API property.

minimumTabs
global Integer minimumTabs
The minimum number of tabs within the group that should be checked, populated, or signed. This property is used for validation.

Corresponds to the minimumRequired API property.

rule
global String rule
Specifies how minimumTabs and maximumTabs are interpreted when selecting tabs in a group. Possible values are:
  • SelectAtLeast
  • SelectAtMost
  • SelectExactly
  • SelectARange

Corresponds to the groupRule API property.

scope
global String scope
The scope of the tab group. Possible values are:
  • document
  • envelope (default)

Corresponds to the tabScope API property.

Methods

global TabGroup()
Description
Constructs a tab group.
global TabGroup withMaximumTabs(final Integer maximumTabs)
Description
Updates the tab maximumTabs property.
Returns
The tab with an updated maximumTabs value.
Parameters
maximumTabs
final Integer maximumTabs
The maximum number of tabs within the group that should be checked, populated, or signed. This property is used for validation.
global TabGroup withMinimumTabs(final Integer minimumTabs)
Description
Updates the tab minimumTabs property.
Returns
The tab with an updated minimumTabs value.
Parameters
minimumTabs
final Integer minimumTabs
The minimum number of tabs within the group that should be checked, populated, or signed. This property is used for validation.
global TabGroup withRule(final String rule)
Description
Updates the tab rule property.
Returns
The tab with an updated rule value.
Parameters
rule
final String rule
Specifies how minimumTabs and maximumTabs are interpreted when selecting tabs in a group.
global TabGroup withScope(final String scope)
Description
Updates the tab scope property.
Returns
The tab with an updated scope value.
Parameters
scope
final String scope
The scope of the tab group.

SignatureProvider

global abstract class SignatureProvider
Description
Base class for standards-based signature providers. This may not be directly instantiated.

Refer to Standards-based signatures on the Docusign Developer Center for more details.

providerType
global Type providerType
The type of signature provider.
Type
global enum Type
The type of signature provider.

ReadOnlyTab

global abstract class ReadOnlyTab extends Tab
Description
Base class for read-only tabs. This class may not be directly instantiated.
formatting
global Tab.Formatting formatting
Tab formatting settings.
value
global Object value
Specifies the value of the tab.

Methods

global ReadOnlyTab withFormatting(final Tab.Formatting formatting)
Description
Updates the tab formatting property.
Returns
The tab with an updated formatting value.
Parameters
formatting
final Tab.Formatting formatting
Tab formatting settings.
global ReadOnlyTab withValue(final Object value)
Description
Updates the tab value property.
Returns
The tab with an updated value value.
Parameters
value
final Object value
Specifies the value of the tab.

EnvelopeConfiguration

Description
A Docusign eSignature envelope configuration.

StatusService

global with sharing class StatusService
Description
This class is the entry point for Docusign eSignature envelope and recipient status management. It provides methods to retrieve and take action upon Docusign eSignature statuses.

Methods

global static List<Envelope.Status> createStatus(final List<Envelope.Status> envelopes)
Description
Creates envelope status records from a list of sent envelopes. This will fail if any of the envelopes already has a status record associated with it.

The caller must be the owner of the envelopes.

Returns
The new envelope statuses.
Parameters
envelopes
final List<Envelope.Status> envelopes
The Docusign envelopes from which to create statuses. These must have been previously sent with a non-null docuSignId.
global static Url getCorrectUrl(final UUID docuSignId, final Url returnUrl)
Description
Retrieves an envelope correction URL from Docusign. The URL may be used once.

The caller must be the owner of the envelope.

Returns
The envelope correction URL.
Parameters
docuSignId
final UUID docuSignId
The Docusign envelope ID.
returnUrl
final Url returnUrl
Where to redirect once correction is complete.
global static List<Envelope.Status> getStatus(final Set<Id> sourceIds, final Integer maximumRecords)
Description
Retrieves envelope statuses associated with Salesforce source records.
Returns
A list of envelope statuses.
Parameters
sourceIds
final Set<Id> sourceIds
The IDs of the initiating Salesforce objects.
maximumRecords
final Integer maximumRecords
The maximum number of records to retrieve.
global static Url getViewUrl(final UUID docuSignId, final Url returnUrl)
Description
Retrieves an envelope view URL from Docusign. The URL may be used once.
Returns
The envelope view URL.
Parameters
docuSignId
final UUID docuSignId
The Docusign envelope ID.
returnUrl
final Url returnUrl
Where to redirect once viewing is complete.
global static Boolean resendEnvelope(final UUID docuSignId)
Description
Resends a Docusign envelope to pending recipients in the routing order.

The caller must be the owner of the envelope.

Returns
true if the envelope was resent, false otherwise.
Parameters
docuSignId
final UUID docuSignId
The Docusign envelope ID.
global static List<Recipient.ResendResult> resendRecipients(final UUID docuSignId, final List<Recipient> recipients)
Description
Resends a Docusign envelope to the specified recipients. This method may be partially successful, so check the returned results for errors.

The caller must be the owner of the envelope.

Returns
A list of recipient resend results.
Parameters
docuSignId
final UUID docuSignId
The Docusign envelope ID.
recipients
final List<Recipient> recipients
The recipients for which to resend the envelope.
global static Boolean voidEnvelope(final UUID docuSignId, final String reason)
Description
Voids a Docusign envelope. The envelope must be in the 'sent' or 'delivered' state and a non-blank reason must be provided.

The caller must be the owner of the envelope.

Returns
true if the void operation was successful, false otherwise.
Parameters
docuSignId
final UUID docuSignId
The Docusign envelope ID.
reason
final String reason
The reason to void the envelope.

FullNameTab

global class FullNameTab extends ReadOnlyTab
Description
A full name tab displays the recipient's full name. This value can't be set.

Methods

global FullNameTab()
Description
Constructs a full name tab.

Tab

global abstract class Tab
Description
Base class for Docusign envelope recipient tabs. This may not be directly instantiated.

All of the property values are passed through as-is to the eSignature REST API. For more information regarding how to construct and use envelope recipient tabs, refer to Envelope Recipient Tabs on the Docusign Developer Center.

anchor
@AuraEnabled global Anchor anchor
Tab auto-place settings.
ComponentType
global enum ComponentType
Tab merge field path component types.
condition
global Condition condition
Conditional tab settings.
customTabId
@AuraEnabled global UUID customTabId
The Docusign-generated custom tab ID for the custom tab to be applied. This can only be used when adding new tabs for a recipient. When used, the new tab inherits all the custom tab properties.
dataLabel
@AuraEnabled global String dataLabel
The label associated with the tab. This value may be an empty string. If no value is provided, the tab type is used as the value.

Corresponds with the tabLabel API property.

groupDataLabels
global List<String> groupDataLabels
An array of tab group data labels that uniquely identify tab groups. To assign a tab to a group, you assign the group's dataLabel to this array.

Corresponds to the tabGroupLabels API property.

guidedForm
global GuidedForm guidedForm
Tab guided form settings.
id
global UUID id
The unique identifier for the tab.

Corresponds with the tabId API property.

name
global String name
The name of the tab.
order
global Integer order
A positive integer that sets the order the tab is navigated to during signing.

Tabs on a page are navigated to in ascending order, starting with the lowest number and moving to the highest. If two or more tabs have the same order value, the normal auto-navigation setting behavior for the envelope is used.

Corresponds to the tabOrder API property.

position
@AuraEnabled global Position position
Tab position on the document.
smartContract
global SmartContract smartContract
Tab smart contract settings.
tabType
global Type tabType
The type of the tab. This property is read-only.
tooltip
@AuraEnabled global String tooltip
The text of a tooltip that appears when a user hovers over a form field or tab.
Type
global enum Type
Docusign envelope recipient tab types.

Methods

global Tab withAnchor(final Anchor anchor)
Description
Updates the tab anchor property.
Returns
The tab with an updated anchor value.
Parameters
anchor
final Anchor anchor
Tab auto-place settings.
global Tab withCondition(final Condition condition)
Description
Updates the tab condition property.
Returns
The tab with an updated condition value.
Parameters
condition
final Condition condition
Conditional tab settings.
global Tab withCustomTabId(final UUID customTabId)
Description
Updates the tab customTabId property.
Returns
The tab with an updated customTabId value.
Parameters
customTabId
final UUID customTabId
The Docusign-generated custom tab ID for the custom tab to be applied.
global Tab withDataLabel(final String dataLabel)
Description
Updates the tab dataLabel property.
Returns
The tab with an updated dataLabel value.
Parameters
dataLabel
final String dataLabel
The label associated with the tab.
global Tab withGroupDataLabels(final List<String> groupDataLabels)
Description
Updates the tab groupDataLabels property.
Returns
The tab with an updated groupDataLabels value.
Parameters
groupDataLabels
final List<String> groupDataLabels
An array of tab group data labels that uniquely identify tab groups.
global Tab withGuidedForm(final GuidedForm guidedForm)
Description
Updates the tab guidedForm property.
Returns
The tab with an updated guidedForm value.
Parameters
guidedForm
final GuidedForm guidedForm
Tab guided form settings.
global Tab withId(final UUID id)
Description
Updates the tab id property.
Returns
The tab with an updated id value.
Parameters
id
final UUID id
The unique identifier for the tab.
global Tab withName(final String name)
Description
Updates the tab name property.
Returns
The tab with an updated name value.
Parameters
name
final String name
The name of the tab.
global Tab withOrder(final Integer order)
Description
Updates the tab order property.
Returns
The tab with an updated order value.
Parameters
order
final Integer order
A positive integer that sets the order the tab is navigated to during signing.
global Tab withPosition(final Position position)
Description
Updates the tab position property.
Returns
The tab with an updated position value.
Parameters
position
final Position position
Tab position on the document.
global Tab withSmartContract(final SmartContract smartContract)
Description
Updates the tab smartContract property.
Returns
The tab with an updated smartContract value.
Parameters
smartContract
final SmartContract smartContract
Tab smart contract settings.
global Tab withTooltip(final String tooltip)
Description
Updates the tab tooltip property.
Returns
The tab with an updated tooltip value.
Parameters
tooltip
final String tooltip
The text of a tooltip that appears when a user hovers over a form field or tab.

Tab.Position

global class Position
Description
Where to apply the tab and the dimensions of the tab.
documentSequence
global Integer documentSequence
On which document to apply the tab.

Corresponds to the documentId API property.

height
@AuraEnabled global Integer height
The height of the tab in pixels.
pageNumber
global Integer pageNumber
Specifies the page number on which the tab is located. For supplemental documents, this value must be 1.
width
@AuraEnabled global Integer width
The width of the tab in pixels.
x
global Integer x
This property indicates the horizontal offset of the object on the page. Docusign uses 72 DPI when determining position. Required. May be zero.

To improve the tab's position on the document, Docusign recommends adjusting the X and Y position coordinates by (-3, -2).

Corresponds to the xPosition API property.

y
global Integer y
This property indicates the vertical offset of the object on the page. Docusign uses 72 DPI when determining position. Required. May be zero.

To improve the tab's position on the document, Docusign recommends adjusting the X and Y position coordinates by (-3, -2).

Methods

global Position( final Integer documentSequence, final Integer pageNumber, final Integer x, final Integer y, final Integer width, final Integer height )
Description
Constructs tab positioning.
Parameters
documentSequence
final Integer documentSequence
On which document to apply the tab.
pageNumber
final Integer pageNumber
Specifies the page number on which the tab is located. For supplemental documents, this value must be 1.
x
final Integer x
Horizontal offset of the tab on the page.
y
final Integer y
Vertical offset of the tab on the page.
width
final Integer width
The width of the tab in pixels.
height
final Integer height
The height of the tab in pixels.

Tab.Anchor

global class Anchor
Description
Tab auto-place settings.
allowWhiteSpace
global Boolean allowWhiteSpace
Whether to allow white space in anchor strings.

Corresponds to the anchorAllowWhiteSpaceInCharacters API property.

caseSensitive
global Boolean caseSensitive
This property controls how anchor tabs are placed. When true, the text string in a document must match the case of the text property for an anchor tab to be created. The default value is false.

Corresponds to to the anchorCaseSensitive API property.

horizontalAlignment
global String horizontalAlignment
This property controls how anchor tabs are aligned in relation to the anchor text. Possible values are:
  • left: Aligns the left side of the tab with the beginning of the first character of the matching anchor word. This is the default value.
  • right: Aligns the tabs left side with the last character of the matching anchor word.

Corresponds to to the anchorHorizontalAlignment API property.

ignoreIfNotPresent
global Boolean ignoreIfNotPresent
When set to true, this tab is ignored if the text is not found in the document.

Corresponds to to the anchorIgnoreIfNotPresent API property.

matchWholeWord
global Boolean matchWholeWord
When set to true, the text string in a document must match the value of the text property in its entirety for an anchor tab to be created. The default value is false.

Corresponds to the anchorMatchWholeWord API property.

text
@AuraEnabled global String text
The string to find in the document and use as the basis for tab placement.

Corresponds to the anchorString API property.

units
global String units
Specifies units of the xOffset and yOffset properties. Valid units are:
  • pixels
  • inches
  • mms
  • cms

Corresponds to the anchorUnits API property.

xOffset
global Integer xOffset
Specifies the X axis location of the tab in units relative to the text.
yOffset
global Integer yOffset
Specifies the Y axis location of the tab in units relative to the text.

Methods

global Anchor(final String text)
Description
Simple constructor for auto-place settings. Everything besides the anchor text will be defaulted.
Parameters
text
final String text
The string to find in the document and use as the basis for tab placement.
global Anchor( final String text, final Boolean allowWhiteSpace, final Boolean caseSensitive, final String horizontalAlignment, final Boolean ignoreIfNotPresent, final Boolean matchWholeWord, final String units, final Integer xOffset, final Integer yOffset )
Description
Full constructor for auto-place settings.
Parameters
text
final String text
The string to find in the document and use as the basis for tab placement.
allowWhiteSpace
final Boolean allowWhiteSpace
Whether to allow white space in anchor strings.
caseSensitive
final Boolean caseSensitive
This property controls how anchor tabs are placed. When true, the text string in a document must match the case of the text property for an anchor tab to be created.
horizontalAlignment
final String horizontalAlignment
This property controls how anchor tabs are aligned in relation to the anchor text.
ignoreIfNotPresent
final Boolean ignoreIfNotPresent
When set to true, this tab is ignored if the text is not found in the document.
matchWholeWord
final Boolean matchWholeWord
When set to true, the text string in a document must match the value of the text property in its entirety for an anchor tab to be created.
units
final String units
Specifies units of the xOffset and yOffset properties
xOffset
final Integer xOffset
Specifies the X axis location of the tab in units relative to the text.
yOffset
final Integer yOffset
Specifies the Y axis location of the tab in units relative to the text.

Tab.GuidedForm

global class GuidedForm
Description
Tab guided form settings.
order
global Integer order
The order in which the guided form HTML should render. The order is relative to the pageLabel, the group by which to place the guided form HTML block.

Corresponds to the formOrder API parameter.

pageLabel
global String pageLabel
The group in which to place the guided form HTML. Each group displays as a separate guided forms page in the signing experience.

Corresponds to the formPageLabel API parameter.

pageNumber
global Integer pageNumber
The order in which to present the guided form pages.

Corresponds to the formPageNumber API parameter.

Methods

global GuidedForm(final Integer order, final String pageLabel, final Integer pageNumber)
Description
Constructs tab guided form settings.
Parameters
order
final Integer order
The order in which the guided form HTML should render. The order is relative to the pageLabel, the group by which to place the guided form HTML block.
pageLabel
final String pageLabel
The group in which to place the guided form HTML. Each group displays as a separate guided forms page in the signing experience.
pageNumber
final Integer pageNumber
The order in which to present the guided form pages.

Tab.Condition

global class Condition
Description
Conditional tab settings.
parentDataLabel
global String parentDataLabel
For conditional fields this is the dataLabel of the parent tab that controls this tab's visibility.

Corresponds to the conditionalParentLabel API parameter.

parentValue
global String parentValue
For conditional fields, this is the value of the parent tab that controls the tab's visibility.

If the parent tab is a checkbox, radio button, optional sign here, or optional initial here use "on" as the value to show that the parent tab is active.

Corresponds to the conditionalParentValue API parameter.

Methods

global Condition(final String parentDataLabel, final String parentValue)
Description
Constructs conditional tab settings.
Parameters
parentDataLabel
final String parentDataLabel
For conditional fields this is the dataLabel of the parent tab that controls this tab's visibility.
parentValue
final String parentValue
For conditional fields, this is the value of the parent tab that controls the tab's visibility.

Tab.Formatting

global class Formatting
Description
Tab formatting settings.
bold
@AuraEnabled global Boolean bold
When set to true, the information in the tab is bold.
color
@AuraEnabled global String color
The font color to use for the information in the tab. Possible values are:
  • Black
  • BrightBlue
  • BrightRed
  • DarkGreen
  • DarkRed
  • Gold
  • Green
  • NavyBlue
  • Purple
  • White
  • Corresponds to the fontColor API parameter.

concealValue
@AuraEnabled global Boolean concealValue
When set to true, the field appears normally while the recipient is adding or modifying the information in the field, but the data is not visible (the characters are hidden by asterisks) to any other signer or the sender.

When an envelope is completed the information is only available to the sender through the Form Data link in the Docusign Console. The information on the downloaded document remains masked by asterisks.

This setting applies only to text boxes and does not affect list boxes, radio buttons, or check boxes.

Corresponds to the concealValueOnDocument API parameter.

fixedWidth
@AuraEnabled global Boolean fixedWidth
When set to true, disables the auto sizing of single line text boxes in the signing screen when the signer enters data. If disabled users will only be able enter as much data as the text box can hold. By default this is false. This property only affects single line text boxes.

Corresponds to the fixedWidth API parameter.

font
@AuraEnabled global String font
The font to be used for the tab value. Supported fonts include:
  • Default
  • Arial
  • ArialNarrow
  • Calibri
  • CourierNew
  • Garamond
  • Georgia
  • Helvetica
  • LucidaConsole
  • MSGothic
  • MSMincho
  • OCR-A
  • Tahoma
  • TimesNewRoman
  • Trebuchet
  • Verdana
italic
@AuraEnabled global Boolean italic
When set to true, the information in the tab is italicized.
size
@AuraEnabled global Integer size
The font size in points used for the information in the tab. Possible values are: 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48 and 72..

Corresponds to the fontSize API parameter.

underline
@AuraEnabled global Boolean underline
When set to true, the information in the tab is underlined.

Methods

global Formatting( final String font, final String color, final Integer size, final Boolean bold, final Boolean italic, final Boolean underline, final Boolean concealValue, final Boolean fixedWidth )
Description
Constructs tab formatting settings.
Parameters
font
final String font
The font to be used for the tab value.
color
final String color
The font color to use for the information in the tab.
size
final Integer size
The font size in points used for the information in the tab.
bold
final Boolean bold
When set to true, the information in the tab is bold.
italic
final Boolean italic
When set to true, the information in the tab is italicized.
underline
final Boolean underline
When set to true, the information in the tab is underlined.
concealValue
final Boolean concealValue
When set to true, the field appears normally while the recipient is adding or modifying the information in the field, but the data is not visible (the characters are hidden by asterisks) to any other signer or the sender.
fixedWidth
final Boolean fixedWidth
When set to true, disables the auto sizing of single line text boxes in the signing screen when the signer enters data. If disabled users will only be able enter as much data as the text box can hold. By default this is false. This property only affects single line text boxes.

Tab.Validation

global class Validation
Description
Tab validation settings.
errorMessage
@AuraEnabled global String errorMessage
The message displayed if the custom tab fails input validation.

Corresponds to the validationMessage API property.

maximumLength
@AuraEnabled global Integer maximumLength
An optional value that describes the maximum length of the property when the property is a string.

Corresponds to the maxLength API property.

pattern
@AuraEnabled global String pattern
A regular expression used to validate input for the tab.

Corresponds to the validationPattern API property.

Methods

global Validation(final Integer maximumLength, final String pattern, final String errorMessage)
Description
Constructs tab validation settings.
Parameters
maximumLength
final Integer maximumLength
An optional value that describes the maximum length of the property when the property is a string.
pattern
final String pattern
A regular expression used to validate input for the tab.
errorMessage
final String errorMessage
The message displayed if the custom tab fails input validation.

Tab.PathComponent

global class PathComponent
Description
Tab merge field path component.
name
@AuraEnabled global String name
The Salesforce API name of the object or field.
salesforceType
@AuraEnabled global String salesforceType
The Salesforce data type.
type
global ComponentType type
The path component type.

Methods

global PathComponent(final String name, final ComponentType type, final String salesforceType)
Description
Constructs a tab merge field path component.
Parameters
name
final String name
The Salesforce API name of the object or field.
type
final ComponentType type
The path component type.
salesforceType
final String salesforceType
The Salesforce data type.

Tab.MergeField

global class MergeField
Description
Contains the information necessary to map the tab to a field in SalesForce.
path
@AuraEnabled global String path
The path to the Salesforce merge field. Used when Docusign Connect for Salesforce is configured on the account.
pathExtended
@AuraEnabled global List<PathComponent> pathExtended
The extended path to the Salesforce merge field. Used when Docusign Connect for Salesforce is not configured on the account.
row
global Integer row
Specifies the row number in a Salesforce table that the merge field value corresponds to.
senderReadOnly
@AuraEnabled global Boolean senderReadOnly
When true, the sender cannot modify the value of the mergeField tab during the sending process.

Corresponds to the allowSenderToEdit API property.

writeBack
@AuraEnabled global Boolean writeBack
When true, data entered into the merge field during Signing will update the mapped Salesforce field.

Methods

global MergeField( final String path, final List<PathComponent> pathExtended, final Integer row, final Boolean writeBack, final Boolean senderReadOnly )
Description
Constructs a Salesforce merge field.
Parameters
path
final String path
The path to the Salesforce merge field.
pathExtended
final List<PathComponent> pathExtended
The extended path to the Salesforce merge field.
row
final Integer row
Specifies the row number in a Salesforce table that the merge field value corresponds to.
writeBack
final Boolean writeBack
When true, data entered into the merge field during Signing will update the mapped Salesforce field.
senderReadOnly
final Boolean senderReadOnly
When true, the sender cannot modify the value of the mergeField tab during the sending process.

Tab.Collaboration

global class Collaboration
Description
Tab collaboration settings.
canCollaborate
@AuraEnabled global Boolean canCollaborate
When set to true, this custom tab is collaborative.

Corresponds to the shared API property.

required
@AuraEnabled global Boolean required
When set to true and canCollaborate is true, information must be entered in this field to complete the envelope.

Corresponds to the requireAll API property.

requireInitialOnChange
global Boolean requireInitialOnChange
Optional element for field markup. When set to true, the signer is required to initial when they modify a collaborative field.

Corresponds to the requireInitialOnSharedChange API property.

Methods

global Collaboration(final Boolean canCollaborate, final Boolean required, final Boolean requireInitialOnChange)
Description
Constructs tab collaboration settings.
Parameters
canCollaborate
final Boolean canCollaborate
When set to true, this custom tab is collaborative.
required
final Boolean required
When set to true and canCollaborate is true, information must be entered in this field to complete the envelope.
requireInitialOnChange
final Boolean requireInitialOnChange
Optional element for field markup. When set to true, the signer is required to initial when they modify a collaborative field.

Tab.SmartContract

global class SmartContract
Description
Tab smart contract settings.
code
global String code
The smart contract code.
uri
global String uri
A URI containing the user ID.

Methods

global SmartContract(final String code, final String uri)
Description
Constructs tab smart contract settings.
Parameters
code
final String code
The smart contract code.
uri
final String uri
A URI containing the user ID.

PolyLineOverlayTab

global class PolyLineOverlayTab extends Tab
Description
This type of tab enables the recipient to strike through document text. This value can't be set.
overlayType
global String overlayType
The type of overlay to use. The API currently supports only the outline overlay type.
polyLines
global List<PolyLine> polyLines
An array of poly-line objects that contain x- and y-coordinates representing the locations of the lines.

Methods

Description
Constructs a poly-line overlay tab.
global PolyLineOverlayTab withOverlayType(final String overlayType)
Description
Updates the tab overlayType property.
Returns
The tab with an updated overlayType value.
Parameters
overlayType
final String overlayType
The type of overlay to use.
global PolyLineOverlayTab withPolyLines(final List<PolyLine> polyLines)
Description
Updates the tab polyLines property.
Returns
The tab with an updated polyLines value.
Parameters
polyLines
final List<PolyLine> polyLines
An array of poly-line objects that contain x- and y-coordinates representing the locations of the lines.

PolyLineOverlayTab.PolyLine

global class PolyLine
Description
X- and y-coordinates representing the locations of the lines.
x1
global Integer x1
Start x coordinate.
x2
global Integer x2
End x coordinate.
y1
global Integer y1
Start y coordinate.
y2
global Integer y2
End y coordinate.

Methods

global PolyLine(final Integer x1, final Integer y1, final Integer x2, final Integer y2)
Description
Constructs a poly-line.
Parameters
x1
final Integer x1
Start x coordinate.
y1
final Integer y1
Start y coordinate.
x2
final Integer x2
End x coordinate.
y2
final Integer y2
End y coordinate.

DocumentService

global with sharing class DocumentService
Description
This class is the entry point for Docusign eSignature envelope document management. It provides methods to retrieve Salesforce source documents.

Methods

global static Document.Folders getDocumentFolders(final SObjectType type)
Description
Retrieves a list of Salesforce source documents folders by object type. The current user's personal folder, and the documents contained within, is always returned as the first element in the list. The returned folder IDs may be used in subsequent calls to dfsle.DocumentService.getFolderDocuments.

By default, the Salesforce Document and ContentVersion types are supported. More types may be supported via plugins.

Returns
A list of document folders.
Parameters
type
final SObjectType type
The Salesforce object type.
See
dfsle.DocumentService.getFolderDocuments
global static List<Document> getDocuments(final SObjectType type, final Set<Id> sObjectIds)
Description
Retrieves a list of Salesforce source documents by IDs.

By default, the Salesforce Document and ContentVersion types are supported. More types may be supported via plugins.

Returns
A list of envelope documents.
Parameters
type
final SObjectType type
The Salesforce object type.
sObjectIds
final Set<Id> sObjectIds
The Salesforce object IDs.
global static List<Document> getEnvelopeDocuments(final Id envelopeId)
Description
Retrieves a list of a Docusign envelope's documents.

The caller must be the owner of the envelope.

Returns
A list of documents contained within the envelope.
Parameters
envelopeId
final Id envelopeId
The envelope ID.
global static List<Document> getFolderDocuments(final SObjectType type, final Set<Id> folderIds)
Description
Retrieves a list of Salesforce source documents by folder IDs. The folder IDs may be retrieved by calling dfsle.DocumentService.getDocumentFolders first.

By default, the Salesforce Document and ContentVersion types are supported. More types may be supported via plugins.

Returns
A list of documents contained within the target folders.
Parameters
type
final SObjectType type
The Salesforce object type.
folderIds
final Set<Id> folderIds
The folder IDs.
See
dfsle.DocumentService.getDocumentFolders
global static List<Document> getLinkedDocuments(final SObjectType type, final Set<Id> linkedEntityIds, final Boolean getLastUpdatedOnly)
Description
Retrieves a list of Salesforce source documents by linked entity IDs.

For example, to pull in all of an Opportunity's Notes and Attachments related list:

 List<dfsle.Document> docs = dfsle.DocumentService.getLinkedDocuments(
   ContentVersion.getSObjectType(),
   new Set<Id> { myOpportunity.Id },
   false);
 

By default, only ContentVersion types are supported. More types may be supported via plugins.

Returns
A list of Docusign envelope documents.
Parameters
type
final SObjectType type
The Salesforce object type.
linkedEntityIds
final Set<Id> linkedEntityIds
The Salesforce parent IDs.
getLastUpdatedOnly
final Boolean getLastUpdatedOnly
Whether to retrieve only the last updated linked document.

OrganizationService

global with sharing class OrganizationService

Methods

@HttpGet global static void getOrganizationInfo()

SmartSectionTab

global class SmartSectionTab extends Tab
Description
Smart Section tabs enhance responsive signing on mobile devices by enabling collapsible sections, page breaks, custom formatting options, and other advanced functionality.

Note: Smart Sections are a premium feature. Responsive signing must also be enabled for your account.

display
global Display display
How the HTML section inside the smartAnchor displays.

Corresponds to the displaySettings API parameter.

smartAnchors
global Anchors smartAnchors
Specifies the area in the HTML where the display settings will be applied.

Methods

Description
Constructs a Smart Section tab.
global SmartSectionTab withDisplay(final Display display)
Description
Updates the tab display property.
Returns
The tab with an updated display value.
Parameters
display
final Display display
How the HTML section inside the smartAnchor displays.
global SmartSectionTab withSmartAnchors(final Anchors smartAnchors)
Description
Updates the tab smartAnchors property.
Returns
The tab with an updated smartAnchors value.
Parameters
smartAnchors
final Anchors smartAnchors
Specifies the area in the HTML where the display settings will be applied.

SmartSectionTab.Position

global class Position
Description
Where to render the Smart Section on the document.
pageNumber
global Integer pageNumber
Specifies the page number on which the tab is located. Must be 1 for supplemental documents.
x
global Integer x
This property indicates the horizontal offset of the object on the page. Docusign uses 72 DPI when determining position. Required. May be zero.

Corresponds to the xPosition API parameter.

y
global Integer y
This property indicates the vertical offset of the object on the page. Docusign uses 72 DPI when determining position. Required. May be zero.

Corresponds to the yPosition API parameter.

Methods

global Position(final Integer pageNumber, final Integer x, final Integer y)
Description
Constructs a Smart Section position.
Parameters
pageNumber
final Integer pageNumber
Specifies the page number on which the tab is located.
x
final Integer x
This property indicates the horizontal offset of the object on the page.
y
final Integer y
This property indicates the vertical offset of the object on the page.

SmartSectionTab.Anchor

global class Anchor
Description
Smart Section tab auto-place settings.
position
global Position position
Where to render the Smart Section on the document.
remove
global Boolean remove
When true, removes the start anchor string for the Smart Section from the HTML, preventing it from displaying.

Corresponds to the removeStartAnchor or removeEndAnchor API property.

text
global String text
Specifies the area in the HTML where the display settings will be applied.

Corresponds to the startAnchor or endAnchor API property.

Methods

global Anchor(final Position position, final String text, final Boolean remove)
Description
Constructs a Smart Section anchor.
Parameters
position
final Position position
Where to render the Smart Section on the document.
text
final String text
Specifies the area in the HTML where the display settings will be applied.
remove
final Boolean remove
When true, removes the start anchor string for the Smart Section from the HTML, preventing it from displaying.

SmartSectionTab.Anchors

global class Anchors
Description
Smart Section tab anchors.
caseSensitive
global Boolean caseSensitive
When true, the startAnchor and endAnchor for the Smart Section must match both the case and the content of the strings in the HTML.
endAnchor
global Anchor endAnchor
Specifies the end of the area in the HTML where the display settings will be applied. If you do not specify an end anchor, the end of the document will be used by default.

Note: A start anchor, an end anchor, or both are required.

startAnchor
global Anchor startAnchor
Specifies the beginning of the area in the HTML where the display settings will be applied. If you do not specify a start anchor, the beginning of the document will be used by default.

Note: A start anchor, an end anchor, or both are required.

Methods

global Anchors(final Anchor startAnchor, final Anchor endAnchor, final Boolean caseSensitive)
Description
Constructs Smart Section anchors.
Parameters
startAnchor
final Anchor startAnchor
Specifies the beginning of the area in the HTML where the display settings will be applied.
endAnchor
final Anchor endAnchor
Specifies the end of the area in the HTML where the display settings will be applied.
caseSensitive
final Boolean caseSensitive
When true, the startAnchor and endAnchor for the Smart Section must match both the case and the content of the strings in the HTML.

SmartSectionTab.Collapsible

global class Collapsible
Description
Defines the appearance and function of a collapsible section or item.
arrowClosed
global String arrowClosed
Closed arrow.
arrowColor
global String arrowColor
Arrow color.
arrowLocation
global String arrowLocation
Arrow location.
arrowOpen
global String arrowOpen
Open arrow.
arrowSize
global String arrowSize
Arrow size.
arrowStyle
global String arrowStyle
Arrow style.
containerStyle
global String containerStyle
Container style.
labelStyle
global String labelStyle
Label style.
onlyArrowIsClickable
global Boolean onlyArrowIsClickable
When true, only the arrow is clickable.
outerLabelAndArrowStyle
global String outerLabelAndArrowStyle
Outer label and arrow style.

Methods

global Collapsible( final String containerStyle, final String labelStyle, final String outerLabelAndArrowStyle, final String arrowStyle, final String arrowClosed, final String arrowOpen, final String arrowLocation, final String arrowColor, final String arrowSize, final Boolean onlyArrowIsClickable )
Description
Constructs collapsible display settings.
Parameters
containerStyle
final String containerStyle
Container style.
labelStyle
final String labelStyle
Label style.
outerLabelAndArrowStyle
final String outerLabelAndArrowStyle
Outer label and arrow style.
arrowStyle
final String arrowStyle
Arrow style.
arrowClosed
final String arrowClosed
Closed arrow.
arrowOpen
final String arrowOpen
Open arrow.
arrowLocation
final String arrowLocation
Arrow location.
arrowColor
final String arrowColor
Arrow color.
arrowSize
final String arrowSize
Arrow size.
onlyArrowIsClickable
final Boolean onlyArrowIsClickable
When true, only the arrow is clickable.

SmartSectionTab.Display

global class Display
Description
Defines how the HTML section inside the startAnchor and endAnchor displays.
cellStyle
global String cellStyle
Specifies the valid CSS-formatted styles to use on responsive table cells. Only valid in display sections of responsive_table or responsive_table_single_column types.
collapsible
global Collapsible collapsible
The appearance and function of a collapsible section or item.
display
global String display
Indicates the display type. Must be one of the following enum values:
  • inline: Leaves the HTML where it is in the document. This allows for adding a label or presenting on a separate page.
  • collapsible: The HTML in the section may be expanded or collapsed. By default, the section is expanded.
  • collapsed: The HTML in the section may be expanded or collapsed. By default, the section is collapsed.
  • responsive_table: Converts the section into a responsive table. Note that this style is applied only on HTML tables that fall within the startAnchor and endAnchor positions.
  • responsive_table_single_column: Converts the section into a responsive, single-column table. Note that this style is applied only on HTML tables that fall within the startAnchor and endAnchor positions. The table is converted to a single column in which each column becomes a row and is stacked.
  • print_only: Prevents this portion of the HTML from displaying in the responsive signing view.
hideLabelWhenOpened
global Boolean hideLabelWhenOpened
When true, the label is hidden when the display section is expanded and the display section is no longer collapsible. This property is valid only when the value of the display property is collapsed.
inlineOuterStyle
global String inlineOuterStyle
Specifies the valid CSS-formatted styles to use on inline display sections. This property is valid only when the value of the display property is inline.
label
global String label
The label for the display section.

Corresponds to the displayLabel API property.

labelWhenOpened
global String labelWhenOpened
The label for the display section when it is expanded from a collapsed state. This label displays only on the first opening and is only valid with the value of the display property is collapsed.
order
global Integer order
The position on the page where the display section appears.

Corresponds to the displayOrder API property.

pageNumber
global Integer pageNumber
The number of the page on which the display section appears.

Corresponds to the displayPageNumber API property.

preLabel
global String preLabel
Descriptive text that appears before a collapsed section or continue button.
scrollToTopWhenOpened
global Boolean scrollToTopWhenOpened
When true and the section is expanded, the position of the section close is scrolled to the top of the screen. This property is only valid when the value of the display property is collapsed.
tableStyle
global String tableStyle
Specifies the valid CSS-formatted styles to use on responsive tables. This property is valid only when the value of the display property is responsive_table or responsive_table_single_column.

Methods

global Display( final String label, final String display, final Integer pageNumber, final Integer order, final String tableStyle, final String cellStyle, final String inlineOuterStyle, final Boolean hideLabelWhenOpened, final Boolean scrollToTopWhenOpened, final String labelWhenOpened, final String preLabel, final Collapsible collapsible )
Description
Constructs Smart Section display settings.
Parameters
label
final String label
The label for the display section.
display
final String display
Indicates the display type.
pageNumber
final Integer pageNumber
The number of the page on which the display section appears.
order
final Integer order
The position on the page where the display section appears.
tableStyle
final String tableStyle
Specifies the valid CSS-formatted styles to use on responsive tables.
cellStyle
final String cellStyle
Specifies the valid CSS-formatted styles to use on responsive table cells.
inlineOuterStyle
final String inlineOuterStyle
Specifies the valid CSS-formatted styles to use on inline display sections.
hideLabelWhenOpened
final Boolean hideLabelWhenOpened
When true, the label is hidden when the display section is expanded and the display section is no longer collapsible.
scrollToTopWhenOpened
final Boolean scrollToTopWhenOpened
When true and the section is expanded, the position of the section close is scrolled to the top of the screen.
labelWhenOpened
final String labelWhenOpened
The label for the display section when it is expanded from a collapsed state.
preLabel
final String preLabel
Descriptive text that appears before a collapsed section or continue button.
collapsible
final Collapsible collapsible
The appearance and function of a collapsible section or item.

EUAdvancedSmsProvider

Description
Docusign-generated, eIDAS AES compliant signatures with SMS authentication.
phone
global String phone
The mobile phone number used to send the recipient an access code for the signing ceremony. Ensure the country code is prefixed to the number.

Methods

global EUAdvancedSmsProvider(final String phone)
Description
Constructs an EU Advanced signature provider with SMS authentication.
Parameters
phone
final String phone
The mobile phone number used to send the recipient an access code for the signing ceremony. Ensure the country code is prefixed to the number.

BulkSendService

global with sharing class BulkSendService
Description
Operations related to sending Docusign envelopes in bulk. Bulk send lists may be created, updated, and deleted. These may be reused with multiple draft envelopes. Only one SIGNER recipient per envelope copy is currently supported.

To use automatic anchor tags for the bulk envelope recipient, set the placeholder recipient role to dfsle.RecipientService.getDefaultRoles()[0], assuming it exists.

A typical flow is as follows:

 // Construct bulk list from a group
 dfsle.BulkList myList = new dfsle.BulkList(
  null, // Salesforce list ID. Assigned upon creation.
  null, // Docusign list ID. Assigned upon creation.
  new List<dfsle.Envelope> { ... }, // Envelope copies.
  new dfsle.Entity(mySalesforceGroupId));
 // Create the bulk send list.
 myList = dfsle.BulkSendService.createLists(new List<BulkList> { myBulkList })[0];
 // Create a draft envelope with at least one dummy recipient.
 dfsle.Envelope myEnvelope = dfsle.BulkSendService.getDraftEnvelope(
   new List<dfsle.Document> { ... }, // Documents
   new dfsle.Entity(mySalesforceSourceId)); // Salesforce source entity
 // Send the envelope to your bulk send list.
 dfsle.BulkList.Result myResult = dfsle.BulkSendService.sendEnvelope(myList.id, myEnvelope);
 // Check for and resolve any errors in the result.
 if (myResult.success) {
   // Get batch job status (will only call Docusign API at most once per minute)
   dfsle.BulkList.Status myStatus = dfsle.BulkSendService.getStatus(new Set<Id> { myResult.bulkStatusId });
 }
 

Methods

global static List<BulkList> createLists(final List<BulkList> bulkLists)
Description
Creates one or more bulk send lists in Salesforce and Docusign. The lists must have at least one member. Each list may be reused to send multiple envelopes. Currently bulk envelope copies are restricted to exactly one recipient each.

Callers must be assigned the DocuSign User permission set.

Returns
The newly-created bulk send lists.
Parameters
bulkLists
final List<BulkList> bulkLists
The bulk send lists to create.
global static Boolean deleteLists(final Set<Id> bulkListIds)
Description
Deletes one or more bulk send lists in Salesforce and Docusign.

Callers must be assigned the DocuSign User permission set.

Returns
The result of the delete operation: true if the lists were deleted, and false otherwise.
Parameters
bulkListIds
final Set<Id> bulkListIds
The IDs of the lists to delete.
global static Envelope getDraftEnvelope(final List<Document> documents, final Entity source)
Description
Gets a new bulk draft envelope instance with a single bulk recipient placeholder and default email and notification settings. This may be further customized via the dfsle.Envelope.withEmail or dfsle.Envelope.withNotifications methods.

Callers must be assigned the DocuSign User permission set.

Returns
A new bulk envelope instance.
Parameters
documents
final List<Document> documents
List of envelope documents. At least one document is required.
source
final Entity source
Optional Salesforce source object for the envelope.
global static List<BulkList.Status> getStatus(final Set<Id> bulkStatusIds)
Description
Retrieves status for one or more bulk send jobs.

Callers must be assigned the DocuSign User permission set.

Returns
A list of bulk send job statuses.
Parameters
bulkStatusIds
final Set<Id> bulkStatusIds
The list of status IDs.
global static List<BulkList> searchLists(final String name, final Integer maximumRecords)
Description
Searches for bulk send lists partially matching a name.

Callers must be assigned the DocuSign User permission set.

Returns
Bulk send lists matching the search criteria.
Parameters
name
final String name
The beginning part of the name to match.
maximumRecords
final Integer maximumRecords
The maximum number of records to retrieve.
global static BulkList.Result sendEnvelope(final Id bulkListId, final Envelope envelope)
Description
Sends an envelope to a bulk send list. The envelope will be created in Docusign and Salesforce.

If previously created, the caller must be the owner of the envelope. Otherwise the caller must be assigned the DocuSign User permission set.

Returns
The result of the bulk send operation.
Parameters
bulkListId
final Id bulkListId
The bulk send list Salesforce ID.
envelope
final Envelope envelope
The draft envelope.
global static List<BulkList> updateLists(final List<BulkList> bulkLists)
Description
Updates one or more bulk send lists in Salesforce and Docusign. Currently bulk envelope copies are restricted to exactly one recipient each.

This method should be called any time the source Salesforce group membership changes to ensure the lists are synchronized.

Callers must be assigned the DocuSign User permission set.

Returns
The updated bulk send lists.
Parameters
bulkLists
final List<BulkList> bulkLists
The bulk send lists to update.

APIException

global class APIException extends Exception
Description
Exceptions raised by the Docusign API.
error
global APIError error
The underlying API error that triggered the exception.

TextTab

global class TextTab extends ReadWriteTab
Description
A text tab enables the recipient to enter free text. This value can be set.

Methods

global TextTab()
Description
Constructs a text tab.

ListTab

global class ListTab extends ReadWriteTab
Description
A list tab enables the recipient to choose from a list of options. You specify the options in the items property. This value can't be set.
items
global List<Item> items
The list of items that can be selected by senders.

Corresponds to the listItems API property.

Methods

global ListTab()
Description
Constructs a list tab.
global ListTab withItems(final List<Item> items)
Description
Updates the tab items property.
Returns
The tab with an updated items value.
Parameters
items
final List<Item> items
The list of items that can be selected by senders.

ListTab.Item

global class Item
Description
A selectable list tab item.
label
global String label
Specifies the text that is shown in the dropdown list.

Corresponds to the text API parameter.

selected
global Boolean selected
When set to true, indicates that this item is the default selection shown to a signer.

Only one selection can be set as the default.

value
global Object value
Specifies the value that is used when the list item is selected.

Methods

global Item(final String label, final Object value, final Boolean selected)
Parameters
label
final String label
Specifies the text that is shown in the dropdown list.
value
final Object value
Specifies the value that is used when the list item is selected.
selected
final Boolean selected
When set to true, indicates that this item is the default selection shown to a signer.

LastNameTab

global class LastNameTab extends ReadOnlyTab
Description
A last name tab displays the recipient's last name. The system automatically populates this field by splitting the name in the recipient information on spaces. This value can't be set.

Methods

global LastNameTab()
Description
Constructs a last name tab.

SignHereTab

global class SignHereTab extends SignatureTab
Description
A sign here tab enables the recipient to sign a document. May be optional. This value can't be set.
isSeal
global Boolean isSeal
When set to true, the tab contains a visual representation for an electronic seal in a document.

Corresponds to the isSealSignTab API property.

stamp
global Stamp stamp
The user's stamp.

Methods

global SignHereTab()
Description
Constructs a sign here tab.
global SignHereTab withIsSeal(final Boolean isSeal)
Description
Updates the tab isSeal property.
Returns
The tab with an updated isSeal value.
Parameters
isSeal
final Boolean isSeal
When set to true, the tab contains a visual representation for an electronic seal in a document.
global SignHereTab withStamp(final Stamp stamp)
Description
Updates the tab stamp property.
Returns
The tab with an updated stamp value.
Parameters
stamp
final Stamp stamp
The user's stamp.

SignHereTab.DateStamp

global class DateStamp
Description
Specifies the area in which a date stamp is placed. This parameter uses pixel positioning to draw a rectangle at the center of the stamp area. The stamp is superimposed on top of this central area.
height
global Integer height
The height of the rectangle.

Corresponds to the dateAreaHeight API property.

width
global Integer width
The width of the rectangle.

Corresponds to the dateAreaWidth API property.

x
global Integer x
The X axis position of the top-left corner.

Corresponds to the dateAreaX API property.

y
global Integer y
The Y axis position of the top-left corner.

Corresponds to the dateAreaY API property.

Methods

global DateStamp(final Integer x, final Integer y, final Integer width, final Integer height)
Description
Constructs a date stamp.
Parameters
x
final Integer x
The X axis position of the top-left corner.
y
final Integer y
The Y axis position of the top-left corner.
width
final Integer width
The width of the rectangle.
height
final Integer height
The height of the rectangle.

SignHereTab.StampImage

global class StampImage
Description
Representation of the signature stamp image.
base64
global String base64
Base64 representation of the image.

Corresponds to the imageBase64 API parameter.

isResizable
global Boolean isResizable
When set to true, users may resize the stamp.

Corresponds to the disallowUserResizeStamp API parameter.

size
global Integer size
The physical height of the stamp image (in millimeters) that the stamp vendor recommends for displaying the image in PDF documents.

Corresponds to the stampSizeMM API parameter.

type
global String type
Specifies the type of image. Valid values are:
  • signature_image
  • initials_image

Corresponds to the imageType API parameter.

uri
global String uri
The URI for retrieving the image of the user's stamp.

Corresponds to the stampImageUri API parameter.

Methods

global StampImage(final String type, final String uri, final String base64, final Integer size, final Boolean isResizable)
Description
Constructs a stamp image.
Parameters
type
final String type
Specifies the type of image.
uri
final String uri
The URI for retrieving the image of the user's stamp.
base64
final String base64
Base64 representation of the image.
size
final Integer size
The physical height of the stamp image (in millimeters) that the stamp vendor recommends for displaying the image in PDF documents.
isResizable
final Boolean isResizable
When set to true, users may resize the stamp.

SignHereTab.Stamp

global class Stamp
Description
Representation of a user's stamp.
customField
global String customField
Optional custom field for the stamp.
dateStamp
global DateStamp dateStamp
The date stamp.
externalId
global String externalId
Optional external identifier for the user's signature.
format
global String format
The format of the stamp. Valid values are:
  • NameHanko: The stamp represents only the signer's name.
  • NameDateHanko: The stamp represents the signer's name and the date.

Corresponds to the stampFormat API parameter.

image
global StampImage image
The stamp image.
phoneticName
global String phoneticName
The phonetic spelling of the signatureName.
signatureName
global String signatureName
Specifies the user's signature name.
type
global String type
The type of stamp. Valid values are:
  • signature: A signature image. This is the default value.
  • stamp: A stamp image.

Corresponds to the stampType API parameter.

Methods

global Stamp( final String type, final String externalId, final String format, final String signatureName, final String phoneticName, final StampImage image, final DateStamp dateStamp, final String customField )
Description
Constructs a stamp.
Parameters
type
final String type
The type of stamp.
externalId
final String externalId
Optional external identifier for the user's signature.
format
final String format
The format of the stamp.
signatureName
final String signatureName
Specifies the user's signature name.
phoneticName
final String phoneticName
The phonetic spelling of the signatureName.
image
final StampImage image
The stamp image.
dateStamp
final DateStamp dateStamp
The date stamp.
customField
final String customField
Optional custom field for the stamp.

APIError

global virtual class APIError
Description
Represents an error returned by an API.
code
@AuraEnabled global Integer code
The error code.
description
@AuraEnabled global String description
The error description.
none
global static final APIError none
Constant for no error.
new APIError(APIErrorCode.SUCCESS, null)

ValidationException

global class ValidationException extends Exception
Description
Exceptions raised when an object fails to validate. For example, when an invalid dfsle.Envelope is passed to the dfsle.EnvelopeService.sendEnvelope method.
details
global Object details
Details of the failed validation. In most cases, this will be an instance of dfsle.ValidationResult.

DateTab

global class DateTab extends ReadWriteTab
Description
A date tab enables the recipient to enter a date. This value can't be set. The tooltip for this tab recommends the date format MM/DD/YYYY, but this format is not enforced. The system retains the format that the recipient enters.

Note: If you need to enforce a specific date format, we recommend that you use a text tab with a validation pattern and validation message.

Methods

global DateTab()
Description
Constructs a date tab.

FormulaTab

global virtual class FormulaTab extends ReadWriteTab
Description
A Docusign envelope recipient formula tab.

The value of a formula tab is calculated from the values of other number or date tabs in the document. When the recipient completes the underlying fields, the formula tab calculates and displays the result. This value can be set.

The formula property of the tab contains the references to the underlying tabs. To learn more about formulas, see Calculated Fields.

formula
global String formula
Contains the formula for calculating the value of this tab. Use a tab's dataLabel, enclosed in brackets, to refer to it.

For example, you want to present the total cost of two items, tax included. The cost of each item is stored in number tabs labeled Item1 and Item2. The tax rate is in a number tab labeled TaxRate. The formula string for this property would be: ([Item1] + [Item2]) * (1 + [TaxRate])

See Calculated Fields in the Docusign Support Center to learn more about formulas.

hidden
global Boolean hidden
When set to true, the field appears normally while the recipient is adding or modifying the information in the field, but the data is not visible (the characters are hidden by asterisks) to any other signer or the sender.

When an envelope is completed the information is only available to the sender through the Form Data link in the Docusign Console. The information on the downloaded document remains masked by asterisks.

This setting applies only to text boxes and does not affect list boxes, radio buttons, or checkboxes.

roundDecimalPlaces
global Integer roundDecimalPlaces
The number of decimal places to round to.

Methods

global FormulaTab()
Description
Constructs a Formula Tab
global FormulaTab withFormula(final String formula)
Description
Updates the tab formula property.
Returns
The tab with an updated formula value.
Parameters
formula
final String formula
Contains the formula for calculating the value of this tab.
global FormulaTab withHidden(final Boolean hidden)
Description
Updates the tab hidden property.
Returns
The tab with an updated hidden value.
Parameters
hidden
final Boolean hidden
When set to true, the field appears normally while the recipient is adding or modifying the information in the field, but the data is not visible (the characters are hidden by asterisks) to any other signer or the sender.
global FormulaTab withRoundDecimalPlaces(final Integer roundDecimalPlaces)
Description
Updates the tab roundDecimalPlaces property.
Returns
The tab with an updated roundDecimalPlaces value.
Parameters
roundDecimalPlaces
final Integer roundDecimalPlaces
The number of decimal places to round to.

SsnTab

global class SsnTab extends ReadWriteTab
Description
An SSN tab contains a one-line field that enables the recipient to enter a Social Security Number (SSN) with or without dashes. It uses the same parameters as a text tab, with the validation message and pattern set for SSN information. This value can be set.

Methods

global SsnTab()
Description
Constructs an SSN tab.

ElectronicSignatureProvider

Description
Electronic signatures do not use digital certificates. These are the default type of signatures from Docusign.

Methods

Description
Constructs an electronic signature provider.

ApproveTab

global class ApproveTab extends ButtonTab
Description
An approve tab enables the recipient to approve documents without placing a signature or initials on the document. If the recipient clicks the tab during the signing process, the recipient is considered to have signed the document. No information is shown on the document of the approval, but it is recorded as a signature in the envelope history. The value of an approve tab can't be set.

Methods

global ApproveTab()
Description
Constructs an approve tab.

CommentThreadTab

global class CommentThreadTab extends Tab
Description
Represents a collection of comments in a comment thread. For example, if a recipient has questions about the content of a document, they can add a comment to the document and control who else can see the comment. This value can't be set.
formatting
global Tab.Formatting formatting
Tab formatting settings.
threadId
global String threadId
The unique identifier for the comment thread.

Methods

Description
Constructs a comment thread tab.
global CommentThreadTab withFormatting(final Tab.Formatting formatting)
Description
Updates the tab formatting property.
Returns
The tab with an updated formatting value.
Parameters
formatting
final Tab.Formatting formatting
Tab formatting settings.
global CommentThreadTab withThreadId(final String threadId)
Description
Updates the tab threadId property.
Returns
The tab with an updated threadId value.
Parameters
threadId
final String threadId
The unique identifier for the comment thread.

UnauthorizedException

global class UnauthorizedException extends Exception
Description
The exception thrown when unauthorized access is detected.
AccessRequirement
global enum AccessRequirement
Access requirements:
  • Unspecified: Not specified.
  • DocuSignLogin: Must be assigned the DocuSign Login permission set.
  • DocuSignSender: Must be assigned the DocuSign Sender permission set.
  • DocuSignUser: Must be assigned the DocuSign User permission set.
  • DocuSignAdministrator: Must be assigned the DocuSign Administrator permission set.
  • DocuSignGenerator: Must be assigned the DocuSign Generator permission set.
  • DocuSignNegotiator: Must be assigned the DocuSign Negotiator permission set.
  • ClmAdministrator: Must be assigned the CLM Administrator permission set.
  • ClmUser: Must be assigned the CLM User permission set.
  • ClmCommunityUser: Must be assigned the CLM Community User permission set.
  • ClmViewer: Must be assigned the CLM Viewer permission set.
  • SalesforceAdministrator: Must be a Salesforce administrator.
  • EnvelopeOwner: Must be the envelope owner.
  • ConfigureAccount: Docusign account is not configured in Salesforce.
  • OriginalUser: Cannot impersonate user.
  • IntegrationUser: Must be the integration user.
  • AccountMember: Not a member of the Docusign account.
  • CurrentSalesforceUser: Must be the current Salesforce user.
requirement
global AccessRequirement requirement
The access requirement.
userId
global Id userId
The ID of the unauthorized user.

SignatureApplianceProvider

Description
Docusign can configure a Signature Appliance at your site. The appliance is integrated with the Docusign cloud platform. The appliance can act as a TSP, enabling signers to use certificates generated from your organization's root certificate. It can also use certificates from third-party TSPs.
name
global String name
The Docusign-assigned name of the signature appliance provider.

Methods

Description
Constructs a signature appliance provider.
Parameters
name
final String name
The Docusign-assigned name of the signature appliance provider.

EnvelopeIdTab

global class EnvelopeIdTab extends ReadOnlyTab
Description
An envelope ID tab displays the envelope ID. Recipients cannot enter or change the information in this tab. This value can't be set.

Methods

global EnvelopeIdTab()
Description
Constructs an envelope ID tab.

NotarizeTab

global class NotarizeTab extends Tab
Description
A notarize tab alerts notary recipients that they must take action on the page.

Note: Only one notarize tab can appear on a page.

readOnly
global Boolean readOnly
When set to true, the signer cannot change the data of the custom tab.

Corresponds to the locked API parameter.

required
global Boolean required
When set to true, the signer is required to fill out this tab.

Methods

global NotarizeTab()
Description
Constructs a notarize tab.
global NotarizeTab withReadOnly(final Boolean readOnly)
Description
Updates the tab readOnly property.
Returns
The tab with an updated readOnly value.
Parameters
readOnly
final Boolean readOnly
When set to true, the signer cannot change the data of the custom tab.
global NotarizeTab withRequired(final Boolean required)
Description
Updates the tab required property.
Returns
The tab with an updated required value.
Parameters
required
final Boolean required
When set to true, the signer is required to fill out this tab.

Notifications

global class Notifications
Description
A Docusign envelope's reminder and expiration settings.
expireAfterDays
@AuraEnabled global Integer expireAfterDays
How many days before the envelope expires.
expires
@AuraEnabled global Boolean expires
Whether or not the envelope automatically expires (is voided).
expireWarnDays
@AuraEnabled global Integer expireWarnDays
How many days prior to expiration to send a warning to recipients.
remind
@AuraEnabled global Boolean remind
Whether or not to remind recipients to sign.
remindAfterDays
@AuraEnabled global Integer remindAfterDays
How many days to wait before sending a reminder.
remindFrequencyDays
@AuraEnabled global Integer remindFrequencyDays
How many days between sending reminders.
updateChatter
@AuraEnabled global Boolean updateChatter
DEPRECATED - ignored.

Methods

global Notifications( final Boolean remind, final Integer remindAfterDays, final Integer remindFrequencyDays, final Boolean expires, final Integer expireAfterDays, final Integer expireWarnDays, final Boolean updateChatter )
Description
Constructs an envelope notification settings.
Parameters
remind
final Boolean remind
Whether or not to remind recipients to sign.
remindAfterDays
final Integer remindAfterDays
How many days to wait before sending a reminder.
remindFrequencyDays
final Integer remindFrequencyDays
How many days between sending reminders.
expires
final Boolean expires
Whether or not the envelope automatically expires (is voided).
expireAfterDays
final Integer expireAfterDays
How many days before the envelope expires.
expireWarnDays
final Integer expireWarnDays
How many days prior to expiration to send a warning to recipients.
updateChatter
final Boolean updateChatter
DEPRECATED - ignored.

InitialHereTab

global class InitialHereTab extends SignatureTab
Description
An initial here tab enables the recipient to initial the document. May be optional. This value can't be set.

Methods

Description
Constructs an initial here tab.

DrawTab

global class DrawTab extends Tab
Description
A tab allowing a recipient to draw in the space provided and optionally allow background image uploads.
allowBackgroundImageUpload
global Boolean allowBackgroundImageUpload
When true, signers may upload background images.

Corresponds to the allowSignerUpload API property.

collaboration
global Tab.Collaboration collaboration
Tab collaboration settings.
readOnly
global Boolean readOnly
When set to true, the signer cannot change the data of the custom tab.

Corresponds to the locked API property.

required
global Boolean required
When set to true, the signer is required to fill out this tab.

Methods

global DrawTab()
Description
Constructs a draw tab.
global DrawTab withAllowBackgroundImageUpload(final Boolean allowBackgroundImageUpload)
Description
Updates the tab allowBackgroundImageUpload property.
Returns
The tab with an updated allowBackgroundImageUpload value.
Parameters
allowBackgroundImageUpload
final Boolean allowBackgroundImageUpload
When true, signers may upload background images.
global DrawTab withCollaboration(final Tab.Collaboration collaboration)
Description
Updates the tab collaboration property.
Returns
The tab with an updated collaboration value.
Parameters
collaboration
final Tab.Collaboration collaboration
Tab collaboration settings.
global DrawTab withReadOnly(final Boolean readOnly)
Description
Updates the tab readOnly property.
Returns
The tab with an updated readOnly value.
Parameters
readOnly
final Boolean readOnly
When set to true, the signer cannot change the data of the custom tab.
global DrawTab withRequired(final Boolean required)
Description
Updates the tab required property.
Returns
The tab with an updated required value.
Parameters
required
final Boolean required
When set to true, the signer is required to fill out this tab.

DeclineTab

global class DeclineTab extends ButtonTab
Description
A decline tab enables the recipient to decline the envelope. If the recipient clicks the tab during the signing process, the envelope is voided. The value of this tab can't be set.

Methods

global DeclineTab()
Description
Constructs a decline tab.

DateSignedTab

global class DateSignedTab extends ReadOnlyTab
Description
A date signed tab displays the date that the recipient signed the document. This value can't be set.

Methods

global DateSignedTab()
Description
Constructs a date signed tab.

RadioGroupTab

global class RadioGroupTab extends Tab
Description
A radio group tab places a group of radio buttons on a document. The radios property is used to add and place the radio buttons associated with the group. Only one radio button can be selected in a group. This value can be set.
collaboration
global Tab.Collaboration collaboration
Tab collaboration settings.
radios
global List<Radio> radios
Specifies the locations and status for radio buttons that are grouped together.

Methods

global RadioGroupTab()
Description
Constructs a radio group tab.
global RadioGroupTab withCollaboration(final Tab.Collaboration collaboration)
Description
Updates the tab collaboration property.
Returns
The tab with an updated collaboration value.
Parameters
collaboration
final Tab.Collaboration collaboration
Tab collaboration settings.
global RadioGroupTab withRadios(final List<Radio> radios)
Description
Updates the tab radios property.
Returns
The tab with an updated radios value.
Parameters
radios
final List<Radio> radios
Specifies the locations and status for radio buttons that are grouped together.

RadioGroupTab.Position

global class Position
Description
Where to render the radio button on the document.
pageNumber
global Integer pageNumber
Specifies the page number on which the tab is located. Must be 1 for supplemental documents.
x
global Integer x
This property indicates the horizontal offset of the object on the page. Docusign uses 72 DPI when determining position. Required. May be zero.

Corresponds to the xPosition API parameter.

y
global Integer y
This property indicates the vertical offset of the object on the page. Docusign uses 72 DPI when determining position. Required. May be zero.

Corresponds to the yPosition API parameter.

Methods

global Position(final Integer pageNumber, final Integer x, final Integer y)
Description
Constructs a radio button position.
Parameters
pageNumber
final Integer pageNumber
Specifies the page number on which the tab is located. Must be 1 for supplemental documents.
x
final Integer x
This property indicates the horizontal offset of the object on the page.
y
final Integer y
This property indicates the vertical offset of the object on the page.

RadioGroupTab.Radio

global class Radio
Description
A radio button.
anchor
global Tab.Anchor anchor
Tab auto-place settings.
formatting
global Tab.Formatting formatting
Tab formatting settings.
order
global Integer order
A positive integer that sets the order the tab is navigated to during signing.

Tabs on a page are navigated to in ascending order, starting with the lowest number and moving to the highest. If two or more tabs have the same tabOrder value, the normal auto-navigation setting behavior for the envelope is used.

Corresponds to the tabOrder property.

position
global Position position
Tab position on the document.
readOnly
global Boolean readOnly
When set to true, the signer cannot change the data of the custom tab.

Corresponds to the locked API parameter.

required
global Boolean required
When set to true, the signer is required to fill out this tab.
selected
global Boolean selected
When set to true, the radio button is selected.
value
global Object value
Specifies the value of the tab.

Methods

global Radio( final Integer order, final Position position, final Tab.Formatting formatting, final Tab.Anchor anchor, final Object value, final Boolean selected, final Boolean readOnly, final Boolean required )
Description
Constructs a radio button.
Parameters
order
final Integer order
A positive integer that sets the order the tab is navigated to during signing.
position
final Position position
Tab position on the document.
formatting
final Tab.Formatting formatting
Tab formatting settings.
anchor
final Tab.Anchor anchor
Tab auto-place settings.
value
final Object value
Specifies the value of the tab.
selected
final Boolean selected
When set to true, the radio button is selected.
readOnly
final Boolean readOnly
When set to true, the signer cannot change the data of the custom tab.
required
final Boolean required
When set to true, the signer is required to fill out this tab.

EnvelopeService

global with sharing class EnvelopeService
Description
Primary interface point for Docusign eSignature envelope management.

A basic flow would be:

 // Get an empty envelope definition to begin.
 Envelope e = dfsle.EnvelopeService.getEmptyEnvelope(new Entity(sourceId));
 // Send envelope and add source documents and recipients
 e = dfsle.EnvelopeService.sendEnvelope(e, false);
 // Get tagger URL (this must be in a future method or separate transaction to avoid a CalloutException)
 Url u = dfsle.EnvelopeService.getSenderViewUrl(e.docuSignId, new Url('https://my.return.url'));
 // Host the tagging session with the returned URL
 

Methods

@Deprecated global static Envelope createEnvelope( final Envelope envelope, final EnvelopeConfiguration envelopeConfiguration, final Boolean addFromSource )
Description
Creates a draft Docusign envelope record in Salesforce. This method does not send the envelope; to do so call dfsle.EnvelopeService.sendEnvelope.

This method does not make any API callouts. It involves a DML operation.

The caller must be assigned the DocuSign User permission set.

Returns
The newly-created envelope.
Parameters
envelope
final Envelope envelope
The envelope to create.
envelopeConfiguration
final EnvelopeConfiguration envelopeConfiguration
Deprecated - ignored.
addFromSource
final Boolean addFromSource
Load source documents and recipients.
See
dfsle.EnvelopeService.sendEnvelope for details on how to send the created envelope.
global static Id deleteEnvelope(final Id envelopeId)
Description
Deletes a draft Docusign envelope record from Salesforce. It does not delete draft or sent envelopes from Docusign. Those may be voided, but not deleted, via dfsle.StatusService.voidEnvelope.

This method does not make any API callouts. It involves a DML operation.

The caller must be the owner of the envelope.

Returns
The Salesforce source ID of the envelope. This can be used to redirect the user upon deletion.
Parameters
envelopeId
final Id envelopeId
The ID of the envelope to delete.
See
dfsle.StatusService.voidEnvelope for details on how to void a draft or sent envelope.
global static Envelope getEmptyEnvelope(final Entity source)
Description
Gets an empty envelope definition that can be subsequently completed, created, and sent. This envelope will be populated with appropriate defaults based on the current account settings and localizations.

This method does not make any API callouts or DML operations.

The caller must be assigned the DocuSign Sender permission set.

Returns
The empty envelope.
Parameters
source
final Entity source
The originating Salesforce entity for the envelope.
global static Envelope getEnvelope(final Id envelopeId)
Description
Retrieves a Docusign envelope by record ID.

This method does not make any API callouts or DML operations.

The caller must be the owner of the envelope.

Returns
The envelope matching the ID.
Parameters
envelopeId
final Id envelopeId
The ID of the envelope.
global static Url getSenderViewUrl(final UUID docuSignId, final Url returnUrl)
Description
Retrieves a sender view URL. This will return a one-time use Docusign tagger URL if called right after an envelope is created in the draft state.

When redirected back to the supplied returnUrl, Docusign appends an event parameter to the query string. Possible values include:

  • sent: The envelope was sent from the tagger. It may be appropriate to initiate signing at this point assuming the first signer or host is the current user.
  • save: The envelope was saved as a draft in Docusign.
  • cancel: The draft was canceled. Delete the envelope via the dfsle.EnvelopeService.deleteEnvelope method.
  • error: An error was encountered.

This method involves an API callout with no DML operations.

The caller must be the owner of the envelope.

Returns
The sender view URL.
Parameters
docuSignId
final UUID docuSignId
The Docusign envelope ID.
returnUrl
final Url returnUrl
The URL to redirect to once the sender action is complete.
global static Envelope retryEnvelope(final UUID transactionId, final Boolean sendNow)
Description
Retries sending a Docusign envelope by transaction ID. The envelope will not be resent if it was already sent successfully. This can be called when the status of the envelope is indeterminate, for example when the send operation times-out.

If the envelope cannot be located by transaction ID, an dfsle.APIException will be thrown with error code dfsle.APIErrorCode.NOT_FOUND

This method should be isolated on its own transaction as it involves an API callout followed by a DML operation.

If previously created, the caller must be the owner of the envelope. Otherwise the caller must be assigned the DocuSign Sender permission set.

Returns
The sent envelope.
Parameters
transactionId
final UUID transactionId
The transaction ID associated with the envelope. Must be non-empty.
sendNow
final Boolean sendNow
Whether to send immediately or save as a draft in Docusign.
global static List<Envelope> saveSentEnvelopes(final List<Envelope> envelopes)
Description
Completes a transaction initiated by dfsle.EnvelopeService.sendEnvelopes. This will create envelope and status records for each sent envelope.

Each envelope must have valid docuSignId and sent properties and an empty error property, otherwise an exception will be thrown and no envelopes will be saved. Any invalid envelopes should be filtered out prior to calling this method.

This method involves DML operations. It does not make any API callouts.

The caller must be assigned the DocuSign Administrator, DocuSign User, or DocuSign Sender permission set.

Returns
The sent envelopes with updated record IDs.
Parameters
envelopes
final List<Envelope> envelopes
The sent envelopes.
See
dfsle.EnvelopeService.sendEnvelopes to initiate the transaction.
global static Envelope sendEnvelope(final Envelope envelope, final Boolean sendNow)
Description
Sends an envelope to Docusign. This will also create the envelope record in Salesforce if necessary.

This method should be isolated on its own transaction as it involves an API callout followed by a DML operation.

If previously created, the caller must be the owner of the envelope. Otherwise the caller must be assigned the DocuSign Sender permission set.

Returns
The sent envelope.
Parameters
envelope
final Envelope envelope
The envelope to send.
sendNow
final Boolean sendNow
Whether to send immediately or save as a draft in Docusign.
global static List<Envelope> sendEnvelopes(final List<Envelope> envelopes)
Description
Immediately sends one or more Docusign envelopes.

This method involves web service callouts to Docusign, but no subsequent DML. It is intended for scenarios where multiple envelopes are sent in a single transaction or whenever else DML should be deferred. At the end of the transaction, dfsle.EnvelopeService.saveSentEnvelopes should be called. Otherwise the associated envelope and status records will not be created.

This call is limited to 99 envelopes at a time, and subject to hourly API and Salesforce Governor limits.

Every envelope must be valid or else a ValidationException will be thrown and no envelopes will be sent. If all envelopes pass validation, any API error for an envelope will be logged on the error property. Only successfully sent ones may be saved with dfsle.EnvelopeService.saveSentEnvelopes.

The caller must be assigned the DocuSign Administrator, DocuSign User, or DocuSign Sender permission set.

Returns
The sent envelope.
Parameters
envelopes
final List<Envelope> envelopes
The envelopes to send.
See
dfsle.EnvelopeService.saveSentEnvelopes to complete the transaction.
global static Envelope updateEnvelope(final Envelope envelope)
Description
Updates a draft envelope record in Salesforce, including documents and recipients. This is a more expensive call than dfsle.EnvelopeService.updateEnvelopeNotifications as it updates and recalculates child entries.

This method does not make any API callouts. It involves a DML operation.

The caller must be the owner of the envelope.

Returns
The updated envelope.
Parameters
envelope
final Envelope envelope
The envelope to update.

Template

global class Template
Description
Representation of a Docusign template.
customFields
@AuraEnabled global List<CustomField> customFields
The Docusign template custom fields.
emailMessage
@AuraEnabled global String emailMessage
The message of the email recipients receive. This is contained within the standard Docusign email body.
emailSubject
@AuraEnabled global String emailSubject
The subject of the email recipients receive.
id
@AuraEnabled global UUID id
The Docusign template ID.
lastModified
@AuraEnabled global Datetime lastModified
The date and time when the Docusign template was last modified.
name
@AuraEnabled global String name
The Docusign template name.
notifications
@AuraEnabled global Notifications notifications
The reminder and expiration settings for the template.
recipients
@AuraEnabled global List<Recipient> recipients
The Docusign template recipients.

Methods

global Template( final UUID id, final String name, final List<CustomField> customFields, final Notifications notifications, final String emailSubject, final String emailMessage, final List<Recipient> recipients, final Datetime lastModified )
Description
Constructs a Docusign template.
Parameters
id
final UUID id
The Docusign template ID.
name
final String name
The Docusign template name.
customFields
final List<CustomField> customFields
The Docusign template custom fields.
notifications
final Notifications notifications
The reminder and expiration settings for the template.
emailSubject
final String emailSubject
The subject of the email recipients receive.
emailMessage
final String emailMessage
The message of the email recipients receive. This is contained within the standard Docusign email body.
recipients
final List<Recipient> recipients
The Docusign template recipients.
lastModified
final Datetime lastModified
The date and time when the Docusign template was last modified.

ITAgileProvider

global class ITAgileProvider extends SignatureProvider
Description
Qualified electronic signatures using itAgile EU Qualified Certificates.

Methods

Description
Constructs an itAgile signature provider.

SignerAttachmentTab

global class SignerAttachmentTab extends SignatureTab
Description
A signer attachment tab enables the recipient to attach supporting documents to an envelope. This value can't be set.

Methods

Description
Constructs a signer attachment tab.

NumberTab

global class NumberTab extends ReadWriteTab
Description
A number tab enables the recipient to enter numbers and decimal points (.). This value can be set.

Methods

global NumberTab()
Description
Constructs a number tab.

CustomField

global class CustomField
Description
Represents an envelope, template, or account custom field.
isList
@AuraEnabled global Boolean isList
Read-only property indicating whether this is a list custom field.
isText
@AuraEnabled global Boolean isText
Read-only property indicating whether this is a text custom field.
items
@AuraEnabled global List<String> items
List items for the custom field. Ignored if this is a text custom field.
name
@AuraEnabled global String name
The name of the custom field.
required
@AuraEnabled global Boolean required
Whether a value is required for the custom field.
show
@AuraEnabled global Boolean show
Whether to display the custom field to recipients.
type
@AuraEnabled global String type
The type of the custom field, list or text.
value
@AuraEnabled global String value
The value of the custom field.

Methods

global CustomField( final String type, final String name, final String value, final List<String> items, final Boolean required, final Boolean show )
Description
Constructs a custom field.
Parameters
type
final String type
The type of the custom field, either list or text.
name
final String name
The name of the custom field.
value
final String value
The value of the custom field.
items
final List<String> items
The list items for list custom fields. Ignored for text custom fields.
required
final Boolean required
Whether a value is required for the custom field.
show
final Boolean show
Whether to display the custom field to recipients.

TemplateService

global with sharing class TemplateService
Description
Primary interface point for Docusign eSignature template management.

Methods

global static Template getTemplate(final UUID templateId)
Description
Retrieves a Docusign template.
Returns
The Docusign template.
Parameters
templateId
final UUID templateId
The Docusign template ID.
global static List<Template> getTemplates()
Description
Retrieves all Docusign templates.
Returns
A list of Docusign templates.

ReadWriteTab

global abstract class ReadWriteTab extends Tab
Description
Base class for read/write tabs. This class may not be directly instantiated.
collaboration
global Tab.Collaboration collaboration
Tab collaboration settings.
formatting
global Tab.Formatting formatting
Tab formatting settings.
mergeField
global Tab.MergeField mergeField
Contains the information necessary to map the tab to a field in SalesForce.
readOnly
global Boolean readOnly
When set to true, the signer cannot change the data of the custom tab.

Corresponds to the locked API property.

required
global Boolean required
When set to true, the signer is required to fill out this tab.
validation
global Tab.Validation validation
Tab validation settings.
value
global Object value
Specifies the value of the tab.

Methods

global ReadWriteTab withCollaboration(final Tab.Collaboration collaboration)
Description
Updates the tab collaboration property.
Returns
The tab with an updated collaboration value.
Parameters
collaboration
final Tab.Collaboration collaboration
Tab collaboration settings.
global ReadWriteTab withFormatting(final Tab.Formatting formatting)
Description
Updates the tab formatting property.
Returns
The tab with an updated formatting value.
Parameters
formatting
final Tab.Formatting formatting
Tab formatting settings.
global ReadWriteTab withMergeField(final Tab.MergeField mergeField)
Description
Updates the tab mergeField property.
Returns
The tab with an updated mergeField value.
Parameters
mergeField
final Tab.MergeField mergeField
Contains the information necessary to map the tab to a field in SalesForce.
global ReadWriteTab withReadOnly(final Boolean readOnly)
Description
Updates the tab readOnly property.
Returns
The tab with an updated readOnly value.
Parameters
readOnly
final Boolean readOnly
When set to true, the signer cannot change the data of the custom tab.
global ReadWriteTab withRequired(final Boolean required)
Description
Updates the tab required property.
Returns
The tab with an updated required value.
Parameters
required
final Boolean required
When set to true, the signer is required to fill out this tab.
global ReadWriteTab withValidation(final Tab.Validation validation)
Description
Updates the tab validation property.
Returns
The tab with an updated validation value.
Parameters
validation
final Tab.Validation validation
Tab validation settings.
global ReadWriteTab withValue(final Object value)
Description
Updates the tab value property.
Returns
The tab with an updated value value.
Parameters
value
final Object value
Specifies the value of the tab.

ZipTab

global class ZipTab extends ReadWriteTab
Description
A ZIP tab enables the recipient to enter a ZIP code. The ZIP code can be five digits or nine digits (in ZIP+4 format), and can be entered with or without dashes. It uses the same parameters as a text tab, with the validation message and pattern set for ZIP code information. This value can be set.

Methods

global ZipTab()
Description
Constructs a ZIP tab.

CheckboxTab

global class CheckboxTab extends ReadWriteTab
Description
A checkbox tab enables the recipient to select a yes/no (on/off) option. This value can be set.

Methods

global CheckboxTab()
Description
Constructs a checkbox tab.

TitleTab

global class TitleTab extends ReadWriteTab
Description
A title tab displays the recipient's title. This value can't be set.

Methods

global TitleTab()
Description
Constructs a title tab.

RecipientService

global with sharing class RecipientService
Description
This class is the entry point for Docusign eSignature envelope recipient management. It provides methods to retrieve Salesforce source recipients.

Methods

global static List<Recipient.Role> getDefaultRoles()
Description
Retrieves a list of default recipient roles. These map to automatic anchor tags. For example, role 1 will map to \s1\, \d1\, etc.
Returns
A list of default recipient roles.
global static List<Recipient> getRecipients(final SObjectType type, final Set<Id> ids)
Description
Retrieves a list of Docusign envelope recipients from Salesforce source objects.

By default, the Salesforce Account, Case, Contact, Lead, and Opportunity types are supported. More types may be supported via plugins.

Returns
A list of envelope recipients.
Parameters
type
final SObjectType type
The Salesforce object type.
ids
final Set<Id> ids
The Salesforce object IDs.
global static List<Recipient> searchRecipients(final SObjectType type, final String firstName, final String lastName)
Description
Searches for Docusign envelope recipients from Salesforce source objects.

By default, the Salesforce Contact, Lead, and User types are supported. More types may be supported via plugins.

Search behavior is defined and stored in account settings. See dfsle.Recipient.SearchBehavior and dfsle.AccountService.Settings for more details.

Returns
A list of envelope recipients.
Parameters
type
final SObjectType type
The Salesforce object type.
firstName
final String firstName
The first name to match.
lastName
final String lastName
The last name to match. Ignored for compound search behaviors.
See
Recipient.SearchBehavior for more details on search options.

GenInvoiceTriggerHandler

global with sharing class GenInvoiceTriggerHandler extends GenBillingAPI

Methods

global static void onAfterUpdate(final Map<Id, SObject> newInvoices, final Map<Id, SObject> oldInvoices)

Entity

global with sharing class Entity
Description
Represents a Salesforce object.
id
@AuraEnabled global Id id
The Salesforce object ID.
isValid
@AuraEnabled global Boolean isValid
Whether the entity is valid or not. It is considered valid if the ID is defined.
label
@AuraEnabled global String label
The localized Salesforce object label.
name
@AuraEnabled global String name
The Salesforce object name.
parent
@AuraEnabled global Entity parent
The Salesforce object parent (e.g. Account for Opportunity).
typeName
@AuraEnabled global String typeName
The name of the Salesforce object type.

Methods

global Entity(final Id id)
Description
Constructs an entity. This will populate the type and label via SObject describe.
Parameters
id
final Id id
The Salesforce object ID.
global Entity(final Id id, final String name, final Entity parent)
Description
Constructs an entity. This will populate the type and label via SObject describe.
Parameters
id
final Id id
The Salesforce object ID.
name
final String name
The Salesforce object name.
parent
final Entity parent
The Salesforce object parent.
global static Entity resolve(final Id id)
Description
Resolves an entity by type and ID. This operation may involve one or more SOQL queries.
Returns
The resolved entity or null if it cannot be resolved.
Parameters
id
final Id id
The Salesforce object ID.

DocuSignException

global class DocuSignException extends Exception
Description
General exceptions that may be raised by Docusign.

ViewTab

global class ViewTab extends ButtonTab
Description
A view tab is used with an approve tab to handle supplemental documents.
required
global Boolean required
When set to true, the recipient must click the View button for the supporting document prior to completing the signing process.
requiredRead
global Boolean requiredRead
When set to true, the recipient must read through the document.

Methods

global ViewTab()
Description
Constructs a view tab.
global ViewTab withRequired(final Boolean required)
Description
Updates the tab required property.
Returns
The tab with an updated required value.
Parameters
required
final Boolean required
When set to true, the recipient must click the View button for the supporting document prior to completing the signing process.
global ViewTab withRequiredRead(final Boolean requiredRead)
Description
Updates the tab requiredRead property.
Returns
The tab with an updated requiredRead value.
Parameters
requiredRead
final Boolean requiredRead
When set to true, the recipient must read through the document.