This topic contains 10 replies, has 2 voices, and was last updated by  xxie01 1 week, 2 days ago.

  • Author
    Posts
  • Participant
    xxie01
    Newbie
    Member since: 24.04.2019
    Number of posts: 10

    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(“xxjatm@gmail.com”)
    .WithFirstName(“John”)
    .WithLastName(“Smith”)
    .WithCustomId(“Client1”)
    )
    .WithSigner(SignerBuilder.NewSignerWithEmail(“xxie@mawer.com”)
    .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());
    }

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 828

    Score

    1

    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 Junior Technical Evangelist
    Attachments:
    You must be logged in to view attached files.
    Participant
    xxie01
    Newbie
    Member since: 24.04.2019
    Number of posts: 10

    Score

    0

    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(“xxjatm@gmail.com”)
    .WithName(“Client1.Capture1”)
    .WithPositionExtracted())

    By the way. 换照片以后感觉是工作一段时间长胖了点. LOL.

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 828
    Approved answer

    Score

    0

    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 Junior Technical Evangelist
    Participant
    xxie01
    Newbie
    Member since: 24.04.2019
    Number of posts: 10

    Score

    0

    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 <div load-document=”default-consent”> in the attach screenshot?

    Thanks,
    Xiaojun Xie

    Attachments:
    You must be logged in to view attached files.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 828

    Score

    0

    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.(support@onespan.com)

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    xxie01
    Newbie
    Member since: 24.04.2019
    Number of posts: 10

    Score

    0

    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:
    You must be logged in to view attached files.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 828

    Score

    0

    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 Junior Technical Evangelist
    Participant
    xxie01
    Newbie
    Member since: 24.04.2019
    Number of posts: 10

    Score

    0

    The packageId is
    s3rd65YMlOpQF0IwvgAsNMgUBuc=,
    ZDdL72gE6L-PiGNp9yeX9ttqlKo=

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 828

    Score

    0

    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 Junior Technical Evangelist
    Participant
    xxie01
    Newbie
    Member since: 24.04.2019
    Number of posts: 10

    Score

    0

    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

You must be logged in to reply to this topic.