如何使用DocuSign API预填充服务器模板上的选项卡 [英] How to pre-fill tabs on a server template with the 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>";
推荐答案
对不起,我发誓单数的textTab是需要在textTabs元素中使用,但看起来应该像这样被命名为 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屋!