docusign-esign-node-client icon indicating copy to clipboard operation
docusign-esign-node-client copied to clipboard

envelopesApi.listStatus fails with 400

Open IAmVisco opened this issue 5 years ago • 4 comments

Calling listStatus() method with only fromDate option which is valid according to the docs always fails with HTTP 400.

const result = await envelopesApi.listStatus(this.accountId, {
  fromDate,
})

Further investigation showed that request sent is failing with "INVALID_REQUEST_BODY", "The request body is missing or improperly formatted." error which originates from sending an empty request body. Sending {} as the request body contents with Postman resolves the issue but there is no way to send empty body using library.

Fun fact: setting envelopeIdsRequest to {} causes API to throw NullReferenceException.

IAmVisco avatar May 26 '20 15:05 IAmVisco

Hi @IAmVisco Could you please verify your SDK version? Also could you verify the parameters passed to this call, ensuring that fromDate is a correct Date. Simply stating

envelopesApi.listStatusChanges(accountId, {
  fromDate: new Date("10-10-2019"),
})

Successfully retrieves a list of status changes in the latest version on master

As for "envelopeIdsRequest" it is not listed as a parameter for this SDK. I would need to see an example of this code.

acooper4960 avatar May 27 '20 06:05 acooper4960

@acooper4960 not listStatusChanges but listStatus. My code sample left from testing, updated it, listStatusChanges works for me as well. I pass moment().toISOString() and the version has to be latest from master as well.

IAmVisco avatar May 27 '20 06:05 IAmVisco

@IAmVisco it does appear that this endpoint does not behave as mentioned in the documentation. I have created an internal ticket to address this.

It appears envelopeIdsRequest and furthermore envelopeIds are not optional even though they are explicitly stated as such in the docs.

acooper4960 avatar May 27 '20 07:05 acooper4960

the documentation for listStatus shows a PUT request. I changed my local package code to a GET request and it worked.

I put in a pull request https://github.com/docusign/docusign-node-client/pull/231

johnharnett avatar Nov 02 '20 13:11 johnharnett