user4651528
user4651528

Reputation: 47

DocusignAPI - Issue - Trying to push data to template before sending & it doesn't work

I have a text field labeled "RecipientName" in my template. I am trying to populate that field before sending to receipient. But it doesn't populate. I am using "DocuSign API - Signature Request from Template". I don't get any error, but it doesn't populate the field. Please help!

Here is my request Body & url

string url = "https://demo.docusign.net/restapi/v2" + "/accounts/" + accountId + "/envelopes";

string requestBody =

                "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
                    "<status>sent</status>" +
                    "<emailSubject>DocuSign API - Signature Request from Template</emailSubject>" +
                    "<templateId>" + templateId + "</templateId>" +                        
                    "<templateRoles>" +
                    "<templateRole>" +  
                            "<name>" + recipientName + "</name>" +
                            "<email>" + recipientEmail + "</email>" +
                            "<roleName>" + templateRole + "</roleName>" +
                            "<tabs>" +
                            "<textTabs>" +
                             "<tabLabel>RecipientName</tabLabel>" +
                              "<name>RecipientName</name>" +
                             "<value>Recepient Test</value>" +
                            "</textTabs>" +
                             "</tabs>" +
                        "</templateRole>" + 
                    "</templateRoles>" +                        
                "</envelopeDefinition>";

Upvotes: 0

Views: 91

Answers (1)

Ergin
Ergin

Reputation: 9356

You're missing the inner <text> xml tag for your tab. Try this:

<textTabs>
    <text>
        <tabLabel>RecipientName</tabLabel>
        <value>RecipientName</value>
    </text>
</textTabs>

This should work, though as Andrew mentioned you should really just use the Name tag if you're trying to display the recipient's name.

Upvotes: 2

Related Questions