docusign 中的复选框 Rest API

checkbox in docusign Rest API

我在 envelopedefinition 中添加了 checkboxTab。 但仍然没有在文档中看到复选框。我究竟做错了什么?我想在 PDF 文件中添加 signHere、Initial 和 checkbox。

<envelopeDefinition xmlns="http://www.docusign.com/restapi">
   <emailSubject>cvCurrentPORSignatureRequest.EmailSubjectOut</emailSubject>
   <emailBlurb>cvCurrentPORSignatureRequest.EmailBodyOut</emailBlurb>
   <status>sent</status>
   <documents>lvMultiDocumentNamesXMLText</documents>
   <recipients>
       <signers>
           <signer>
               <recipientId>1</recipientId>
               <email>cvCurrentPORSignatureRequest.RecipientEmailAddress</email>
               <name>cvCurrentPORSignatureRequest.RecipientNameOut</name>
               <tabs>
                   <signHereTabs>...</signHereTabs>
                   <initialHereTabs>...</initialHereTabs>
                   <CheckBoxTabs>
                       <documentId>1</documentId>
                       <CheckBox>
                           <anchorString>ShipTo:</anchorString>
                           <anchorXOffset>1</anchorXOffset>
                           <anchorYOffset>2</anchorYOffset>
                           <anchorUnits>Inches</anchorUnits>
                           <xPosition>2</xPosition>
                           <yPosition>2</yPosition>
                           <name>CheckBox</name>
                           <DocumentID>1</DocumentID>
                           <Selected>true</Selected>
                           <pageNumber>2</pageNumber>
                           <Shared>false</Shared>
                           <tabLabel>CheckBoxLabel1</tabLabel>
                           <anchorIgnoreIfNotPresent>false</anchorIgnoreIfNotPresent>
                           <templateLocked>False</templateLocked>
                       </CheckBox>
                   </CheckBoxTabs>
               </tabs>
           </signer>
       </signers>
   </recipients>
</envelopeDefinition>

您的 XML 有一些问题。我还没有完全检查所有内容,但我至少可以看到您对复选框的定义有一个问题。现在你有:

<CheckBoxTabs>
<documentId>1</documentId>
<CheckBox>
   <anchorString>ShipTo:</anchorString>
   <anchorXOffset>1</anchorXOffset>
   ...

您需要将 <documentId> 元素移动到每个单独的复选框选项卡中,在本例中您只有一个。您还需要在 <checkboxTabs>checkbox 标签上正确设置大小写。

<checkboxTabs>
    <checkbox>
    <documentId>1</documentId>
    <anchorString>ShipTo:</anchorString>
    <anchorXOffset>1</anchorXOffset>
    ...

我只是 运行 一个测试,下面的测试非常适合我:

<envelopeDefinition>
    <emailSubject>DocuSign API - Checkbox test, no tab label</emailSubject>
    <status>sent</status>
    <documents>
        <document>
            <documentId>1</documentId>
            <name>test.pdf</name>
        </document>
    </documents>
    <recipients>
        <signers>
            <signer>
                <recipientId>1</recipientId>
                <email>john.doe@email.com</email>
                <name>John Doe</name>
                <tabs>
                    <checkboxTabs>
                        <checkbox>
                            <xPosition>100</xPosition>
                            <yPosition>100</yPosition>
                            <documentId>1</documentId>
                            <pageNumber>1</pageNumber>
                        </checkbox>
                    </checkboxTabs>
                </tabs>
            </signer>
        </signers>
    </recipients>
</envelopeDefinition>

除了 Ergin 的回答之外,我注意到您的偏移量很大(1 英寸和 2 英寸)。

要调试,请先删除所有偏移量。还要尽量减少锚文本,以防文档文本包含额外字符。例如,尝试使用 "Ship".

的锚文本

或者甚至更好,从没有锚文本开始,检查复选框是否符合您的预期,然后从那里构建。