I'm am trying to create an envelope for embedded signing with two sever-side templates and a pdf document I generated all in one request. One of the server-side templates has a DOB tab that will be filled in with the data specified in the request.
I've reviewed some other questions related to the docusign api and composite templates with documents here and here I've used these examples to format my request.
Here is the request: NOTE: I'm using the multipart-post gem here to create the request, so some of this request is pseudo HTTP with some multipart-post info. I'm not sure how to get a fully formed HTTP request out in order to post it here.
POST http://localhost/restapi/v2/accounts/2/envelopes
X-DocuSign-Authentication: [omitted]
-------------RubyMultipartPost
Content-Type: application/json
Content-Disposition: form-data;
name="post_body"
{
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "3093E017-2E18-4A30-A104-0201C601CE5F"
}
],
"inlineTemplates": [
{
"sequence": 1,
"recipients": {
"signers": [
{
"email": "jond@gmail.com",
"name": "Jon D. Doe",
"recipientId": "1",
"roleName": "Proposed Insured",
"clientUserId": "jond@gmail.com",
"tabs": {
"textTabs": [
],
"checkboxTabs": [
],
"fullNameTabs": [
],
"dateTabs": [
{
"tabLabel": "DOB",
"name": null,
"value": "1-21-1974",
"documentId": null,
"selected": null
}
]
}
}
]
}
}
],
"document": {
"documentId": "1",
"name": "test.pdf"
}
},
{
"serverTemplates": [
{
"sequence": 2,
"templateId": "63CA2E24-BBB8-499F-A884-021580DF54AF"
}
],
"inlineTemplates": [
{
"sequence": 2,
"recipients": {
"signers": [
{
"email": "jond@gmail.com",
"name": "Jon D. Doe",
"recipientId": "1",
"roleName": "Proposed Insured",
"clientUserId": "jond@gmail.com",
"tabs": {
"textTabs": [
],
"checkboxTabs": [
],
"fullNameTabs": [
],
"dateTabs": [
{
"tabLabel": "DOB",
"name": null,
"value": "1-21-1974",
"documentId": null,
"selected": null
}
]
}
}
]
}
}
]
}
],
"status": "sent"
}
-------------RubyMultipartPost
Content-Disposition: file;filename="test.pdf";documentid=1;name="file1"
Content-Length: 34967
Content-Type: application/pdf
Content-Transfer-Encoding: binary
[pdf bytes omitted]
The resulting embedded view only has two documents in it. The 1st is the test.pdf I uploaded in the request and the 2nd is the server-side template specified by templateId=63CA2E24-BBB8-499F-A884-021580DF54AF
I'm not sure what I'm doing wrong .. according to the other questions I referenced above, this should work.