如何使用 DocuSign API 预填充服务器模板上的选项卡 [英] How to pre-fill tabs on a server template with the DocuSign API

查看:22
本文介绍了如何使用 DocuSign API 预填充服务器模板上的选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在服务器模板上填写选项卡?如果是这样,那么正确的 XML 格式是什么?我已经尝试过 DocuSign 论坛上帖子中建议的解决方案,但该解决方案不起作用.我已阅读文档,但不清楚格式应该是什么,我似乎找不到任何示例.这就是我现在所拥有的,它不工作它返回和错误 400:XML 请求与预期格式不匹配.有谁知道正确的格式吗?

Is it possible to fill in a tab on a server template? If so what would be the correct XML format to do that? I have tried the suggested solution from the post on the DocuSign forum, that solution did not work. I have read the documentation but it is unclear what the format should be and I can't seem to find any examples. This is what I have now and it is not working it returns and error 400: The XML request does not match the expected format. Does anyone know for sure the correct format?

* * 更新 ****我使用 JSON 到 XML 转换器来获得正确的 xml 格式.以下内容被服务器接受但不更新服务器模板.

* * Update **** I used a JSON to XML converter to get the correct xml format. The following is accepted by the server but does not update the server template.

String requestBody = "<envelopeDefinition xmlns="http://www.docusign.com/restapi">" +
    "<accountId>" + accountId + "</accountId>" +
    "<status>sent</status>" +
    "<emailSubject>" + emailSubject + "</emailSubject>" +
    "<emailBlurb>" + emailBlurb + "</emailBlurb>" +
    "<templateId>81bcad0d-91ed-4616-****-************</templateId>" +
    "<templateRoles>" +
       "<templateRole>" +
          "<email>" + emailaddr4[0] + "</email>" +
          "<name>" + names[0] + "</name>" + 
          "<roleName>Student</roleName>" +
          "<tabs>" +
             "<textTabs>" +
                "<textTab>" +
                     "<tabLabel>StudentID</tabLabel>" +
                     "<value>" + student_id + "</value>" +
                     "<documentId>1</documentId>" +
                     "<pageNumber>1</pageNumber>" +
                "</textTab>"
              "</textTabs>" +
           "</tabs>" + 
     "</templateRole>" +
  "</templateRoles>" + 
"</envelopeDefinition>";

推荐答案

抱歉,我可以发誓在 textTabs 元素中需要单数 textTab,但它看起来应该只是命名为 text 代替.这是一个完整的 XML 请求正文,可以使用

Sorry, I could have sworn that the singular textTab was needed inside of the textTabs element, but it looks like this supposed to be named just text instead. Here is a full XML request body that works

<envelopeDefinition xmlns="http://www.docusign.com/restapi">
   <accountId>221765</accountId>
   <status>sent</status>
   <emailSubject>API Call for sending signature request from template</emailSubject>
   <emailBlurb>This comes from Java</emailBlurb>
   <templateId>DD92AF6F-3B87-435C-A652-A7451AFE758E</templateId>
   <templateRoles>
      <templateRole>
         <email>email@docusign.com</email>
         <name>John Doe</name>
         <roleName>Signer1</roleName>
         <tabs>
            <textTabs>
               <text>
                  <tabLabel>DataField1</tabLabel>
                  <value>Initial Data Goes Here</value>
               </text>
            </textTabs>
         </tabs>
      </templateRole>
   </templateRoles>
</envelopeDefinition>

这篇关于如何使用 DocuSign API 预填充服务器模板上的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