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
createStatus
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
envelopesfinal List<Envelope.Status> envelopes
The Docusign envelopes from which to create statuses. These must have been previously sent with a non-null
docuSignId. getCorrectUrl
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
docuSignIdfinal UUID docuSignId
The Docusign envelope ID.
returnUrl final Url returnUrl
Where to redirect once correction is complete.
getStatus
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
sourceIdsfinal Set<Id> sourceIds
The IDs of the initiating Salesforce objects.
maximumRecords final Integer maximumRecords
The maximum number of records to retrieve.
getViewUrl
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
docuSignIdfinal UUID docuSignId
The Docusign envelope ID.
returnUrl final Url returnUrl
Where to redirect once viewing is complete.
resendEnvelope
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
docuSignIdfinal UUID docuSignId
The Docusign envelope ID.
resendRecipients
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
docuSignIdfinal UUID docuSignId
The Docusign envelope ID.
recipients final List<Recipient> recipients
The recipients for which to resend the envelope.
voidEnvelope
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
docuSignIdfinal UUID docuSignId
The Docusign envelope ID.
reason final String reason
The reason to void the envelope.