通过 API 和复合模板在信封上自定义字段

问题描述 投票:0回答:2

在使用下面的复合模板从模板创建信封时,我尝试创建 2 个自定义字段,即 json。

{
    "emailSubject": "This is a new",
    "status": "sent",
    "compositeTemplates": [
        {
            "inlinetemplates": [
                {
                    "sequence": "2",
                    "recipients": {
                        "signers": [
                            {
                                "email": "[email protected]",
                                "name": "Jimmy Nobody",
                                "clientuserid": "1",
                                "recipientid": "1",
                                "rolename": "signer",
                                "dfaultrecipient": "true",
                                "tabs": {
                                    "texttabs": [
                                        {
                                            "name": "Text",
                                            "tabLabel": "name",
                                            "value": "Joe Smith"
                                        },
                                        {
                                            "name": "Text",
                                            "tabLabel": "address",
                                            "value": "987 apple lane"
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            ],
            "servertemplates": [
                {
                    "sequence": "1",
                    "templateId": "52be0f34-d8aa-420f-8283-4e9cc2bb499f"
                }
            ]
        },
        {
            "inlinetemplates": [
                {
                    "sequence": "2",
                    "recipients": {
                        "signers": [
                            {
                                "email": "[email protected]",
                                "name": "Jimmy Nobody",
                                "clientuserid": "1",
                                "recipientid": "1",
                                "rolename": "signer",
                                "dfaultrecipient": "true",
                                "tabs": {
                                    "texttabs": [
                                        {
                                            "name": "Text",
                                            "tabLabel": "name",
                                            "value": "Joe Smith"
                                        },
                                        {
                                            "name": "Text",
                                            "tabLabel": "address",
                                            "value": "987 apple lane"
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            ],
            "servertemplates": [
                {
                    "sequence": "1",
                    "templateId": "e00b896b-4ac7-48b1-8280-bfe3830a61f1"
                }
            ]
        }
    ],
    "customFields": {
        "textCustomFields": [
            {
                "name": "callingsystem",
                "required": "true",
                "show": "false",
                "value": "3e56cabd-6211-4203-a462-a7ff960a6b9c"
            },
            {
                "name": "callingsystemid",
                "required": "true",
                "show": "false",
                "value": "crm"
            }
        ]
    }
}

问题是此 JSON 被接受并创建了信封,但信封上没有自定义字段。 我做错了什么?

docusignapi docusigncompositetmplts
2个回答
3
投票

您想将其放入内联模板标签内。另外,您的格式有点不对,并且您在 defaultRecipient

中出现了拼写错误

试试这个:

{
    "emailSubject": "This is a new",
    "status": "sent",
    "compositeTemplates": [
        {
            "serverTemplates": [
                {
                    "sequence": "1",
                    "templateId": "52be0f34-d8aa-420f-8283-4e9cc2bb499f"
                }
            ]
        },
        {
            "serverTemplates": [
                {
                    "sequence": "1",
                    "templateId": "e00b896b-4ac7-48b1-8280-bfe3830a61f1"
                }
            ]
        },
        {
            "inlineTemplates": [
                {
                    "sequence": "2",
                    "customFields": {
                        "textCustomFields": [
                            {
                                "name": "callingsystem",
                                "required": "true",
                                "show": "false",
                                "value": "3e56cabd-6211-4203-a462-a7ff960a6b9c"
                            },
                            {
                                "name": "callingsystemid",
                                "required": "true",
                                "show": "false",
                                "value": "crm"
                            }
                        ]
                    },
                    "recipients": {
                        "signers": [
                            {
                                "email": "[email protected]",
                                "name": "Jimmy Nobody",
                                "clientuserid": "1",
                                "recipientid": "1",
                                "rolename": "signer",
                                "defaultrecipient": "true",
                                "tabs": {
                                    "texttabs": [
                                        {
                                            "name": "Text",
                                            "tabLabel": "name",
                                            "value": "Joe Smith"
                                        },
                                        {
                                            "name": "Text",
                                            "tabLabel": "address",
                                            "value": "987 apple lane"
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ]
}

0
投票

我正在使用带有内联模板中指定的自定义字段的复合模板,但它们没有被拾取,并且我收到错误消息,指出它们丢失了。

信封: { "emailSubject": "电子签名", "emailBlurb": "请签署文件", “复合模板”:[{ “文档”: { “documentBase64”:“xxx”, “名称”:“形式”, "文件扩展名": "pdf", “文档ID”:1 }, “服务器模板”:[{ “序列”:1, “模板Id”:“f94ccf52-de90-4904-b330-310fac1169a8” } ], “内联模板”:[{ “序列”:2, “自定义字段”:{ “文本自定义字段”:[{ "姓名": "合同号", “必需”:真实, “显示”:真实, “值”:“2966” } ] }, “收件人”:{ “签名者”:[{ "email": "[电子邮件受保护]", “姓名”:“玛丽·克莱尔 xxx_38541”, “收件人ID”:1, “标签”:{ “signHereTabs”:[{ “文档ID”:2, “页码”:1, “x位置”:72, “y 位置”:160 }, { "anchorString": "\s1\", “anchorIgnoreIfNotPresent”:true } ], “日期签名选项卡”:[{ “文档ID”:2, “页码”:1, “x位置”:132, “y 位置”:160 } ], “全名选项卡”:[{ “文档ID”:2, “页码”:1, “x位置”:132, “y 位置”:170 } ] }, “recipientSignatureProviders”:[{ "signatureProviderName": "UniversalSignaturePen_OpenTrust_Hash_TSP", “signatureProviderOptions”:{ “短信”:“+334444444” } } ], "roleName": "签名者 1" } ], “碳副本”:[] } } ] }, { “文档”: { “documentBase64”:“xxx”, "name": "testDoc-4.pdf", "文件扩展名": "pdf", “文档ID”:2 }, “服务器模板”:[{ “序列”:1, “模板Id”:“f94ccf52-de90-4904-b330-310fac1169a8” } ] } ], “状态”:“已发送” }

回复

{ “错误代码”:“ENVELOPE_CUSTOM_FIELD_MISSING”, "message": "缺少必需的信封自定义字段。自定义字段“contractNumber”需要一个值。" }

© www.soinside.com 2019 - 2024. All rights reserved.