Show:   

SignButlerClientApi

Signature
global with sharing class SignButlerClientApi

SignButlerClientApi Methods

allSignersStatus(signRequestId)

Get All Signers Status
Signature
global List<StakeholderInfo> allSignersStatus(Id signRequestId)
Parameters
signRequestId
Type: Id
is the Id of the sign request
Returns
List<StakeholderInfo> that containing id, firstName, lastName,email and status.
Example
 (new cadmus_sign2.SignButlerClientApi()).allSignersStatus('a0G09000000RHSrFDA');

convert(docConfigId, docConfigIds, objectId, locale, alternative, targetType, pdfActionType, contentDocumentIds, packId)

Convenience method to call PDF Butler and generate a document. Find more info on the params here: https://www.pdfbutler.com/academy.html?q=Call%20PDF%20Butler%20from%20APEX
Signature
global static String convert(Id docConfigId, String docConfigIds, Id objectId, String locale, String alternative, String targetType, String pdfActionType, String contentDocumentIds, Id packId)
Example
 cadmus_sign2.SignButlerClientApiconvert('<DocConfigId>', null, '<RecordId>', null, null, null, null, null, null);

deleteSignRequest(recordId)

Delete Sign Request Data
Signature
global void deleteSignRequest(Id recordId)
Parameters
recordId
Type: Id
is the Id of the sign request
Returns
nothing
Example
 (new cadmus_sign2.SignButlerClientApi()).deleteSignRequest('a0G09000000RHSrFDA');

deleteSignRequest(recordIds)

Delete Sign Request Data
Signature
global void deleteSignRequest(List<Id> recordIds)
Parameters
recordIds
Type: List<Id>
is the List<Id> of the sign request
Returns
nothing
Example
 (new cadmus_sign2.SignButlerClientApi()).deleteSignRequest(new List<Id>{'a0G09000000RHSrFDA','a0G09000000RHSrFDB'});

deleteSignRequestStatic(recordId)

Signature
@AuraEnabled
global static void deleteSignRequestStatic(Id recordId)

getFirstSignUrl(signRequestId)

Get Sign Url of the next signer. So the first next signer
Signature
@AuraEnabled
global static String getFirstSignUrl(String signRequestId)
Parameters
signRequestId
Type: String
is the Id of the sign request
Returns
json string => {"url":"https://www.pdfbutler.com/"}
Example
 cadmus_sign2.SignButlerClientApi.getFirstSignUrl('a0G09000000RHSrFDA');

getSignRequestStatus(signRequestId)

Get Sign Request Status
Signature
@AuraEnabled
global static String getSignRequestStatus(String signRequestId)
Parameters
signRequestId
Type: String
is the Id of the sign request
Returns
json string => {"status":"PENDING"}
Example
 cadmus_sign2.SignButlerClientApi.getSignRequestStatus('a0G09000000RHSrFDA');

launchSignRequest(signRequestId)

launch sign request, after the prepare step, the SIGN Request has to be launched. This has to happen in a seperate transaction then the prepare step
Signature
global void launchSignRequest(Id signRequestId)
Parameters
signRequestId
Type: Id
is the Id of the sign request
Returns
nothing
Example
 (new cadmus_sign2.SignButlerClientApi()).launchSignRequest('a0G09000000RHSrFDA');

launchSignRequestStatic(signRequestId)

Signature
@AuraEnabled
global static void launchSignRequestStatic(Id signRequestId)

notifyNextSigner(recordId)

Notify the next signer
Signature
global void notifyNextSigner(Id recordId)
Parameters
recordId
Type: Id
is the Id of the sign request
Returns
nothing
Example
 (new cadmus_sign2.SignButlerClientApi()).notifyNextSigner('a0G09000000RHSrFDA');

notifyNextSignerStatic(recordId)

Signature
@AuraEnabled
global static void notifyNextSignerStatic(Id recordId)

prepareSignRequest(pdfBase64, pdfFileName, templateId, recordId)

launch sign request
Signature
global Id prepareSignRequest(String pdfBase64, String pdfFileName, String templateId, Id recordId)
Parameters
pdfBase64
Type: String
BASE64 representation of the pdf. This can be the returned BASE64 of PDF Butler or VersionData of a ContentVersion
pdfFileName
Type: String
name of the pdf file
templateId
Type: String
is the Id of the sign request template
recordId
Type: Id
is the Id of the record, eg an Opportunity, a Quote, ...
Returns
Id SIGN Request Id
Example
 (new cadmus_sign2.SignButlerClientApi()).prepareSignRequest('<BASE64>', 'my file.pdf', '<SIGN Request Template>', '<Opportunity Id>');

prepareSignRequestStatic(pdfBase64, pdfFileName, templateId, recordId)

Signature
@AuraEnabled
global static Id prepareSignRequestStatic(String pdfBase64, String pdfFileName, String templateId, Id recordId)

revokeSignRequest(recordId)

Revoke Sign Request
Signature
global void revokeSignRequest(Id recordId)
Parameters
recordId
Type: Id
is the Id of the sign request
Returns
nothing
Example
 (new cadmus_sign2.SignButlerClientApi()).revokeSignRequest('a0G09000000RHSrFDA');

revokeSignRequestStatic(recordId)

Revoke Sign Request
Signature
@AuraEnabled
global static void revokeSignRequestStatic(Id recordId)
Parameters
recordId
Type: Id
is the Id of the sign request
Returns
nothing
Example
 cadmus_sign2.SignButlerClientApi.revokeSignRequest('a0G09000000RHSrFDA');

signerStatusById(shId, signRequestId)

Get Signer Status by Stakeholder Id
Signature
global StakeholderInfo signerStatusById(Id shId, Id signRequestId)
Parameters
shId
Type: Id
is the stakeholder Id
signRequestId
Type: Id
is the Id of the sign request
Returns
StakeholderInfo that containing id, firstName, lastName,email and status. If you provide the wrong shId, then it will return null
Example
 (new cadmus_sign2.SignButlerClientApi()).signerStatusById('a0G09000000RHGFTRD', 'a0G09000000RHSrFDA');

signerStatusByPosition(position, signRequestId)

Get Signer Status by its position
Signature
global StakeholderInfo signerStatusByPosition(Integer position, Id signRequestId)
Parameters
position
Type: Integer
is signer location that starts from 1. If there are 2 signers in a sign request, its means there are 2 position. 1 and 2.
signRequestId
Type: Id
is the Id of the sign request
Returns
StakeholderInfo that containing id, firstName, lastName,email and status. If you provide the wrong position, then it will return null
Example
 (new cadmus_sign2.SignButlerClientApi()).signerStatusByPosition(1, 'a0G09000000RHSrFDA');

silentRevokeSignRequest(recordId)

Revoke Sign Request but do not send an email to the stakeholders
Signature
@AuraEnabled
global static void silentRevokeSignRequest(Id recordId)
Parameters
recordId
Type: Id
is the Id of the sign request
Returns
nothing
Example
 cadmus_sign2.SignButlerClientApi.silentRevokeSignRequest('a0G09000000RHSrFDA');

SignButlerClientApi.StakeholderInfo

Signature
global with sharing class StakeholderInfo

SignButlerClientApi.StakeholderInfo Properties

Name Signature Annotations
email
global String email
@AuraEnabled
firstName
global String firstName
@AuraEnabled
id
global String id
@AuraEnabled
lastName
global String lastName
@AuraEnabled
status
global String status
@AuraEnabled