Michael_S_Smith | Posts: 66

Package Delete/Recreate vs Update

0 votes

I was a bit surprised to find the PackageService.updatePackage only updates package-level properties and does not deal with the complexities of adding/removing/updating the signers and documents. Given that, I am wondering if it would be advisable to simply delete the package and recreate it - seems much easier. Am I missing something? Is there a good reason not to do this?


Duo_Liang | Posts: 3776

Reply to: Package Delete/Recreate vs Update

0 votes

Hi Michael,

 

Codewise, yes, it would be much easier to delete and create a new package than handling signer and document level updates. However it wouldn't always the case that it has an edge over partially updating a package - imagine you have ten documents but you only want to make minor changes like to update few fields, re-uploading ten documents could be time consuming but it's much quicker to only update the metadata. In other cases, if the user wants to delete existing documents and upload completely different ones, it's easier to simply delete and recreate the package. So depending on your specific use cases, both approach has its pros and cons.

 

Duo


Michael_S_Smith | Posts: 66

Reply to: Package Delete/Recreate vs Update

0 votes

Sorry to bring this up again, but I was told by legal that we pay for each *created* package rather than each completed package. I dont know if this is really true, but if true, then we need to figure out how to update packages rather than delete them and recreate them. This has turned out to be extremely difficult.

So first - since I dont completely trust the answer I got from legal - are customers charged for package creation or package completion? It would solve a big problem for me if I could simply delete/recreate. Our customer wants to be able to make wholesale changes to packages - change signers, add/remove documents etc. 

Second - while my update code seems to work (the package looks as I would expect), when I make a subsequent call to eslClient.getPackage for that packageId I get the following error:

[403, Forbidden]. Optional details: {"technical":"Cannot access a package that can be edited

So after I do my update, how do I signify the package is no longer editable? Will the system resend the notification emails? I tried to call 'sendPackage' after my updates but I get a similar error.

Thanks


Duo_Liang | Posts: 3776

Reply to: Package Delete/Recreate vs Update

0 votes

Hi Michael,

 

"are customers charged for package creation or package completion?"

I was told this could vary to different clients, so you may want to reach out to your Customer Success Representative for further discussion. (I assumed what we discussed above is only from the coding standpoint)

 

"get the following error: [403, Forbidden]. Optional details: {"technical":"Cannot access a package that can be edited"

Is this the whole error message? Can you also share the package ID and I can help you check if the package is in SENT status.

On top of that:

- you should always be able to invoke the eslClient.getPackage() function no matter if the package is editable, so this 403 error is not expected to me

- after you resent the package, OneSpan Sign system will resend notifications to signers who hasn't finished signing.

-a typical package updating snippet looks like below:

        PackageId packageId = new PackageId("-Trb4iS872rETLbNIPWLXeKavY4=");
        eslClient.changePackageStatusToDraft(packageId);        //sent to draft        
        
        //update signers
        //....
        
        //update documents
        //....
                
        eslClient.sendPackage(packageId);                //draft to sent

 

Duo


Michael_S_Smith | Posts: 66

Reply to: Package Delete/Recreate vs Update

0 votes

Thanks this was helpful. From your reply I was able to gather in need to invoke a SEND after doing my update operations and my code now works. You are right about getPackage - the problem was actually later in my code due to the fact there was no signingUrl - after the SEND this problem was fixed.

Thanks


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