3

I am trying to query Docusign to get a status of a set of envelopes but I am getting the INVALID_REQUEST_PARAMETER error.

Here is the curl request I am making

curl -X PUT \
  https://na2.docusign.net/restapi/v2/accounts/XXXXX/envelopes/status \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-DocuSign-Authentication: { ... }' \
  -d '{
    "envelopeIds": [
        "SOME ENVELOPE ID",
        "ANOTHER ENVELOPE ID"
    ]
  }'

Here is the full error I am getting

{
    "errorCode": "INVALID_REQUEST_PARAMETER",
    "message": "The request contained at least one invalid parameter. Query parameter 'from_date' must be set to a valid DateTime, or 'envelope_ids' or 'transaction_ids' must be specified."
}

According to the documentation if I include an array of envelopeIds this should work. It looks very similar to the example they have on that documentation page.

I know the error messages says to use envelope_ids so I tried that and got the same error.

What am I doing wrong here?

Danwakeem
  • 328
  • 2
  • 17

3 Answers3

4

If you want to pass envelopeIds in the requestBody then in the URL you need to set a query parameter as envelope_ids=request_body, so your complete URI will look like below:

PUT /restapi/v2/accounts/<accountId>/envelopes/status?envelope_ids=request_body

then you can pass requestBody as below:

{
    "envelopeIds": ["SOME ENVELOPE ID",
    "ANOTHER ENVELOPE ID"]
}
Amit K Bist
  • 6,760
  • 1
  • 11
  • 26
  • Ahh that did it! Thank you, Amit! I didn't see that mentioned on the documentation page, how did you know to do that? – Danwakeem Jun 01 '18 at 14:07
  • Glad it worked! I work for DocuSign so I knew the answer – Amit K Bist Jun 01 '18 at 14:09
  • I gotcha. Well, I have one other quick question if you don't mind. Do you know how can include the individual recipient statuses in the response as well? In the example at the bottom of the doc page, it shows the response including that info but the response I get only includes the URI to retrieve the recipient info. – Danwakeem Jun 01 '18 at 14:28
  • Please create a new qs in new post with detailed explanation, and SO members will try to resolve it. – Amit K Bist Jun 01 '18 at 14:30
  • Yeah, I can do that! – Danwakeem Jun 01 '18 at 14:41
  • 1
    in case anyone stumbles upon this question with the same question here is the link to that question https://stackoverflow.com/questions/50646664/liststatus-endpoint-include-recipient-status-in-response – Danwakeem Jun 01 '18 at 15:25
0

Additionally you can also specify from_date as parameter as well

https://demo.docusign.net/restapi/v2/accounts/xxxxxx/envelopes/status?from_date=01/01/2019
Srinivasan Sekar
  • 2,049
  • 13
  • 22
0

Based on this doc, you must provide from_date or envelopeIds.

I cannot find an api to get all envelopes. This is a workaround:

https://demo.docusign.net/restapi/v2/accounts/xxxxxx/envelopes?from_date=1990-01-01&status=created
Thuy
  • 21
  • 3