peterzog | Posts: 109

Set and Extend Package Expiration

0 votes

Hi Duo,

Do you have an example of how we can use the APEX SDK to set the expiry date?

Also, looking for a method to extend the time for an expired package?

Thanks!

Peter


Duo_Liang | Posts: 3776

Reply to: Set and Extend Package Expiration

0 votes

Hi Peter,

 

In order to specify expiry date, you'd set the "due" field of the Package_x:

    Package_x pkg = new Package_x();
    pkg.name = 'Example Package Using APEX SDK1 - ' + Datetime.now().format();

    pkg.due = Datetime.newInstance(2022, 7, 1, 12, 30, 2)

    ......
         
    String packageId = sdk.createPackage(pkg);

 

If to extend an expired transaction, it normally requires to reset the due date and resend the transaction like below:

 

Package_x pkg = sdk.getPackage(packageId);

pkg.status = PackageStatus.DRAFT;

pkg.due = Datetime.newInstance(2022, 7, 1, 12, 30, 2)

sdk.updatePackage(pkg , packageId);

 

pkg.status = PackageStatus.SENT;

sdk.updatePackage(pkg , packageId);

 

Let me know if these codes work for you.

 

Duo

 


peterzog | Posts: 109

Reply to: Set and Extend Package Expiration

0 votes

Perfect. After the package expires, does the token in the original URL also expire thereby requiring us to generate a new token and send them a new URL? Or can they still use the old URL?


Duo_Liang | Posts: 3776

Reply to: Set and Extend Package Expiration

0 votes

Do you mean the signing URL(authenticated with "?loginToken=")? From what I understood, this token will only be changed when a signer profile get changed, e.g. first/last name, email updated (but I am not sure on this point). But it will be safer to always regenerate a new signing URL when you extend the expiry date.

 

Duo


peterzog | Posts: 109

Reply to: Set and Extend Package Expiration

0 votes

Very helpful. 
 

One more related question about expiration. I noticed on our OSS portal settings says the maximum number of expiration days is 3. Does that govern what we can do with the above? Or does the per package due date setting override? 


Duo_Liang | Posts: 3776

Reply to: Set and Extend Package Expiration

0 votes

Hi Peter,

 

The due date is limited by this package setting:
settings > ceremony > maximumRemainingDays : 210

 

However I am still wondering why it said 3 days for your account. If it's a sandbox account, can you share the account email to [email protected] so that I can do a quick check for your account settings?

 

Duo


peterzog | Posts: 109

Reply to: Set and Extend Package Expiration

0 votes

capture

 

Sandbox shows 0 but our production account shows 3. Is this a hard limit for all packages? 


Duo_Liang | Posts: 3776

Reply to: Set and Extend Package Expiration

0 votes

I see. The settings from the screenshot is at the account level, but you can still override it at the package level at:

settings > ceremony > maximumRemainingDays : 210

However it's not part of the Apex SDK modelling, if you want to apply this setting, we may need to modify and extend the Apex class a bit.

 

Duo


peterzog | Posts: 109

Reply to: Set and Extend Package Expiration

0 votes

Ok, I just didn't want to get to production and it would fail because the account level limit rules over all.


Duo_Liang | Posts: 3776

Reply to: Set and Extend Package Expiration

0 votes

Hi Peter,

 

Sorry about the information above about "it's possible to override the maximum expiry date at package level". After some further tests, I found even if the "maximumRemainingDays" has been extended per transaction, both the API and UI still didn't take the value, so kind of the account level limit rules over all.

Given this background, is it possible for your production account to remove or increase the maximum expiry limitation?

On top of it, because your production account has this time-based expiry enabled, depending on whether your APEX code want to leverage the feature, you may need to set "due" field and disable the feature by "defaultTimeBasedExpiry": false (this requires to extend the APEX class) to have the behavior falls back to your sandbox experience.

 

Duo


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