问题
I have had plenty of success using docusign API with single template, roles, tabs, etc... My use case is now:
1) Have a single envelope that contains multiple server templates
2) The roles will be the same for both server templates
3) However there may be different tabs for each role for each template
Through reading the Docusign API and trial and error I am close, but just cant get across the finish line here. Here is my current JSON:
accountId = 414772
baseUrl = https://demo.docusign.net/restapi/v2/accounts/414772
{
"accountId": "414772",
"emailSubject": "DocuSign API - Signature Request from Template",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "F42C617E-0C61-4A98-944E-F9CAA0AE55D9"
}
],
"inlineTemplates": [
{
"sequence": 2,
"recipients": {
"signers": [
{
"recipientId": 1,
"email": "reirealtor@mailinator.com",
"name": "REI Realtor",
"roleName": "Realtor",
"tabs": {
"textTabs": [
{
"tabLabel": "\\*header_address",
"value": "SOME TEST INFO GOES HERE"
},
{
"tabLabel": "Address",
"value": "123 REally Cool St"
}
]
}
},
{
"recipientId": 2,
"email": "reibuyer@mailinator.com",
"name": "John Doe",
"roleName": "Client"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "47F5C07B-016C-4E6D-B31D-DCEF9AEAAA69"
}
],
"inlineTemplates": [
{
"sequence": 2,
"recipients": {
"signers": [
{
"recipientId": 1,
"email": "reirealtor@mailinator.com",
"name": "REI Realtor",
"roleName": "Realtor",
"tabs": {
"textTabs": [
{
"tabLabel": "\\*header_address",
"value": "SOME TEST INFO GOES HERE"
},
{
"tabLabel": "Some Other Tab",
"value": "Populate some text here"
}
]
}
},
{
"recipientId": 2,
"email": "reibuyer@mailinator.com",
"name": "John Doe",
"roleName": "Client"
}
]
}
}
]
}
],
"status": "sent"
}
So obviously this doesn't work, but I don't really get any feedback as to why, Docusign just doesn't reply. I have narrowed it down to the 4th signer block
"recipientId": 2,
"email": "reibuyer@mailinator.com",
"name": "John Doe",
"roleName": "Client"
If I remove this block, it creates the envelope and sends it, but then my second template doesn't have a signing block. I suspect I am just doing this all wrong to begin with.
Any ideas?
回答1:
I think your real issue is number vs string on sequence and ids. I will mock up a POST with your JSDON later today, but here is a valid sample for you to review in the mean time:
{
"emailSubject": "Test 3",
"emailBlurb": "Using two templates from composite template structure",
"brandId" : "f8c86e34-722e-4360-a9a0-54647bcd3004",
"status": "created",
"compositeTemplates": [{
"serverTemplates": [{
"sequence": "1",
"templateId": "6E558133-112C-434E-BF84-7C4DF340F042"
}],
"inlineTemplates": [{
"sequence": "1",
"recipients": {
"signers": [{
"email": "David.grigsby@docusign.com",
"name": "David W. Grigsby",
"recipientId": "1",
"roleName": "Role",
"tabs": {
"textTabs": [{
"value": "David Grigsby",
"tabLabel": "name"
},
{
"value": "David",
"tabLabel": "first_name"
}]
}
}]
}
}]
},
{
"serverTemplates": [{
"sequence": "2",
"templateId": "12C8894E-505C-480F-92FF-245DC387AD34"
}],
"inlineTemplates": [{
"sequence": "2",
"recipients": {
"signers": [{
"email": "David.grigsby@docusign.com",
"name": "David W. Grigsby",
"recipientId": "1",
"roleName": "Role",
"tabs": {
"textTabs": [{
"value": "David W. Grigsby",
"tabLabel": "name"
},
{
"value": "Grigsby",
"tabLabel": "last_name"
}]
}
}]
}
}]
}]
}
来源:https://stackoverflow.com/questions/22223946/docusign-one-envelope-with-multiple-server-templates