Docusign:文档中的动态字段未替换

huangapple go评论56阅读模式
英文:

Docusign: Dynamic Fields not replaced in the document

问题

{
    "emailSubject": "测试邮件",
    "templateId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "templateRoles": [
        {
            "email": "xxxe@gmail.com",
            "name": "xxxxx",
            "roleName": "签署者",
            "tabs": {
                "textTabs": [
                    {
                        "tabLabel": "姓名",
                        "anchorString": "{{Name}}",
                        "value": "约翰·多"
                    },
                    {
                        "tabLabel": "面试日期",
                        "anchorString": "{{InterviewDate}}",
                        "value": "2023年06月15日"
                    },
                    {
                        "tabLabel": "面试时间",
                        "anchorString": "{{InterviewTime}}",
                        "value": "上午10:00"
                    },
                    {
                        "tabLabel": "面试地点",
                        "anchorString": "{{InterviewLocation}}",
                        "value": "123 Main St"
                    }
                ]
            }
        }
    ],
    "status": "已发送"
}

示例文档文件

我正在使用DocuSign发送候选人的邮件。使用模板文档进行发送。
但是,在生成的API响应中,动态值没有被替换,而是重叠在一起。

查看附带的图片(输出)


<details>
<summary>英文:</summary>

    `{
        &quot;emailSubject&quot;: &quot;Test Mail&quot;,
        &quot;templateId&quot;: &quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,
        &quot;templateRoles&quot;: [
        {
          &quot;email&quot;: &quot;xxxe@gmail.com&quot;,
          &quot;name&quot;: &quot;xxxxx&quot;,
          &quot;roleName&quot;: &quot;Signer&quot;,
          &quot;tabs&quot;: {
            &quot;textTabs&quot;: [
              {
                &quot;tabLabel&quot;: &quot;Name&quot;,
                &quot;anchorString&quot;: &quot;{{Name}}&quot;,
                &quot;value&quot;: &quot;John Doe&quot;
              },
              {
                &quot;tabLabel&quot;: &quot;InterviewDate&quot;,
                &quot;anchorString&quot;: &quot;{{InterviewDate}}&quot;,
                &quot;value&quot;: &quot;2023-06-15&quot;
              },
              {
                &quot;tabLabel&quot;: &quot;InterviewTime&quot;,
                &quot;anchorString&quot;: &quot;{{InterviewTime}}&quot;,
                &quot;value&quot;: &quot;10:00 AM&quot;
              },
              {
                &quot;tabLabel&quot;: &quot;InterviewLocation&quot;,
                &quot;anchorString&quot;: &quot;{{InterviewLocation}}&quot;,
                &quot;value&quot;: &quot;123 Main St&quot;
              }
            ]
          }
        }
      ],
      &quot;status&quot;: &quot;sent&quot;
    }`

[Sample Doc File][1]

I am using docusign to send candidate a mail. The send with the template document.
But when make the api response the dynamic value&#39;s are not replaced, it&#39;s overlapped.

[see attached image (output)][2]


  [1]: https://i.stack.imgur.com/2uakr.png
  [2]: https://i.stack.imgur.com/Hnnzt.png

</details>


# 答案1
**得分**: 0

你在这里混淆了两个事情。

如果你正在尝试使用[文档生成][1],像这样的{{字段}}应该在一个Word文档(.docx)中,并添加到一个模板中。然后,您可以进行不同的API调用来更新从此模板生成的信封中的值。在[代码示例][2]中查看更多详细信息。

现在,另一种选项是你只想要文本标签并设置它们的值。那是不同的。在这种情况下,你不使用文档生成,根本不使用双花括号,你可以使用任何你想要的文档,并进行完全不同的API调用来更新标签的值。
如果这是你想要做的事情 - 请遵循[这个代码示例][3]。

[1]: https://www.youtube.com/watch?v=O3IrSP2pkjM
[2]: https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-email-document-generation/
[3]: https://developers.docusign.com/docs/esign-rest-api/how-to/set-template-tab-values/

<details>
<summary>英文:</summary>

You are confusing two things here.

If you are trying to use [document generation][1], the {{fields}} like this should be in a Word document (.docx) and then added to a template. Then you make a different API call to update their values in the envelope generated from this template. See more details in [the code example][2]

Now, another option is that you just want to have text tabs and set their value. That&#39;s different. In that case you don&#39;t use document generation, you don&#39;t use double curly brackets at all, you can use any document(s) you want and you make an entirely different API call to update tabs&#39; values. 
If that&#39;s what you want to do - follow [this code exmaple][3].


  [1]: https://www.youtube.com/watch?v=O3IrSP2pkjM
  [2]: https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-email-document-generation/
  [3]: https://developers.docusign.com/docs/esign-rest-api/how-to/set-template-tab-values/

</details>



huangapple
  • 本文由 发表于 2023年6月12日 20:50:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76456846.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定