Search code examples
docusignapi

How do I set up multiple in-person signers via DocuSign's eSignature API?


Currently my app is able to create the envelope, and the recipient view, grab the url and redirect the browser to the signing session. What happens then is the first signer can sign, and will be redirected back to my app when they finish signing. Then the host gets an email to start the hosting session for the second signer.

Instead, what I'd like to have happen is the first signer signs, then the second signer signs, then redirected back to my app. Is this possible?

Thanks.

This is my request to create the envelope with a custom document, and a template that was previously created. The custom document will only be signed by the second signer. The template will be signed by the first signer, then the second signer.

{
  'emailSubject': emailSubject,
  'emailBlurb': emailBlurb,
  'status': 'sent',
  'envelopeIdStamping': 'false',
  'compositeTemplates': [{
   'document': {
     'documentId': '1',
     'name': fileName,
     'documentBase64': base64File
   },
   'inlineTemplates': [{
     'sequence': '1',
     'recipients': {
       'inPersonSigners': [{
         'hostEmail': hostEmail,
         'hostName': hostName,
         'inPersonSigningType': 'inPersonSigner',
         'recipientId': '2',
         'requireIdLookup': 'false',
         'routingOrder': '2',
         'signerEmail': signer2Email,
         'signerName': signer2Name,
         'tabs': {
           'signHereTabs': [{
             'documentId': '1',
             'anchorString': signatureAnchorString
           }],
           'initialHereTabs': [{
             'documentId': '1',
             'anchorString': initialAnchorString
           }]
         } //Tabs
       }] //Signers
     } //Recipients
   }] //Inline Templates
 }, //Documents
  'serverTemplates': [{
     'sequence': '1',
     'templateId': templateId
   }],
   'inlineTemplates': [{
     'sequence': '2',
     'recipients': {
       'inPersonSigners': [{
         'hostEmail': hostEmail
         'hostName': hostName
         'inPersonSigningType': 'inPersonSigner',
         'signerEmail': signer1Email,
         'signerName': signer1Name,
         'recipientId': '1',
         'requireIdLookup': 'false',
         'routingOrder': '1',
         'roleName': signer1Role
       },
       {
         'hostEmail': hostEmail,
         'hostName': hostName,
         'inPersonSigningType': 'inPersonSigner',
         'signerEmail': signer2Email,
         'signerName': signer2Name,
         'recipientId': '2',
         'requireIdLookup': 'false',
         'routingOrder': '2',
         'roleName': signer2Role
       }] //inPersonSigners
     } //Recipients
  }] //inlineTemplates
} //Template Document

This is my request for the recipient's view.

let viewRequest = {
        'returnUrl': myappsUrl,
        'authenticationMethod': 'none',
        'email': hostEmail
        'userName': hostName
    }

Solution

  • So, here you have an opportunity to redirect to some URL, right?

    let viewRequest = {
            'returnUrl': myappsUrl,
            'authenticationMethod': 'none',
            'email': hostEmail
            'userName': hostName
        }
    

    myappsURL is a URL that goes to your code. The code in there should be doing this:

    1. Generating the same type of embedded URL for the second signer (with a different returnURL) . Same as you did for first.
    2. Redirecting browser to the URL that was generated in 1.

    This will allow you to do what you asked