我有一个使用模板的信封,我想向其中添加短信验证。
当前使用TemplateRoles(无短信验证)
示例 SDK EnvelopeDefinition 转换为 JSON:
{
"documents": [
{
"documentBase64": "[base64]",
"documentId": "1",
"fileExtension": "pdf",
"name": "doc1.pdf"
}
],
"emailBlurb": "Dear sir/madam, please sign upon agreement",
"emailSubject": "TEST signature request DocuSign",
"notification": {
"expirations": {
"expireAfter": "2",
"expireEnabled": "True",
"expireWarn": "0"
},
"reminders": {
"reminderDelay": "1",
"reminderEnabled": "True",
"reminderFrequency": "0"
}
},
"status": "sent",
"templateId": "55eef358-8081-4335-92bb-5d9298197093",
"templateRoles": [
{
"email": "[email protected]",
"emailNotification": {
"emailBody": "Dear sir/madam, please sign upon agreement",
"emailSubject": "TEST signature request DocuSign",
"supportedLanguage": "en"
},
"name": "Jane Smith",
"roleName": "Manager"
},
{
"email": "[email protected]",
"emailNotification": {
"emailBody": "Dear sir/madam, please sign upon agreement",
"emailSubject": "TEST signature request DocuSign",
"supportedLanguage": "en"
},
"name": "John Smith",
"roleName": "Candidate"
}
]
}
我想保持这个功能完整。
尝试复合模板(带短信验证)
我尝试通过转换为 CompositeTemplates 来添加 SMS 身份验证。
示例 SDK EnvelopeDefinition 转换为 JSON:
{
"compositeTemplates": [
{
"inlineTemplates": [
{
"documents": [
{
"documentBase64": "[base64]",
"documentId": "1",
"fileExtension": "pdf",
"name": "doc1.pdf"
}
],
"recipients": {
"signers": [
{
"email": "[email protected]",
"emailNotification": {
"emailBody": "Dear sir/madam, please sign upon agreement",
"emailSubject": "TEST signature request DocuSign",
"supportedLanguage": "en"
},
"emailRecipientPostSigningURL": "https://www.example.com/",
"identityVerification": {
"inputOptions": [
{
"name": "phone_number_list",
"phoneNumberList": [
{
"countryCode": "55",
"number": "12345678901"
}
],
"valueType": "PhoneNumberList"
}
],
"workflowId": "d9212359-89fb-42a2-a96e-d6019481bb62"
},
"name": "Jane Smith",
"recipientId": "1",
"roleName": "Manager"
},
{
"email": "[email protected]",
"emailNotification": {
"emailBody": "Dear sir/madam, please sign upon agreement",
"emailSubject": "TEST signature request DocuSign",
"supportedLanguage": "en"
},
"emailRecipientPostSigningURL": "https://www.example.com/",
"identityVerification": {
"inputOptions": [
{
"name": "phone_number_list",
"phoneNumberList": [
{
"countryCode": "55",
"number": "12345678902"
}
],
"valueType": "PhoneNumberList"
}
],
"workflowId": "d9212359-89fb-42a2-a96e-d6019481bb62"
},
"name": "John Smith",
"recipientId": "2",
"roleName": "Candidate"
}
]
},
"sequence": "2"
}
],
"serverTemplates": [
{
"sequence": "1",
"templateId": "55eef358-8081-4335-92bb-5d9298197093"
}
]
}
],
"emailBlurb": "Dear sir/madam, please sign upon agreement",
"emailSubject": "TEST signature request DocuSign",
"notification": {
"expirations": {
"expireAfter": "2",
"expireEnabled": "True",
"expireWarn": "0"
},
"reminders": {
"reminderDelay": "1",
"reminderEnabled": "True",
"reminderFrequency": "0"
}
},
"status": "sent"
}
几乎一切似乎都在工作,包括收件人字段,除了模板中的文档不会像 TemplateRoles 那样被信封中的文档替换。
我该如何实现这个目标?
我还没有找到足够的文档或示例来了解如何将 TemplateRoles 更改为基于 CompositeTemplates 的信封。
从您的
documents
中删除 inlineTemplate
。 放置在复合模板级别的 document
元素中。
<compositeTemplate>{
"document": "...",
"serverTemplate":{...},
"inlineTemplate":{...}
}
这将确保复合级别的
document
贡献实际文档,这样您的模板就不会在此复合对象中贡献物理文件。
你的顺序是正确的。 我没有详细检查您的模板,但这应该可以解决您眼前的问题。