Docusign API - 创建信封、应用模板、预填充值
Docusign API - Create envelope, apply template, prefill values
许多问题解决了我的部分请求,但我似乎无法提供完整的解决方案。我在我的网站上创建了一个模板(它有各种文本字段、初始字段和签名块)。单个收件人,对字段使用锚标记。当我拿一个 .docx 文件时,通过 api 创建一个信封,我想应用前面提到的模板,然后在 document/template.
上预填充 4 个文本字段
锚标记没有正确放置字段。
任何advise/suggestions?
工作请求调用是:
{
"documents":
[
{
"documentBase64":"<BASE64STREAM>",
"documentId":"3",
"fileExtension":"docx",
"name":"10001000_20170803_FILE"
}
],
"emailSubject": "TEST - Group Audit - 10001000",
"templateId": "TEMPLATE_ID",
"templateRoles" :
[
{
"email": "JDOE@email.com",
"name": "JOHN DOE",
"roleName": "signer1",
"tabs":
{
"textTabs":
[
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "groupname",
"value": "TEST GROUP ONE"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "groupnumber",
"value": "10001000"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "txt",
"value": "my@email.com"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "fein",
"value": "870142380"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "physicaladdress",
"value": "1 STREET WAY, , MY CITY, CA, 98001"
}
]
}
}
],
"status":"sent"
}
根据您提供的信息,我理解您的情况如下:
您已经通过 DocuSign 创建了模板UI;该模板包含一个 'placeholder' 文档(您将在 运行 时通过您的 Create/Send Envlope API 调用替换它)并定义该文档的收件人和标签。
当您通过 API create/send 信封时,您希望将文档指定为 API 请求的一部分(即,用于代替'placeholder' DocuSign 模板包含的文档)并自动填充模板定义的一些选项卡。
如果这是对您要实现的目标的准确描述,那么您需要在 API 请求结构中使用 Composite Templates。这是一个 Create/Send 信封 JSON 请求的示例,它使用复合模板(并包含基于您在问题中提供的信息的数据):
{
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "TEMPLATE_ID"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "JOHN DOE",
"email": "JDOE@email.com",
"roleName": "signer1",
"tabs":
{
"textTabs":[
{
"tabLabel" : "groupname",
"value" : "TEST GROUP ONE"
},
{
"tabLabel" : "groupnumber",
"value" : "10001000"
},
{
"tabLabel" : "txt",
"value" : "my@email.com"
},
{
"tabLabel" : "fein",
"value" : "870142380"
},
{
"tabLabel" : "physicaladdress",
"value" : "1 STREET WAY, , MY CITY, CA, 98001"
}
]
}
}
]
}
}
],
"document": {
"documentId": "3",
"name": "10001000_20170803_FILE.docx",
"fileExtension": "docx",
"documentBase64": "BASE64STREAM"
}
}
],
"status": "sent",
"emailSubject": "TEST - Group Audit - 10001000"
}
许多问题解决了我的部分请求,但我似乎无法提供完整的解决方案。我在我的网站上创建了一个模板(它有各种文本字段、初始字段和签名块)。单个收件人,对字段使用锚标记。当我拿一个 .docx 文件时,通过 api 创建一个信封,我想应用前面提到的模板,然后在 document/template.
上预填充 4 个文本字段锚标记没有正确放置字段。
任何advise/suggestions?
工作请求调用是:
{
"documents":
[
{
"documentBase64":"<BASE64STREAM>",
"documentId":"3",
"fileExtension":"docx",
"name":"10001000_20170803_FILE"
}
],
"emailSubject": "TEST - Group Audit - 10001000",
"templateId": "TEMPLATE_ID",
"templateRoles" :
[
{
"email": "JDOE@email.com",
"name": "JOHN DOE",
"roleName": "signer1",
"tabs":
{
"textTabs":
[
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "groupname",
"value": "TEST GROUP ONE"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "groupnumber",
"value": "10001000"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "txt",
"value": "my@email.com"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "fein",
"value": "870142380"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "physicaladdress",
"value": "1 STREET WAY, , MY CITY, CA, 98001"
}
]
}
}
],
"status":"sent"
}
根据您提供的信息,我理解您的情况如下:
您已经通过 DocuSign 创建了模板UI;该模板包含一个 'placeholder' 文档(您将在 运行 时通过您的 Create/Send Envlope API 调用替换它)并定义该文档的收件人和标签。
当您通过 API create/send 信封时,您希望将文档指定为 API 请求的一部分(即,用于代替'placeholder' DocuSign 模板包含的文档)并自动填充模板定义的一些选项卡。
如果这是对您要实现的目标的准确描述,那么您需要在 API 请求结构中使用 Composite Templates。这是一个 Create/Send 信封 JSON 请求的示例,它使用复合模板(并包含基于您在问题中提供的信息的数据):
{
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "TEMPLATE_ID"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "JOHN DOE",
"email": "JDOE@email.com",
"roleName": "signer1",
"tabs":
{
"textTabs":[
{
"tabLabel" : "groupname",
"value" : "TEST GROUP ONE"
},
{
"tabLabel" : "groupnumber",
"value" : "10001000"
},
{
"tabLabel" : "txt",
"value" : "my@email.com"
},
{
"tabLabel" : "fein",
"value" : "870142380"
},
{
"tabLabel" : "physicaladdress",
"value" : "1 STREET WAY, , MY CITY, CA, 98001"
}
]
}
}
]
}
}
],
"document": {
"documentId": "3",
"name": "10001000_20170803_FILE.docx",
"fileExtension": "docx",
"documentBase64": "BASE64STREAM"
}
}
],
"status": "sent",
"emailSubject": "TEST - Group Audit - 10001000"
}