0
votes

I'm having issues trying to move a completed envelope into the deleted bin in DocuSign using the REST API. The error I am getting is:

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

Here is the API call I make:


Address: https://www.docusign.net/restapi/v2/accounts/{accountid}/folders/recyclebin
Http-Method: PUT
Content-Type: application/xml
Headers: {Content-Type=[application/xml], Accept=[application/xml], X-DocuSign-Authentication=[{"Username":"username","Password":"password","IntegratorKey":"integrator key"}], Context-Length=[31274]}
Payload:

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

I could use some help figuring out how my API call is wrong.

2

2 Answers

0
votes

The following just worked for me. Make sure you are not copy/pasting any hidden or extra characters as well:

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

Usually the corresponding XML for DocuSign requests (when compared to the JSON equivalent) has extra nodes representing individual elements of a collection or array. So in this case try adding an individual node for each envelopeId.

Right now you have:

<envelopeIds>EnvelopeId</envelopeIds>

Try changing to this:

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