Skip to navigation

StatusService

View as Markdown
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.