Show:   

SignButlerClientApi

Signature
global with sharing class SignButlerClientApi

SignButlerClientApi Properties

Name Signature Annotations
email
global String email
@AuraEnabled
firstName
global String firstName
@AuraEnabled
id
global String id
@AuraEnabled
lastName
global String lastName
@AuraEnabled
locale
global String locale
@AuraEnabled
mobile
global String mobile
@AuraEnabled
signingMethods
global SigningMethodsVo signingMethods
@AuraEnabled

SignButlerClientApi Methods

addPlaceholderAndLaunchSignRequestStatic(req)

add placeholder to pdf and launch the sing request
Signature
@AuraEnabled
global static void addPlaceholderAndLaunchSignRequestStatic(RrLaunchSignRequest.LaunchSignRequestVo req)
Parameters
req
Type: RrLaunchSignRequest.LaunchSignRequestVo
is the LaunchSignRequestVo Object the nee to populate. For Detail See Example.
Returns
nothing
Example
RrLaunchSignRequest.LaunchSignRequestVo lsrVo = new RrLaunchSignRequest.LaunchSignRequestVo(); 
lsrVo.signRequestId = 'a0G090000012ggSEAQ'; 
List<DnDPlaceholderController.DnDPlaceholderContentData> cvDatas = new List<DnDPlaceholderController.DnDPlaceholderContentData>(); 
DnDPlaceholderController.DnDPlaceholderContentData cvData = new DnDPlaceholderController.DnDPlaceholderContentData(); 
cvData.contentVersionId= '068090000064MgEAAU'; 
List<DnDPlaceholderController.DnDPlaceholderNode> locs = new List<DnDPlaceholderController.DnDPlaceholderNode>(); 
DnDPlaceholderController.DnDPlaceholderNode loc = new DnDPlaceholderController.DnDPlaceholderNode(); 
loc.page=0; 
loc.x=85.207825; 
loc.y=495.2145; 
loc.sbId='SIG001'; 
locs.add(loc); 
cvData.locations = locs; 
cvDatas.add(cvData); 
lsrVo.contentVersions = cvDatas; 
List<SignButlerConfigDataModal.stakeholder> stakeholders = new List<SignButlerConfigDataModal.stakeholder>(); 
SignButlerConfigDataModal.stakeholder sh = new SignButlerConfigDataModal.stakeholder(); 
sh.id='00309000006wNGQAA2'; 
sh.firstName='Andy'; 
sh.lastName='Young'; 
sh.email='shahid.ghafoor@pdfbutler.com'; 
sh.locale= 'en'; 
sh.signingMethods = new SignButlerConfigDataModal.signingMethods(true,true,true,true); 
stakeholders.add(sh); 
lsrVo.stakeholders = stakeholders; 
SignButlerClientApi.addPlaceholderAndLaunchSignRequestStatic(lsrVo);

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);

createAndLaunchSignRequest(srCl)

Create and launch a SIGN Request. Mostly used for Embedded Signing use-cases. The return will be the URL to sign
Signature
global static String createAndLaunchSignRequest(SignRequestCLVo srCl)
Parameters
SignRequestCLVo
Plain Old Apex Object to store the data required to create the SIGN Request
Returns
URL to open for Signing
Example
 cadmus_core.ConvertController.ConvertDataModel cdm = new cadmus_core.ConvertController.ConvertDataModel(); 
 cdm.docConfigId = 'a050900000LCyahAAD'; 
 cdm.deliveryOverwrite = 'BASE64'; 
 cdm.objectId = '0010900000Dy1FkAAJ'; 
 
 cadmus_core.DocGenerationWrapper wrapper = cadmus_core.ConvertController.convertWithWrapper(cdm); 
 
 
 cadmus_sign2.SignButlerClientApi.SignRequestCLVo srInput = new cadmus_sign2.SignButlerClientApi.SignRequestCLVo(); 
 srInput.srTitle = 'Embedded launched SR'; 
 srInput.base64Pdf = EncodingUtil.base64Encode(wrapper.response.base64); 
 srInput.srtId = 'a0D09000009I4i8EAC'; 
 srInput.fileName = wrapper.response.metadata.targetName; 
 srInput.recordId = '0010900000Dy1FkAAJ'; 
 srInput.sendEmail = false; //Do you want to send out the first email? 
 srInput.redirectUrl = 'https://www.pdfbutler.com'; //Add your own link here with parameters if required 
 
 String url = cadmus_sign2.SignButlerClientApi.createAndLaunchSignRequest(srInput); 
 System.debug('url: ' + url);

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(lsrVo)

