如果在创建信封之前未提供收件人信息(签名者),是否无法使用自动锚标签?

时间:2019-06-21 20:44:36

标签: docusignapi

我正在使用嵌入式发送视图,以便用户可以根据自己的喜好完成DocuSign信封并发送。我仅在打开Embedded Sender View之前要做的是通过REST API将他们想要的文档上传到DocuSign,并且根本不设置任何收件人信息。一些上载文档具有锚标记,例如\ s1 \,\ s2 \等。对于收件人,签署者或抄送,当用户位于“嵌入式发件人视图”中时,用户会提供该签名。

我要做的是,当用户使用嵌入式发件人视图中提供的收件人(而不是预定义的签名者信息)移动到“标记”视图时,显示带有“签名”选项卡替换为锚标签的文档。

根据我的测试,如果在创建信封之前,信封定义中未提供签名者信息,似乎\ s1 \之类的锚标记将永远不会自动替换为“此处签名”选项卡。当我创建签名者对象并仅为其设置收件人ID时,它仅与\ s1 \一起使用。在我看来,必须先提供签名者,才能在创建信封之前使用自动放置功能。<​​/ p>

以下代码是我用于测试的代码。当我明确提供签名者时,“自动放置”功能仅与签名者1的锚标记一起使用,\ s1 \

        ...
        EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
        envelopeDefinition.setEmailSubject("Please sign this document");

        envelopeDefinition.setEmailBlurb("Something");

        Document doc1 = new Document();
        doc1.setDocumentBase64(new String(Base64.encode(DSHelper.readContent("Sign here.docx"))));
        doc1.setName("Sign Here Test");
        doc1.setFileExtension("docx");
        doc1.setDocumentId("1");

        // The order in the docs array determines the order in the envelope
        envelopeDefinition.setDocuments(Arrays.asList(doc1));

        //When I provided the signer explicitly, 
        //the AutoPlace feature works only with the anchor tag for Signer 1, \s1\\
        //Otherwise, it doesn't work at all
        Signer signer1 = new Signer();
        signer1.setRecipientId("1");  //This is mandatory 

        // Add the recipients to the envelope object
        Recipients recipients = new Recipients();
        recipients.setSigners(Arrays.asList(signer1));

        envelopeDefinition.setRecipients(recipients);        

        // create a signer recipient to sign the document, identified by name and email
        // We're setting the parameters via the object creation
        EnvelopesApi envelopeApi = new EnvelopesApi(this.apiClient);
        EnvelopeSummary results = envelopeApi.createEnvelope(this.getAccountId(), envelopeDefinition);

        //Generate Embedded Sender View URL....and so on
        ...

更新 我在“嵌入式​​发送视图”中提供了两个收件人,您可以看到下图,但是在“嵌入式​​发送视图”上单击“下一步”后,在标记视图中只有一个\ s1 \标签被替换为“在此签名”。

This is the Embedded Sending View using the above code

This is the document preview with above code's result on the Tagging View

有没有最好的方式来解决我的问题?

2 个答案:

答案 0 :(得分:1)

一种方法是使用模板。模板可以具有不包含收件人信息的占位符,但允许您为这些最终收件人使用标签。 您可以从模板创建信封,此时必须提供实际的收件人信息(姓名和电子邮件)。

答案 1 :(得分:1)

由于无论如何都是将信封创建为草稿,因此实际上不需要定义第二个签名者的姓名和电子邮件。发件人访问信封时,他们可以填写空的名称和电子邮件,并将其与集成已放置的标签关联。