信封上的自定义字段通过API与复合模板

时间:2014-07-07 17:26:56

标签: docusignapi docusigncompositetmplts

我正在尝试使用以下复合模板从模板创建信封时创建2个自定义字段是json。

{
    "emailSubject": "This is a new",
    "status": "sent",
    "compositeTemplates": [
        {
            "inlinetemplates": [
                {
                    "sequence": "2",
                    "recipients": {
                        "signers": [
                            {
                                "email": "email@email.com",
                                "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@email.com",
                                "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被接受并且信封被创建但信封上没有自定义字段。我究竟做错了什么?

1 个答案:

答案 0 :(得分:2)

您想将其放在内联模板标记中。此外,您的格式有点偏,您在 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@email.com",
                                "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"
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ]
}