UpdatePackage Package Name property
Tuesday, July 28, 2020 at 02:37pmHi,
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
Tuesday, July 28, 2020 at 02:52pmHi 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
Reply to: UpdatePackage Package Name property
Wednesday, July 29, 2020 at 09:36amThank you Duo. That worked to update the package name.