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

API .NET 6 - Error with EnvelopesApi

Open Zibeug opened this issue 2 years ago • 7 comments

Hi all,

I mad a prototype in Console .NET 6 with the DocuSign.Esign.dll. Everything working great but I just start implementation of the prototype in the definitive project and I got each time a error when I use EnvelopesApi.

The error is : One or more errors occurred. (Error setting value to 'StatusChangedDateTime' on 'DocuSign.eSign.Model.Envelope'.)

I use the last version of Nuget package.

My init code :

`

        _client = new ApiClient(_apiUrl);

        _integrationKey = integrationKey;

        _userId = userId;

        _authUrl = authUrl;

        _accountId = accountId;

        _templateId = templateId;

        _rsaKey = File.ReadAllText(rsaKey);

        _oAuthToken = _client.RequestJWTUserToken(_integrationKey, _userId, _authUrl, Encoding.UTF8.GetBytes(_rsaKey), 1, _scopes);

        _envelopesApi = new EnvelopesApi(_client);
        _templatesApi = new TemplatesApi(_client);`

Any idea why I got this change ?

Thank you

Cheers,

Zibeug

Zibeug avatar Aug 16 '22 14:08 Zibeug

Hello Zibeug,

I suppose then you're using the DocuSign.Esign.dll last version 5.12.0 I tried to create an envelope using it without issue. Could you please provide a stack trace of this test and provide matching API logs (https://support.docusign.com/guides/ndse-user-guide-api-request-logging) If there is any sensitive datas, don't hesitate to rather open a Docusign support case in order to follow up this issue

sylvainleb376 avatar Aug 17 '22 09:08 sylvainleb376

11_OK_GetEnvelope.txt

There is my test. It's look very strange because the request return 200 OK but always the same error.

One time on StatusDateTime and for this request : Catch error:One or more errors occurred. (Error setting value to 'CreatedDateTime' on 'DocuSign.eSign.Model.Envelope'.)

Zibeug avatar Aug 17 '22 12:08 Zibeug

It's possible the error appears in upstream, before the API request is sent and reaches Docusign server. It would explain why there is no error inside API logs. With this messgage error, it seems to be a problem with an inconsistent value being used with the field CreatedDateTime. Could you please provide the stack trace with full details of the values being used?

sylvainleb376 avatar Aug 17 '22 13:08 sylvainleb376

I think the values are not the problem because I made an another project with same values and It's working great. (CopyPaste)

It's an API made by another company and I'm working on DocuSignPart. But when I make my own solution with a API project that work great.

Maybe something with the timezone of the API ?

Zibeug avatar Aug 18 '22 06:08 Zibeug

I think I've found the problem after a long time of debug. I start my service in a thread. Outside of this thread everything is working great. Inside the thread I got the error.

Zibeug avatar Aug 18 '22 07:08 Zibeug

That's a good news indeed. It could be interesting anyway to understand why it didn't work using a thread. We would need then to have a stack trace/concrete elements in order to investigate. Let me know if you wanted to continue the analysis in this way...

sylvainleb376 avatar Aug 18 '22 08:08 sylvainleb376

I found the problem It's during the deserialize of JsonConvert. I tried to put a random string and I got a return from ApiClient model. After downloaded your code I changed all Model with Date in string to DateTime and the error is gone. Maybe you can change it for the new version ! :-D

Zibeug avatar Aug 19 '22 13:08 Zibeug