prepare sign request
Signature
global void launchSignRequest(LaunchSignRequestVo lsrVo)
Parameters
lsrVo
Type: LaunchSignRequestVo
LaunchSignRequestVo Object that accept signRequestId, contentDocuments, stakeholders, recordId, sendEmail, redirectUrl
Returns
Nothing
Example
 cadmus_sign2.SignButlerClientApi.LaunchSignRequestVo lsrv = new cadmus_sign2.SignButlerClientApi.LaunchSignRequestVo(); 
   lsrv.signRequestId = 'SIGN_REQUEST_ID'; 
   lsrv.contentDocuments = new String[]{'CONTENT_DOCUMENT_ID','CONTENT_DOCUMENT_ID'}; 
   lsrv.sendEmail = true; 
   lsrv.recordId = 'RECORD_ID'; 
   lsrv.redirectUrl = 'https://www.pdfbutler.com'; 
   lsrv.stakeholders = new List<cadmus_sign2.SignButlerClientApi.StakeholderVo>{ 
       new cadmus_sign2.SignButlerClientApi.StakeholderVo('00509000005MSeRAAW','FIRST_NAME', 'LAST_NAME','EMAIL','MOBILE','en', 
       new SignButlerClientApi.SigningMethodsVo(true,true, false,false,false)) 
   }; 
 
   cadmus_sign2.SignButlerClientApi api = new cadmus_sign2.SignButlerClientApi(); 
   api.launchSignRequest(lsrv);

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(lsrVo)

prepare sign request
Signature
@AuraEnabled
global static void launchSignRequestStatic(LaunchSignRequestVo lsrVo)
Parameters
lsrVo
Type: LaunchSignRequestVo
LaunchSignRequestVo Object that accept signRequestId, contentDocuments, stakeholders, recordId, sendEmail, redirectUrl
Returns
Nothing
Example
 cadmus_sign2.SignButlerClientApi.LaunchSignRequestVo lsrv = new cadmus_sign2.SignButlerClientApi.LaunchSignRequestVo(); 
   lsrv.signRequestId = 'SIGN_REQUEST_ID'; 
   lsrv.contentDocuments = new String[]{'CONTENT_DOCUMENT_ID','CONTENT_DOCUMENT_ID'}; 
   lsrv.sendEmail = true; 
   lsrv.recordId = 'RECORD_ID'; 
   lsrv.redirectUrl = 'https://www.pdfbutler.com'; 
   lsrv.stakeholders = new List<cadmus_sign2.SignButlerClientApi.StakeholderVo>{ 
       new cadmus_sign2.SignButlerClientApi.StakeholderVo('00509000005MSeRAAW','FIRST_NAME', 'LAST_NAME','EMAIL','MOBILE','en', 
       new SignButlerClientApi.SigningMethodsVo(true,true, false,false,false)) 
   }; 
 
   cadmus_sign2.SignButlerClientApi.launchSignRequest(lsrv);

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>');

prepareSignRequest(requestData)

prepare sign request
Signature
global Id prepareSignRequest(PrepareSignRequestVo requestData)
Parameters
requestData
Type: PrepareSignRequestVo
PrepareSignRequestVo Object that accept signRequestTitle, templateId
Returns
Id SIGN Request Id
Example
 cadmus_sign2.SignButlerClientApi.PrepareSignRequestVo requestData = new cadmus_sign2.SignButlerClientApi.PrepareSignRequestVo(); 
 requestData.templateId='<TEMPLATE ID>'; 
 requestData.signRequestTitle='<MY REQUEST>'; 
 (new cadmus_sign2.SignButlerClientApi()).prepareSignRequest(requestData);

prepareSignRequestStatic(pdfBase64, pdfFileName, templateId, recordId)

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

prepareSignRequestStatic(requestData)

prepare sign request
Signature
@AuraEnabled
global static Id prepareSignRequestStatic(PrepareSignRequestVo requestData)
Parameters
requestData
Type: PrepareSignRequestVo
PrepareSignRequestVo Object that accept signRequestTitle, templateId
Returns
Id SIGN Request Id
Example
 cadmus_sign2.SignButlerClientApi.PrepareSignRequestVo requestData = new cadmus_sign2.SignButlerClientApi.PrepareSignRequestVo(); 
 requestData.templateId='<TEMPLATE ID>'; 
 requestData.signRequestTitle='<MY REQUEST>'; 
 cadmus_sign2.SignButlerClientApi.prepareSignRequest(requestData);

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');

setExpired(recordId)

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

setQuietExpired(recordId)

Expired Sign Request but do not send an email to the stakeholders
Signature
@AuraEnabled
global static void setQuietExpired(Id recordId)
Parameters
recordId
Type: Id
is the Id of the sign request
Returns
nothing
Example
 cadmus_sign2.SignButlerClientApi.setQuietExpired('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');

StakeholderVo(id, firstName, lastName, email, mobile, locale)

Signature
global StakeholderVo(String id,String firstName,String lastName,String email, String mobile,String locale)

