How to add signing group as recipient with apex toolkit

315 Views Asked by At

Is it possible to add a signing group as the recipient with apex toolkit when sending an envelope?

1

There are 1 best solutions below

1
On

Here's how you send to a signing group using Apex

dfsle.SigningGroup testSigningGroup = new dfsle.SigningGroup(123456, 'Test'); // ID and Name should match the DocuSign Signing group name and ID

    dfsle.Recipient myRecipient = new dfsle.Recipient(
        null, //Source Id
        'Signer',//Type of recipient
        1, //Sequence
        1, //routing order
        new dfsle.Recipient.Role('Signer 1',null), //role -used to match role
        //on template if using a template
        null, //inPerson Recipient name
        null, //inPerson Recipient Email
        testSigningGroup, //signing group
        null, //phone
        null,//no Authentication
        null, //note
        null, //EmailSettings
        null, //host name This is the name of the host for InPerson
        null, //host email email of host
        true, //sign now
        null, //source
        false, //read only
        false //required
    );

And then you can add it to your envelope using

dfsle.Envelope myEnvelope = dfsle.EnvelopeService.getEmptyEnvelope(
        new dfsle.Entity(mySourceId)) // The initiating Salesforce entity--current SF user (salesperson)
        .withDocuments(new List<dfsle.Document> { 
            dfsle.Document.fromTemplate(myTemplateId, DESCRIPTION) 
        })
        .withRecipients(new List<dfsle.Recipient> { myRecipient }
    );