AV

UpdatePackage Package Name property

0 votes

Hi,

Is there any recommended way to update the package name property after it was first created, through .NET SDK?

Tried calling the UpdatePackage method to update the package but it didn't update the package name property. Also calling the SendPackage after UpdatePackage step resulted in the following error. It looks is UpdatePackage is already changing the status of the package from Draft to In Progress.

Could not send the package. Exception: The remote server returned an error: (403) Forbidden. HTTP POST on URI https://sandbox.esignlive.com/api/packages/{[ackageid}. Optional details: {"messageKey":"error.forbidden.cannotEditDeletePkg","technical":"package: <packageid> cannot be edited.","message":"Cannot edit or delete package.","code":403,"name":"Access Denied"}

The message is also a bit misleading as "Cannot edit or delete package" seems better suited to be thrown when UpdatePackage  is called rather than SendPackage.


Reply to: UpdatePackage Package Name property

1 votes

Hi Anu,

 

As long as the package is still in DRAFT, use below code to update package name:
 

            string newName = "my new name";
            string packageId = "6WEP78TFX4iL9oOB0Vpm2zv-0YY=";
            DocumentPackage changePkgName = PackageBuilder.NewPackageNamed(newName).Build();

            eslClient.UpdatePackage(new PackageId(packageId), changePkgName);

 

Package can only be edited when the status is in DRAFT, therefore no need to invoke .SendPackage() until the package is ready to ship. Let me know if above code works for you.

 

Duo

 

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: UpdatePackage Package Name property

0 votes

Thank you Duo. That worked to update the package name.


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