0

I working on signup process that require new user to sign on documents. I am using DocuSign embed signing workflow for that

I have created template with pdf document in docusign admin panel and added 1 test route: enter image description here

and in the backend I am performing following api calls:

  1. STEP 1 - Login API Call (used to retrieve your baseUrl) - restapi/v2/login_information
  2. STEP 2 - Create an Envelope from Template and Send - baseURL + "/envelopes"
  3. STEP 3 - Launch the Embedded Signing view (aka recipient view) - baseURL + uri + "/views/recipient"

and as parameters for email, username if I am sending test@mail.com, test2 (like in route) then when I go to the retrieved recipient view url I see that form already has the placeholder for Sign and Initials since I have added these tags for test2 user in admin panel and form looks like: enter image description here

Which is GREAT!

But not if I will send test3 and test3@mail.com as username and email params in this case I see form like this: enter image description here

Here user can place his sign and other elements where he wants(which is BAD)

I need that behavior for all usernames and emails of new users that will signup(like all user will see these tags to sign and initial) I can't add them into admin panel to route since I don't know emails of new users that will came to site.

Is there a way to accomplish that ?

RequestBody for STEP2 for @AndrewWilson's request

"<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
"<status>sent</status>" +
"<emailSubject>DocuSign API - Embedded Signing example</emailSubject>" +
"<templateId>" + TEMPLATE_ID + "</templateId>" +
"<templateRoles>" +
"<templateRole>" +
"<email>" + recipientEmail + "</email>" +
"<name>" + recipientName + "</name>" +
"<roleName>test2</roleName>" +
"<clientUserId>1</clientUserId>"
"</templateRole>" +
"</templateRoles>" +
"</envelopeDefinition>";

recipientEmail, recipientName it will be dynamic, templateId constant for doc

Andrew
  • 4,443
  • 5
  • 33
  • 75
Sergiy Kozachenko
  • 1,399
  • 11
  • 31
  • Can you post the full REST request for each scenario for your step labelled: STEP 2 - Create an Envelope from Template and Send - baseURL + "/envelopes". Also is your recipient information dynamic? you shouldn't be setting it in the template if it is. – Andrew Jan 12 '15 at 16:04
  • @AndrewWilson added, yes recipient info dynamic, I have added test2 route recipient for test purpose only, it's only way I can assign signHere tags for it in Admin. – Sergiy Kozachenko Jan 12 '15 at 16:28
  • I found a way - but only with document: there are options tabs - where I can put signHereTab and assign position for it it works good and each new recipient will see already created tags where to sign, but this approach require all the time to upload document file to api which is very bad. Somehow there is same options (signHereTab) for the template but it's doesn't work at all (maybe b/c of there is documentId which it assigned to???) – Sergiy Kozachenko Jan 12 '15 at 16:35
  • 1
    You can do this with templates. If you remove the name/email from your template your call should work fine. – Andrew Jan 12 '15 at 18:01
  • @AndrewWilson you meant remove that test record from 1st screenshot? – Sergiy Kozachenko Jan 12 '15 at 18:04
  • Then it means if there are some routes setup for template manually dynamic tags will not work ? – Sergiy Kozachenko Jan 12 '15 at 18:12
  • You can add tags to a recipient on a template, let me post an answer with a more detailed write up. – Andrew Jan 12 '15 at 19:07

1 Answers1

3

Here is a sample call that would fill out your recipient information on a template that has roleName of Awesome Role, while email and name are both blank

{
    "emailSubject": "Super Awesome DocuSign Integration",
    "templateId": "{templateId}",
    "status": "sent",
    "templateRoles": [
        {
            "email": "person@email.com",
            "name": "First Last",
            "roleName": "Awesome Role",
            "clientUserId": 123456
        }
    ]
}

If you want to start adding additional tags dynamically, you'd want to start using compositeTemplates, these increase the difficulty of the call, but here is a sample call using the same template but adding a Signature tag for the recipient.

{
    "emailSubject": "Super Awesome DocuSign Integration",
    "status": "sent",
    "templateId": "{templateId}",
    "templateRoles": [
        {
            "email": "person@email.com",
            "name": "First Last",
            "roleName": "Awesome Role",
            "clientUserId":123456
        }
    ],
    "compositeTemplates": [
        {
            "inlineTemplates": [
                {
                    "sequence": "1",
                    "recipients": {
                        "signers": [
                            {
                                "email": "person@email.com",
                                "name": "First Last",
                                "clientUserId":123456,
                                "recipientId": "1",
                                "defaultRecipient": "true",
                                "tabs": {
                                    "signHereTabs": [
                                        {
                                            "xPosition": "200",
                                            "yPosition": "200",
                                            "documentId": "1",
                                            "pageNumber": "1"
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ]
}

More on Composite Templates in the DocuSign REST API Guide

Andrew
  • 4,443
  • 5
  • 33
  • 75