FredericDH | Posts: 51

Unable to create a package from a template

0 votes
Hi! (I am reposting as for some reason my post was deleted) I a not able to create a package from a template as I receive the following error message : Could not create a package from template. Exception: The remote server returned an error: (500) Internal Server Error. HTTP POST on URI https://sandbox.esignlive.com/api/packages/ZjcknGPw_h8Z_0EwIaIh3810FtI=/clone. Optional details: {"messageKey":"error.internal.default","technical":"EsepCommand failed and no fallback available.","message":"Unexpected error. We apologize for any inconvenience this may have caused you, please try again. If the problem persists, please contact our support team.","code":500,"name":"Unhandled Server Error"}

Approved Answer
harishaidary | Posts: 1812

Reply to: Unable to create a package from a template

0 votes
Frederic, It seems like the two templates in your account seems to be corrupted somehow, as I was not able to create any package from them. I gave it a go with a new template (created from the SDK) and I was successfully able to create a new package from it. At this point, the only way to tell what is wrong with your two current templates would be by retrieving logs from our system. However, this might take a while (at least a couple of weeks) since our maintenance team is overloaded at the moment. The only suggestion I would have for you right now is to create new templates through the SDK or UI. Sorry for the inconvenience.

harishaidary | Posts: 1812

Reply to: Unable to create a package from a template

0 votes
Hi Frederic, Would you be able to share the DocumentPackage object code that you are passing when creating your template? Also, do you mind if I run some tests on your account?

FredericDH | Posts: 51

Reply to: Unable to create a package from a template

0 votes
Haris, Sure, I can definitely share my code. I won't put everything as it's pretty long but i'll try to put the most relevant code that I use to create a package. Also, feel free to do some testing on my account. As we haven't released our software to our customers, it's really a testing account at this point : DocumentPackage package = PackageBuilder .NewPackageNamed(packageName) .WithSettings( DocumentPackageSettingsBuilder.NewDocumentPackageSettings()) .ExpiresOn(DateTime.Today.AddDays(daysBeforeExpiration)) .WithAttributes(packageAttributes) .Build(); if (documentsList != null && recipients != null) { documentPackage.Signers = recipients; foreach (Document doc in documentsList) { documentPackage.Documents.Add( doc); } } eslClient = new EslClient(apiKey, eSignLiveUrl); PackageService templatesApi = eslClient.PackageService; Page allTemplates = templatesApi.GetTemplates( new PageRequest(1, 100)); // This will retrieve the first 100 templates in the configured // account // If the template is not found, we could loop the next 100 // templates until we find it or run out of templates. // I believe 100 should be enough DocumentPackage templateResult = allTemplates?.FirstOrDefault(d => d.Name.Equals( templateName, StringComparison.InvariantCultureIgnoreCase)); packageId = eslClient.CreatePackageFromTemplate( templateResult.Id, package);

FredericDH | Posts: 51

Reply to: Unable to create a package from a template

0 votes
Haris, Thanks for your time and help. I have recreated a template identical of my previous one and it worked. Is it possible I corrupted it by using it somehow ? Thanks Frederic

harishaidary | Posts: 1812

Reply to: Unable to create a package from a template

0 votes
I'm can't be sure. Only with the logs can we tell what is causing the 500 error to be thrown.

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