StakeholderVo(id, firstName, lastName, email, mobile, locale, signingMethods)

Signature
global StakeholderVo(String id,String firstName,String lastName,String email,String mobile,String locale, SignButlerClientApi.SigningMethodsVo signingMethods)

updateBrandingStatic(srId, brandingId)

Update Sign Request Branding
Signature
global static void updateBrandingStatic(Id srId, Id brandingId)
Parameters
srId
Type: Id
SIGN Request on which you want to change the branding
brandingId
Type: Id
Id of SIGN Butler Branding record
Returns
nothing
Example
 cadmus_sign2.SignButlerClientApi.updateBrandingStatic('<Sign Request Id>', '<Branding Id>');

updateExpireDateStatic(srId, expireDate)

Update Sign Request Branding
Signature
global static void updateExpireDateStatic(Id srId, Datetime expireDate)
Parameters
srId
Type: Id
Sign Request Id
expireDate
Type: Datetime
new Expire Date of sign request
Returns
nothing
Example
 cadmus_sign2.SignButlerClientApi().updateExpireDateStatic('<Sign Request Id>', '<Expire Date>');

SignButlerClientApi.LaunchChainedSigningInfo

Create the documents and generate a SIGN Request for each record provided
Signature
global with sharing class LaunchChainedSigningInfo
Example
 cadmus_sign2.SignButlerClientApi.LaunchChainedSigningInfo info = new cadmus_sign2.SignButlerClientApi.LaunchChainedSigningInfo(); 
 
 //Make sure the SRT indicates to not send any mails! Otherwise, mails when the document are signed will be send out 
 info.signRequestTemplateId = 'a0D09000006i2EjEAI'; 
 
 info.recordIds = new List<Id> {'0010900000Dy1FkAAJ', '0010900000Dy1FjAAJ'}; //List of records to generate the SIGN Request from 
 info.chainedSignRequestName = 'Testing - ' + DateTime.now(); //Unique name for the chain 
   //PDF Butler data model to be used to generate the document. 
   // The recordId (or objectId) does not have to be provided as this will be taken from the list of records 
 cadmus_core.ConvertController.ConvertDataModel cdm = new cadmus_core.ConvertController.ConvertDataModel(); 
 cdm.docConfigId = 'a0509000003WyqwAAC'; 
 info.cdm = cdm; 
 cadmus_sign2.SignButlerClientApi.launchChainedSigning(info);

SignButlerClientApi.LaunchChainedSigningInfo Properties

Name Signature
cdm
global cadmus_core.ConvertController.ConvertDataModel cdm
chainedSignRequestName
global String chainedSignRequestName
recordIds
global List<Id> recordIds
signRequestTemplateId
global Id signRequestTemplateId

SignButlerClientApi.LaunchSignRequestVo

Signature
global class LaunchSignRequestVo

SignButlerClientApi.LaunchSignRequestVo Properties

Name Signature
contentDocuments
global String[] contentDocuments
recordId
global String recordId
redirectUrl
global String redirectUrl
sendEmail
global Boolean sendEmail
signRequestId
global String signRequestId
stakeholders
global StakeholderVo[] stakeholders

SignButlerClientApi.PrepareSignRequestVo

Signature
global class PrepareSignRequestVo

SignButlerClientApi.PrepareSignRequestVo Properties

Name Signature
signRequestTitle
global String signRequestTitle
templateId
global String templateId

SignButlerClientApi.PrepareSignRequestVo Constructors

PrepareSignRequestVo()

Signature
global PrepareSignRequestVo()

PrepareSignRequestVo(signRequestTitle, templateId)

Signature
global PrepareSignRequestVo(String signRequestTitle, String templateId)

SignButlerClientApi.SigningMethodsVo

Signature
global with sharing class SigningMethodsVo

SignButlerClientApi.SigningMethodsVo Properties

Name Signature Annotations
drawn
global Boolean drawn
@AuraEnabled
handwritten
global Boolean handwritten
@AuraEnabled
mailOtp
global Boolean mailOtp
@AuraEnabled
smsOtp
global Boolean smsOtp
@AuraEnabled
upload
global Boolean upload
@AuraEnabled

SignButlerClientApi.SigningMethodsVo Constructors

SigningMethodsVo(handwritten, drawn, mailOtp, upload, smsOtp)

Signature
global SigningMethodsVo(Boolean handwritten,Boolean drawn,Boolean mailOtp, Boolean upload, Boolean smsOtp)

SignButlerClientApi.SignRequestCLVo

Signature
global class SignRequestCLVo

SignButlerClientApi.SignRequestCLVo Properties

Name Signature
base64Pdf
global String base64Pdf
fileName
global String fileName
recordId
global String recordId
redirectUrl
global String redirectUrl
sendEmail
global Boolean sendEmail
srtId
global String srtId
srTitle
global String srTitle

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