xxie01

Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
Use the .NET sample code https://developer.esignlive.com/guides/feature-guides/document-extraction/ to generate eSign. The field name is [Client1.Capture1] with field type is 'Signature' in PDF file. But get error message Silanis.ESL.SDK.EslServerException: Could not send the package. Exception: The remote server returned an error: (400) Bad Request. HTTP POST on URI https://sandbox.e-signlive.com/api/packages/4sXpv6J-abrL0mKD3U3dJ0gfhIc=. Optional details: {"messageKey":"error.validation.sendPackage.noApprovals","message":"Cannot send package without approvals.","code":400,"name":"Validation Error"} ---> Silanis.ESL.SDK.EslServerException: The remote server returned an error: (400) Bad Request. HTTP POST on URI https://sandbox.e-signlive.com/api/packages/4sXpv6J-abrL0mKD3U3dJ0gfhIc=. Optional details: {"messageKey":"error.validation.sendPackage.noApprovals","message":"Cannot send package without approvals.","code":400,"name":"Validation Error"} ---> System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at Silanis.ESL.SDK.Internal.HttpMethods.PostHttp(String apiToken, String path, Byte[] content, IDictionary`2 headers) --- End of inner exception stack trace --- at Silanis.ESL.SDK.Internal.HttpMethods.PostHttp(String apiToken, String path, Byte[] content, IDictionary`2 headers) at Silanis.ESL.SDK.RestClient.Post(String path, String jsonPayload) at Silanis.ESL.SDK.Services.PackageService.SendPackage(PackageId packageId) --- End of inner exception stack trace --- at Silanis.ESL.SDK.Services.PackageService.SendPackage(PackageId packageId) at eSignDemo.Controllers.ValuesController.Get() in C:\Users\xxie\source\repos\Projects\eSignDemo\eSignDemo\Controllers\ValuesController.cs:line 122 my code is EslClient eslClient = new EslClient(key, url); DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("Test Document Extraction") .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings()) .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]") .WithFirstName("John") .WithLastName("Smith") .WithCustomId("Client1") ) .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]") .WithFirstName("Michael") .WithLastName("Williams") .WithCustomId("MawerIC1") ) .WithDocument(DocumentBuilder.NewDocumentNamed(DOCUMENT1_NAME) .FromStream(ms, DocumentType.PDF) .EnableExtraction() ) .Build(); PackageId packageId; try { packageId = eslClient.CreatePackageOneStep(superDuperPackage); eslClient.SendPackage(packageId); } catch (Exception e) { return BadRequest(e.ToString()); }

Approved Answer

Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
LOL. It looks like that your PDF form name didn't include the brackets [] surrounding "Client1.Capture1". If you applied the Document Extraction feature, you don't have to explicitly use .WithPositionExtracted()

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

1 votes
Hey there, After a quick test with the same sample code and a test PDF, which contains a "[Client1.Capture1]" tag of either Signature type or Text Field type, it works as expected at my side. The attachment was the test PDF I was using, could you also shared the PDF you were using? Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Attachments

Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
Thanks so much for your quick reply. I resolve it myself using this code .WithDocument(DocumentBuilder.NewDocumentNamed(DOCUMENT2_NAME) .FromStream(ms2, DocumentType.PDF) .EnableExtraction() .WithSignature(SignatureBuilder.SignatureFor("[email protected]") .WithName("Client1.Capture1") .WithPositionExtracted()) By the way. 换照片以后感觉是工作一段时间长胖了点. LOL.

Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
As you are online. I have another question. I want to embed the esign into our own website for client to sign. I found an article, https://developer.esignlive.com/guides/feature-guides/signer-session/#java-sdk, so that I can embed the url into iFrame. Is it able to hide OneSpan logo and only show the pdf view, which might be
in the attach screenshot? Thanks, Xiaojun Xie

Attachments

Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
Hey Xiaojun, Kindly go check my blog OneSpan Sign Developer: Signing Ceremony Customization where including how you can make a minimal looking signing ceremony: As a result, everything can be removed except the "confirm" button. You can set them by .Net SDK or by modify the account level default setting via our support team.([email protected]) Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
Hi Liang, Thanks for sharing this article. I prefer to use .NET SDK to modify it. So my code is this: .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings() .WithoutOptOut() .WithoutLanguageDropDown() .WithoutDecline() .WithoutDocumentToolbarDownloadButton() .WithCeremonyLayoutSettings(CeremonyLayoutSettingsBuilder.NewCeremonyLayoutSettings() .WithoutSessionBar() .WithoutTitle() .WithoutProgressBar() .WithoutGlobalDownloadButton() .WithoutBreadCrumbs() .WithoutGlobalConfirmButton() .WithoutGlobalNavigation() .WithoutGlobalSaveAsLayoutButton() .WithoutNavigator() .WithoutGlobalSaveAsLayoutButton() )) In the attached screenshot But even WithoutSessionBar() I can still see the SessionBar 'Welcome @gmail.com'. How can I get the simplest Signing Ceremony the same as your article. Thanks, Xiaojun Xie

Attachments

Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
Hi Xiaojun, The same code works fine at my side. Can you share one package Id you've created with this code snippet? Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
The packageId is s3rd65YMlOpQF0IwvgAsNMgUBuc=, ZDdL72gE6L-PiGNp9yeX9ttqlKo=

Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
Hi Xiaojun, I've checked your package that your code didn't change the package settings. We can set up a quick online session if you want. Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Get 400 error Cannot send package without approvals when eslClient.SendPackge()

0 votes
Yes. If we can have an online session about this issue, that will be better. I'm available today from 11:00 AM to 12:30 AM, MT, and 14:00 to 16:00 MT. If you are not available today, we can have it tomorrow from 10am to 12am MT. Thanks, Xiaojun Xie

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