我尝试通过 REST API 在信封级别添加自定义字段,但无法获取要保留的值。 自定义字段已在 UI 中定义并出现在信封中,但没有分配的值。 如果我添加 UI 中未定义的自定义字段,那么它根本不会出现。
如果我在最初创建信封后在第二次调用中添加新的自定义字段,它将起作用,但这似乎是无关的。 我做错了什么?
以下是用于在信封中创建新自定义字段的 JSON:
{
"emailSubject": "Please Print, Complete and Sign Document",
"emailBlurb": "Please print and complete documents and sign on paper. ",
"status": "sent",
"customFields": {"textCustomFields":[{"name":"MyOwnField","required":"true","show":"true","value":"MyValue"}]},
"compositeTemplates": [{
"inlineTemplates": [{
"sequence": "1",
"recipients": {
"signers": [{
"requireSignOnPaper": "true",
"name":"Millard Fillmore",
"email":"[email protected]",
"recipientId": "1",
"routingOrder": "1"
}]
}
}],
"document":
{
"documentId": "1",
"name": "Corestone Account Application.pdf",
"transformPdfFields": false
}
}]
}
customFields 对象需要位于inlineTemplate 对象内部。 试试这个:
{
"emailSubject": "Please Print, Complete and Sign Document",
"emailBlurb": "Please print and complete documents and sign on paper. ",
"status": "sent",
"compositeTemplates": [{
"inlineTemplates": [{
"sequence": "1",
"customFields": {
"textCustomFields": [{
"name": "MyOwnField",
"required": "true",
"show": "true",
"value": "MyValue"
}]
},
"recipients": {
"signers": [{
"requireSignOnPaper": "true",
"name": "Millard Fillmore",
"email": "[email protected]",
"recipientId": "1",
"routingOrder": "1"
}]
}
}],
"document": {
"documentId": "1",
"name": "Corestone Account Application.pdf",
"transformPdfFields": false
}
}]
}
我正在使用带有内联模板中指定的自定义字段的复合模板,但它们没有被拾取,并且我收到错误消息,指出它们丢失了。
信封:
{ "emailSubject": "电子签名", "emailBlurb": "请在文档上签名", "compositeTemplates": [{ "document": { "documentBase64": "xxx", "name": "form", " fileExtension": "pdf", "documentId": 1 }, "serverTemplates": [{ "sequence": 1, "templateId": "f94ccf52-de90-4904-b330-310fac1169a8" } ], "inlineTemplates": [{ "sequence": 2, "customFields": { "textCustomFields": [{ "name": "contractNumber", "required": true ,“显示”:true,“值”:“2966”}]}, "recipients": { "signers": [{ "email": "[email protected]", "name": "Marie-Claire xxx_38541", "recipientId": 1, "tabs": { "signHereTabs": [{“documentId”:2,“pageNumber”:1,“xPosition”:72,“yPosition”:第160章} ], "fullNameTabs": [{ "documentId": 2, “pageNumber”:1,“xPosition”:132,“yPosition”:170}]},“recipientSignatureProviders”:[{“signatureProviderName”:“UniversalSignaturePen_OpenTrust_Hash_TSP”,“signatureProviderOptions”:{“sms”:“+334444444”}} ], "角色名称": "Signataire 1" } ], "carbonCopies": [] } } ] }, { "document": { "documentBase64": "xxx", "name": "testDoc-4.pdf", "fileExtension": "pdf ", "documentId": 2 }, "serverTemplates": [{ "sequence": 1, "templateId": "f94ccf52-de90-4904-b330-310fac1169a8" } ] } ], "状态": "已发送" }
回应:
{ "errorCode": "ENVELOPE_CUSTOM_FIELD_MISSING", "message": "缺少必需的信封自定义字段。自定义字段“contractNumber”需要一个值。" }