需要有关如何使用docusign api,c#,xml
创建模板的帮助我收到一条错误消息 - '(404)Bad Request'
url = https://demo.docusign.net/restapi/v2/accounts/ {......} / templates
string requestBody =
"<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
"<emailSubject>Please sign this Document</emailSubject>" +
"<status>sent</status>" +
// add document(s)
"<documents>" +
"<document>" +
"<documentId>1</documentId>" +
"<name>document.pdf</name>" +
"</document>" +
"</documents>" +
// add recipient(s)
"<recipients>" +
"<signers>" +
"<signer>" +
"<recipientId>1</recipientId>" +
"<email>ssmith@hotmail.com</email>" +
"<name>Som Smith</name>" +
"<roleName>Signer</roleName>" +
"<tabs>" +
"<signHereTabs>" +
"<signHere>" +
"<xPosition>70</xPosition>" +
"<yPosition>560</yPosition>" +
"<documentId>1</documentId>" +
"<pageNumber>2</pageNumber>" +
"</signHere>" +
"</signHereTabs>" +
"</tabs>" +
"</signer>" +
"</signers>" +
"</recipients>" +
"<envelopeTemplateDefinition>" +
"<name>TestTemplate</name>" +
"<owner>" +
"<email>ssmith@hotmail.com</email>" +
"</owner>" +
"</envelopeTemplateDefinition>" +
"</envelopeDefinition>";
我收到的响应错误消息
<errorDetails xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">errorCode>UNSPECIFIED_ERROR</errorCode><message>There is an error in XML document (1, 2).</message></errorDetails>
非常感谢
答案 0 :(得分:0)
您使用的请求正文用于从现有模板发送签名请求,而不是用于在您的帐户中创建新模板。要通过API创建新模板,您需要一个不同的请求体。您可以使用自动生成的REST API帮助页面:
https://www.docusign.net/restapi/help
向下滚动并找到POST
调用以创建模板,您可以看到示例请求正文。样本很大,因为它包含了可能进入该主体的所有可能的东西,但是您将知道如何构造您的JSON(或XML)。
另请参阅创建模板的API调用的相应文档: