You are here:
getDocuments Method
This method delegates the task, by default, to the VOI class
DefaultDocuSignDocumentSelector that queries from both the
ContentVersion and Attachment objects. The class expects an input parameter
objectId that refers to the object whose documents are to be
fetched.
However, if you have already defined a custom class implementation setting
for DocuSignDocumentSelector, the task is delegated to that class
instead.
Parameters
Required parameters depend on the implementing class.
Parameter |
Description |
|---|---|
|
This is an optional parameter that specifies which VOI class
will be executed. Use this when you want to define a class other than
the default class or the one already defined for
If the value
refers to a class that does not exist,
|
Request Body
Using default or custom class implementation (if custom class is defined
and no documentSelector is submitted)
// initialize the parameters
String methodName = 'getDocuments';
Map<String, Object> inputMap = new Map<String, Object>();
Map<String, Object> outputMap = new Map<String, Object>();
Map<String, Object> optionsMap = new Map<String, Object>();
// input parameter expected by "DefaultDocuSignDocumentSelector"
inputMap.put('objectId', '[object whose documents are to be fetched]');
// will not use, optional parameter
// instantiate the generic api
VlocityOpenInterface2 voi = new GenericDocuSignIntegrationService();
// invoke the method
voi.invokeMethod(methodName, inputMap, outputMap, optionsMap);
// log result
System.debug('outputMap: ' + JSON.serialize(outputMap));Using a specific implementation. The getDocuments implementing class can
define its own input and optional parameters. In the sample below, the
implementing class CustomDocuSignDocumentSelector expects two
input parameters param1 and param2, and an optional
parameter option1.
// initialize the parameters
String methodName = 'getDocuments';
Map<String, Object> inputMap = new Map<String, Object>();
Map<String, Object> outputMap = new Map<String, Object>();
Map<String, Object> optionsMap = new Map<String, Object>();
// specify the input parameters expected by "CustomDocuSignDocumentSelector"
inputMap.put('param1', [param1 value]);
inputMap.put('param2', [param2 value]);
// specify custom class to use
optionsMap.put('documentSelector', 'CustomDocuSignDocumentSelector');
// specify the optional parameters expected by "CustomDocuSignDocumentSelector"
optionsMap.put('option1', [option1 value]);
// instantiate the generic api
VlocityOpenInterface2 voi = new GenericDocuSignIntegrationService();
// invoke the method
voi.invokeMethod(methodName, inputMap, outputMap, optionsMap);
// log result
System.debug('outputMap: ' + JSON.serialize(outputMap));
