简体   繁体   English

使用自定义字段创建DocuSign信封

[英]Create DocuSign Envelope with Custom Fields

I am trying to add custom fields at the envelope level via the REST API and cannot get the values to be retained. 我试图通过REST API在信封级别添加自定义字段,并且无法获取要保留的值。 The custom fields have been defined in the UI and come over in the envelope, but without the value that was assigned. 自定义字段已在UI中定义并在信封中显示,但没有分配的值。 If I add a custom field that was not defined in the UI, then it does not come over at all. 如果我添加一个未在UI中定义的自定义字段,那么它根本就不会出现。

If I add the new custom field in a second call after the envelope is initially created, it will work, but that seems extraneous. 如果我在最初创建信封后在第二次调用中添加新的自定义字段,它将起作用,但这似乎是无关紧要的。 What am I doing wrong? 我究竟做错了什么?

Here is the JSON for creating a new custom field in the envelope: 以下是用于在信封中创建新自定义字段的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":"dgilbert@firstallied.com",
                    "recipientId": "1",
                    "routingOrder": "1"
                }]
            }
        }],
        "document":
        {
            "documentId": "1",
            "name": "Corestone Account Application.pdf",
            "transformPdfFields": false
        }
    }]
}

The customFields object needs to be located inside the inlineTemplate object. customFields对象需要位于inlineTemplate对象内。 Try this instead: 试试这个:

{
    "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": "dgilbert@firstallied.com",
                    "recipientId": "1",
                    "routingOrder": "1"
                }]
            }
        }],
        "document": {
            "documentId": "1",
            "name": "Corestone Account Application.pdf",
            "transformPdfFields": false
        }
    }]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM