Invocable Method
  • 15 Jan 2023
  • 5 Minutes to read
  • Dark
    Light
  • PDF

Invocable Method

  • Dark
    Light
  • PDF

Article Summary

Lightico for Salesforce supports the following invocable actions:

Note:

All actions are Global class.

Create a new session with an eSign template

Action Name: CreateSingleSession

Creates a new Lightico session that can include a preconfigured eSign document.

Input parameters

Input class name: CreateSingleSessionWrapper

ParameterTypeDescription
recordIdstringID # of Salesforce record from which the session is originating
customerNamestringName of customer that is used in the session
Note:You must include customerPhoneNumber and/or customerEmail.
customerPhoneNumberstringCustomer's phone number for sending the SMS session invitation
customerEmailstringCustomer's email address for sending the session invitation
userNamestringLightico username of the agent associated with this session
lookUpFieldstringName of the field that links the session object with another object
esignTemplateIdstringIdentifies the document template. This ID # is found at the top left when the document template is opened in the PDF editor.
teamIdintegerIdentifies the team from which the session is running. This number appears in the Administration UI - log in to Lightico and go to Settings > Teams.
chatActivebooleantrue = customer chat enabled, false = customer chat disabled - customer cannot send text message to agent
userIdstringIdentifies the Salesforce agent associated with this session
sendNowbooleantrue = send a session invitation to the client upon creation of the session, false = do not send invitation
hubNamestringName of the Lightico document storage integration hub - the final document will be saved here

Response

Response class name: CreateSingleSessionResponse

ParameterTypeDescription
sessionIdstringIdentifies a Lightico session
customerURLstringOpens the customer collaboration UI

Create a new session with an ad hoc eSign

Action name: CreateSessionWithEsign

  • Creates a new session that can include an ad hoc eSign document.
  • The parameters in this action use tags to postition signature, initials and signature date fields in the final PDF.

Input parameters

Input class name: CreateSessionWithEsignWrapper

ParameterTypeDescription
userNamestringLightico username of the agent associated with this session
lookUpFieldstringName of the field that links the session object with another object
signatureTagstringIdentifies the signature field position
initialsTagstringIdentifies the initials field position
signatureDateTagstringIdentifies the signature date field position
fileNamestringName that you give to the eSign for this session. This is the name that will appear in the customer UI instead of the file name of the eSign.
rolestringDefines the role of the customer: signer = provides a signature, approver = approves by clicking a button
recordIdstringIdentifies the record from which the session will originate.
chatActivebooleantrue = customer chat enabled, false = customer chat disabled - customer cannot send text message to agent
customerNamestringName of customer that is used in the session
sessionIdstringCreate an ID for this session instead of the default sessionId created by Lightico
saveInAttachmentsbooleanSave assets from this session in a generic object called "Attachments" instead of saving the assets in the Lightico files object
Note:You must include customerPhoneNumber and/or customerEmail.
customerPhoneNumberstringCustomer's phone number for sending the SMS session invitation
customerEmailstringCustomer's email address for sending the session invitation
sendNowbooleantrue = send a session invitation to the client upon creation of the session, false = do not send invitation
documentIdstringIdentifies a Salesforce document that you are adding to the session
hubNamestring, optonalName of the Lightico document storage integration hub - the final document will be saved here

Response

Response class name: CreateSessionWithEsignResponse

ParameterTypeDescription
sessionIdstringIdentifies a Lightico session
customerURLstringOpens the customer collaboration UI
esignIdstringIdentifies a specific eSign document within a session
runTimeintegerTime in took for this action to be implemented in miliseconds

Add an eSign template to a session

Action name: AddEsignToSession

Add a preconfigured eSign template to an existing session.

Input parameters

Input class name: AddEsignToSessionWrapper

ParameterTypeDescription
sessionIdstringIdentifies an existing session
esignTemplateIdstringIdentifies the document template. This ID # is found at the top left when the document template is opened in the PDF editor.

Response

Response class name: AddEsignToSessionResponse

ParameterTypeDescription
esignIdstringIdentifies a specific eSign document within a session
statusCodeintegerResponse code, e.g. 200, 400
responseBodystringResponse message, e.g. OK, Error

Add an ad hoc esign to a session

Action name: AddEsign

  • Add an ad hoc eSign to an existing session.
  • The parameters in this action use tags to postition signature, initials and signature date fields in the final PDF.

Input parameters

Input class name: AddEsignWrapper

ParameterTypeDescription
documentIdstringIdentifies a Salesforce document that you are adding to the session
sessionIdstringIdentifies an existing session
signatureTagstringIdentifies the signature field position
initialsTagstringIdentifies the initials field position
signatureDateTagstringIdentifies the signature date field position
fileNamestringName that you give to the eSign for this session. This is the name that will appear in the customer UI instead of the file name of the eSign.
rolestringDefines the role of the customer: signer = provides a signature, approver = approves by clicking a button

Response

Response class name: AddEsignResponse

ParameterTypeDescription
esignIdstringIdentifies a specific eSign document within a session

Add a text message to a session

Action name: AddTextMessage

Send a text message to the customer UI in a session.
The text appears in the chat field of the collaboration UI.

Input parameters

Input class name: AddTextMessageWrapper

ParameterTypeDescription
sessionIdstringIdentifies the session to which you are adding this action
textMessagestringText of the message you are sending. Example: Do you need help reviewing the document?

Response

Response class name: AddTextMessageResponse
Type: Boolean
Description: true= message sent, false= message was not sent

Generate a document from a Lightico template

Action Name: GenerateDocumentByTemplate

Generates a PDF document based on a Lightico template and attributes mapped to Salesforce.

Input parameters

Input class name: DocumentGenerationData

ParameterTypeDescription
recordIdstringID # of Salesforce record from which to draw the attributes. In addition, the generated PDF is saved in the Notes and Attachments section of the record.
templateIdstringIdentifies the document template. This ID # is found at the top left when the document template is opened in the PDF editor.
hubNamestring, optonalCustom hub name for filtering events

Response

Type: Boolean
Description: true= success, false= failure

Code example

Lightico_GlobalMethods lg = new Lightico_GlobalMethods();
Lightico_GlobalMethods.DocumentGenerationData data = new Lightico_GlobalMethods.DocumentGenerationData();
data.recordId = '0030b00002RounDAAR';
data.templateId = 'c8552241-f718-4ad7-8c58-e0b8323c35c3';
boolean res = lg.GenerateDocuemntByTemplate(data);
system.debug(res);

Was this article helpful?