Show:   

SignButlerClientApi

Signature
global with sharing class SignButlerClientApi

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 = 'Single Signer.why not (1).pdf'; 
 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(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');

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

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