I'm trying to send an envelope from a template using the REST API. I'm using Java with XML since the Java example is given with XML only. Here: http://iodocs.docusign.com/APIWalkthrough/requestSignatureFromTemplate
My template is very simple. It has: 1. A data field called Material1 2. A data field called Quantity1 3. A Full Name field 4. Signature field 5. Date Signed field
Here's the screen shot:
The Java code I'm using is exactly as it appears in the API Walkthrough link that I provided above. The XML that I supply is:
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>ZZZZZZZZZZ</accountId>
<status>sent</status>
<emailSubject>DocuSign API Call - Signature request from template
</emailSubject>
<templateId>1886EC14-153E-4E05-AFF8-04F508098E60</templateId>
<templateRoles>
<templateRole>
<name>Michael</name>
<email>michael@company.com</email>
<roleName>Signer1</roleName>
<tabs>
<textTabs>
<text>
<tabLabel>\*Material1</tabLabel>
<value>MTX80HD</value>
</text>
<text>
<tabLabel>\*Quantity1</tabLabel>
<value>11</value>
</text>
</textTabs>
</tabs>
</templateRole>
</templateRoles>
</envelopeDefinition>
However the value of MTX80HD is not being prefilled in the Material1 Field, nor do I see 11 in the Quantity1. I've read multiple posts here and followed every suggestion that I have found but still can't get the pre population to work. The Full Name and Date Sign are filled in however.
TIA
Edit 1: OK. I converted the XML to JSON, as @ergin suggested below and the fields are still not prepopulated. So the issue must lie elsewhere and not with XML.
Here's the JSON I'm sending:
{"account":"MyAccountId","status":"sent","emailSubject":"DocuSign API Call - Test signature request from template","templateId":"1886EC14-153E-4E05-AFF8-04F508098E60","templateRoles":[{"name":"Michael","email":"michael@company.com","roleName":"Signer1","tabs":{"textTabs":[{"tabLabel":"Material1","value":"MTX80HD"}]}}]}
The fields I'm trying to populate with the tabs were created on the template as Data Field widgets.
I must be missing something obvious, as I see people posting that they got it to work, eventually. Hope to hear from anyone who has any ideas.
Thanks.