首页 文章

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

提问于
浏览
0

我在尝试使用 REST API 将完整的信封移至 DocuSign 中已删除的垃圾箱时遇到问题。我得到的错误是:

<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 调用:

地址 1_{。 5} /folders/recyclebin
Http-Method:PUT
Content-Type:application/xml
标头:{Content-Type = [6],Accept = [7],X-DocuSign-Authentication = [8],Context-Length = [9]}
有效负载:

<?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

    以下只是对我有用。确保您也没有 copy/pasting 隐藏或多余的字符:

    <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>
    
  • 0

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

    现在您有:

    <envelopeIds>EnvelopeId</envelopeIds>
    

    尝试更改为此:

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

相关问题