DocuSign API使用XML将信封移动到回收站

时间:2016-03-24 16:50:05

标签: docusignapi

我在尝试使用REST API将已完成的信封移动到DocuSign中已删除的bin中时遇到问题。我得到的错误是:

<errorDetails xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <errorCode>INVALID_REQUEST_BODY</errorCode>
    <message>The request body is missing or improperly formatted. &lt;envelopeMoveRequest xmlns=''&gt; was not expected.</message>
</errorDetails>

以下是我的API调用:


地址:https://www.docusign.net/restapi/v2/accounts/ {accountid} / folders / recyclebin
Http-Method:PUT
内容类型:application / xml
标题:{Content-Type = [application / xml],Accept = [application / xml],X-DocuSign-Authentication = [{&#34; Username&#34;:&#34; username&#34; ,&#34;密码&#34;:&#34;密码&#34;,&#34; IntegratorKey&#34;:&#34;集成商密钥&#34;}],Context-Length = [31274]}
有效载荷:

<?xml version="1.0" encoding="UTF-8"?>
<envelopeMoveRequest xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <envelopeIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>EnvelopeId</d2p1:string>
  </envelopeIds>
  <fromFolderId/>
</envelopeMoveRequest>

我可以使用一些帮助来弄清楚我的API调用是如何错误的。

2 个答案:

答案 0 :(得分:0)

通常,DocuSign请求的相应XML(与等效的JSON相比)具有代表集合或数组的各个元素的额外节点。因此,在这种情况下,请尝试为每个envelopeId添加单个节点。

现在你有:

<envelopeIds>EnvelopeId</envelopeIds>

尝试更改为:

<envelopeIds>
    <envelopeId>EnvelopeId</envelopeId>
</envelopeIds>

答案 1 :(得分:0)

以下内容对我有用。确保您不会复制/粘贴任何隐藏或额外的字符:

<envelopeMoveRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.com/restapi">
  <envelopeIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>828a593e-10ae-4e54-bccc-66b5e66a5e81</d2p1:string>
  </envelopeIds>
</envelopeMoveRequest>