fevieiraleite

Setting ExpiryDate to null

0 votes
Hi, I'm having issues setting the expiration date to null. These are the functions I'm calling: EslClient eslClient = getEslClient(companyId); PackageId pkgId = new PackageId(packageId); DocumentPackage dp = eslClient.GetPackage(pkgId); dp.ExpiryDate = null; eslClient.UpdatePackage(pkgId, dp); After doing that, it doesn't update and continues with whatever the previous ExpiryDate was. If I call the same function but with a date value instead of null, it updates accordingly. Is there a different process I need to do in order to update the date to null? Thanks, Fernando

Reply to: Setting ExpiryDate to null

0 votes
So, this is a package that you sent out with an expiration date and then you decide to remove the expiration? I will check it out. What is the scenario in which you need to do this, if you don't mind my asking?

- Michael

Director, Partner and Developer Technologies, OneSpan

Facebook - Twitter - LinkedIn


Reply to: Setting ExpiryDate to null

0 votes
That's exactly it. A package that previously had an expiration date and now trying to set it to null. We give our users the option to edit and change the deadline of a package, so if they want to remove the deadline they can. That's the scenario. Fernando

Reply to: Setting ExpiryDate to null

0 votes
Hey Fernando, Like you said, I was unable to set the Expiration date to null and have it stick. I will push this to support to either file a bug or enhancement request for the SDK. As a workaround, you can use the REST API to reset this value to null. That can be done with the following code:
 string jsonString = "{\"due\":null}";
            string url = "https://sandbox.esignlive.com/api/packages/" + packageId;

            StringContent jsonContent = new StringContent(jsonString, Encoding.UTF8, "application/json");

            HttpClient myClient = new HttpClient();
            myClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", apiKey);
            myClient.DefaultRequestHeaders.Add("Accept", "application/json");

            var response = myClient.PutAsync(new Uri(url), jsonContent).Result;
If I find anything else out on doing this with the .NET SDK, I'll let you know.

- Michael

Director, Partner and Developer Technologies, OneSpan

Facebook - Twitter - LinkedIn


Reply to: Setting ExpiryDate to null

0 votes

Has the issue of setting the Expiration Date to null been fixed in the .Net SDK yet or is it scheduled to be fixed?  We are running 7.2 on Prem and still seeing this issue.  We have implemented the workaround but this requires some ugly code on our side.

 


Reply to:

0 votes

Hi Tricia,

 

This is caused by the Newtonsoft Null Value Handling which defaults to Ignore the whole SDK wide.

jsonSerializerSettings.NullValueHandling = NullValueHandling.Ignore;

And there's no additional annotation added on the due property, which I believe is still the case for the latest SDK.

If you preferred, I can raise a support ticket on your behalf and asking R&D team to fix this. However, for .NET SDK in particular, because the repository has been moved since version 11.33 and we've seen rebranding for some space and class names. An upgrade to the latest version could require code change at your side.

(Check my blog "Upgrade in .NET SDK" for more information)

 

Duo

 

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off