0

I am experiencing the exact same error as described in question INVALID_REQUEST_PARAMETER on listStatus

However, unlike that OP, I am not using the REST API directly, but am using the C# SDK from https://www.nuget.org/packages/DocuSign.eSign.dll

It would appear that the SDK wrapper is not including the querystring parameters as described by the answer in the above linked post. Is there a workaround other than waiting for DocuSign to fix their SDK -- and where is the appropriate place to submit a bug for their SDK?

Per comment, here is a code sample:

var envelopesApi = new DocuSign.eSign.Api.EnvelopesApi();
var envelopeIds = incentivesWithPendingOffers.Select(i => i.new_OfferLetterEnvelopeID).ToList();
var envelopeInfos = await envelopesApi.ListStatusAsync(_tokenAccountId, new EnvelopeIdsRequest(envelopeIds), null);

Running fiddler to capture the outbound REST call being made by the SDK, I see this:

PUT https://demo.docusign.net/restapi/v2/accounts/[ REDACTED ]/envelopes/status HTTP/1.1
X-DocuSign-SDK: C#
Authorization: Bearer [ REDACTED ]
Accept: application/json
User-Agent: Swagger-Codegen/2.1.0/csharp
Content-Type: application/json
Host: demo.docusign.net
Content-Length: 96
Accept-Encoding: gzip, deflate

{"envelope_ids":["1d324bac-60ea-44b5-9b60-a5de14af3beb","5431d728-4918-4218-9c12-765b1c914724"]}

which returns the following response (which the SDK turns into a .NET Exception):

HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Content-Length: 238
Content-Type: application/json; charset=utf-8
X-DocuSign-TraceToken: [ REDACTED ]
Date: Wed, 01 Aug 2018 20:43:58 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains

{
  "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."
}
willman
  • 1,191
  • 1
  • 7
  • 20
  • Can you provide a code sample that results in the error? Issues with the C# SDK can be submitted on GitHub: https://github.com/docusign/docusign-csharp-client/issues – Drew Aug 01 '18 at 22:07
  • See Edits, I added the c# code snippet I am using, plus the the request and response I captured in Fiddler. As can be seen by what is captured, the issue appears to be identical to the aforementioned post https://stackoverflow.com/questions/50644862/invalid-request-parameter-on-liststatus, but unlike that post, I have no control to add the additional querystring parameter because the SDK is making this call inside its black box. – willman Aug 02 '18 at 13:45

2 Answers2

1

When the previous answer was written, the SDK didn't support putting the list of envelope IDs in the call body. As of client version 3.1.3 this is now available.

        List<string> envelopeIds = new List<string>();
        envelopeIds.Add("2b62eb63-784a-4228-be02-876762ea6661");
        envelopeIds.Add("406a9a15-c8e9-4227-8dd2-bd9a5318d4fd");

        EnvelopeIdsRequest envelopeIdsRequest = new EnvelopeIdsRequest();
        envelopeIdsRequest.EnvelopeIds = envelopeIds;

        ListStatusOptions options =  new ListStatusOptions();
        options.envelopeIds = "request_body"; //the Options value controls the query string parameter

        EnvelopesInformation envelopesInfo = envelopesApi.ListStatus(accountId, envelopeIdsRequest, options);
Drew
  • 4,922
  • 1
  • 6
  • 17
0

I wasn't able to use the envelope_ids=request_body parameter via the SDK, but I was able to get status of several envelopes at once. This would be a viable workaround as long as you're not requesting so many envelope IDs that the URL overflows.

        EnvelopesApi.ListStatusChangesOptions lsco = new EnvelopesApi.ListStatusChangesOptions
        {
            envelopeIds = "fdd1122a-9c1b-4eef-9e24-25bb2cdf2eb2, fe1cb500-6a4c-4328-bf24-55806434852f, 5b1d3828-f8cd-4bba-87f0-538cb920db96"
        };

        EnvelopesInformation listStatusChanges = envelopesApi.ListStatusChanges(accountId, lsco);

results in an API call to

GET https://demo.docusign.net/restapi/v2/accounts/{{accountId}}/envelopes?envelope_ids=fdd1122a-9c1b-4eef-9e24-25bb2cdf2eb2%2C%20fe1cb500-6a4c-4328-bf24-55806434852f%2C%205b1d3828-f8cd-4bba-87f0-538cb920db96

Drew
  • 4,922
  • 1
  • 6
  • 17