您需要有一個組合模板數組,DocA和DocB將來自ServerTemplates,並且DocC將作爲一個inlineTemplates添加。我已經放置了一個CompositeTemplate樣本調用,其中templatedId - E5577130-E7C4-4601-B618-95DD79644971正在從第一個複合模板(您的DocA/DocB場景)向信封中添加文檔,並將inlineTemplate中的「documentId」:「2」添加到信封中。並且收件人分別在每個合成模板中聲明。
POST /restapi/v2/accounts/{{acctID}}/envelopes HTTP/1.1
Host: demo.docusign.net
X-DocuSign-Authentication: <DocuSignCredentials><Username>{{user}}
</Username><Password>{{pwd}}</Password><IntegratorKey>{{IntegratorKey}}
</IntegratorKey></DocuSignCredentials>
Content-Type: multipart/form-data; boundary=BOUNDARY
--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data
{
"emailSubject": "REST example - two docs, one from template and one direct",
"enableWetSign": false,
"enforceSignerVisibility": false,
"status": "created",
"compositeTemplates": [
{
"compositeTemplateId": "1",
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"email": "[email protected]",
"name": "Daffy Duck",
"recipientId": "1",
"roleName": "Primary_Signer",
"tabs":{
"textTabs":[
{
"documentId":"1",
"pageNumber":"1",
"xPosition":"525",
"yPosition":"750",
"recipientId":"1",
"locked":"true",
"tabLabel":"Primary_TrxID",
"value": "e93k33"
}
]
}
}
]
},
"sequence": "2"
}
],
"serverTemplates":
[
{
"sequence": "1",
"templateId": "E5577130-E7C4-4601-B618-95DD79644971"
}
]
},
{
"compositeTemplateId": "2",
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"email": "[email protected]",
"name": "Daffy Duck",
"recipientId": "1",
"roleName": "Primary_Signer",
"tabs":{
"textTabs":[
{
"documentId":"2",
"pageNumber":"1",
"xPosition":"525",
"yPosition":"750",
"recipientId":"1",
"locked":"true",
"tabLabel":"Primary_TrxID",
"value": "e93k33"
}
]
}
}
]
},
"sequence": "1"
}
],
"document" :
{
"documentId" : "2",
"name": "Option2"
}
}
]
}
--BOUNDARY
Content-Disposition: file; documentid=2; name="Option2";
filename="Option2.pdf"; compositeTemplateId=2
Content-Type: application/pdf
Content-Transfer-Encoding: base64
<DocBytesBase64>
--BOUNDARY--