简体   繁体   English

DocuSign API-使用textCustomField创建信封

[英]DocuSign API - Creating an envelope with a textCustomField

I am trying to create a draft envelope via DocuSign API, with a textCustomField, but I can't get it to work, suspect it's the positioning of the textCustomField tags in the Request - and need some help to guide me on this. 我正在尝试通过DocuSign API使用textCustomField创建一个信封草稿,但我无法使其正常工作,怀疑它是Request中的textCustomField标签的位置-并需要一些帮助来指导我。 Here is the current Request XML: 这是当前的请求XML:

<ns1:envelopeDefinition xmlns:ns1="http://www.docusign.com/restapi">
    <ns1:emailSubject>Test</ns1:emailSubject>
    <ns1:status>created</ns1:status>
    <ns1:documents>
        <ns1:document>
            <ns1:name>TestDocument</ns1:name>
            <ns1:documentId>1</ns1:documentId>
            <ns1:documentBase64>U09XIElE==</ns1:documentBase64>
            <ns1:fileExtension>txt</ns1:fileExtension>
        </ns1:document>
    </ns1:documents>
    <ns1:recipients>
        <ns1:signers>
            <ns1:signer>
                <ns1:routingOrder>1</ns1:routingOrder>
                <ns1:recipientId>1</ns1:recipientId>
                <ns1:name>John Smith</ns1:name>
                <ns1:email>nobody@nobody.com</ns1:email>
                <ns1:tabs>
                    <ns1:approveTabs>
                        <ns1:approve>
                            <documentId>1</documentId>
                            <pageNumber>1</pageNumber>
                            <xPosition>70</xPosition>
                            <yPosition>120</yPosition>
                            <height>30</height>
                            <width>50</width>
                        </ns1:approve>
                    </ns1:approveTabs>
                    <ns1:declineTabs>
                        <ns1:decline>
                            <documentId>1</documentId>
                            <pageNumber>1</pageNumber>
                            <xPosition>130</xPosition>
                            <yPosition>120</yPosition>
                            <height>30</height>
                            <width>50</width>
                        </ns1:decline>
                    </ns1:declineTabs>
                </ns1:tabs>
                <ns1:customFields>
                    <ns1:textCustomFields>
                        <ns1:textCustomField>
                            <ns1:configurationType />
                            <ns1:fieldId>1</ns1:fieldId>
                            <ns1:name>ID</ns1:name>
                            <ns1:required>true</ns1:required>
                            <ns1:show>false</ns1:show>
                            <ns1:value>12345</ns1:value>
                        </ns1:textCustomField>
                    </ns1:textCustomFields>
                </ns1:customFields>                 
            </ns1:signer> 
        </ns1:signers>
    </ns1:recipients>
</ns1:envelopeDefinition>

Thank you! 谢谢!

I got it to work with the following Request body. 我将其与以下Request主体一起使用。 The fix was to move the CustomFields out of the 'recipients' tag and placing it as a sibling to 'recipients' tag. 解决方法是将CustomFields从“ recipients”标签移出,并将其作为“ recipients”标签的兄弟。

<ns1:envelopeDefinition xmlns:ns1="http://www.docusign.com/restapi">
    <ns1:emailSubject>Test</ns1:emailSubject>
    <ns1:status>created</ns1:status>
    <ns1:documents>
        <ns1:document>
            <ns1:name>TestDocument</ns1:name>
            <ns1:documentId>1</ns1:documentId>
            <ns1:documentBase64>U09XIElE==</ns1:documentBase64>
            <ns1:fileExtension>txt</ns1:fileExtension>
        </ns1:document>
    </ns1:documents>
    <ns1:recipients>
        <ns1:signers>
            <ns1:signer>
                <ns1:routingOrder>1</ns1:routingOrder>
                <ns1:recipientId>1</ns1:recipientId>
                <ns1:name>John Smith</ns1:name>
                <ns1:email>nobody@nobody.com</ns1:email>
                <ns1:tabs>
                    <ns1:approveTabs>
                        <ns1:approve>
                            <documentId>1</documentId>
                            <pageNumber>1</pageNumber>
                            <xPosition>70</xPosition>
                            <yPosition>120</yPosition>
                            <height>30</height>
                            <width>50</width>
                        </ns1:approve>
                    </ns1:approveTabs>
                    <ns1:declineTabs>
                        <ns1:decline>
                            <documentId>1</documentId>
                            <pageNumber>1</pageNumber>
                            <xPosition>130</xPosition>
                            <yPosition>120</yPosition>
                            <height>30</height>
                            <width>50</width>
                        </ns1:decline>
                    </ns1:declineTabs>
                </ns1:tabs>             
            </ns1:signer> 
        </ns1:signers>
    </ns1:recipients>
    <ns1:customFields>
        <ns1:textCustomFields>
            <ns1:textCustomField>
                <ns1:configurationType />
                <ns1:fieldId>1</ns1:fieldId>
                <ns1:name>ID</ns1:name>
                <ns1:required>true</ns1:required>
                <ns1:show>false</ns1:show>
                <ns1:value>12345</ns1:value>
            </ns1:textCustomField>
        </ns1:textCustomFields>
    </ns1:customFields>  
</ns1:envelopeDefinition>

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

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