Account


Earned badges

Achievement: Latest Unlocked

Topic Started

Topics
I always get this error while trying to retrieve session id for the in-person signing ceremony using Iframe.
Whenever I make request to the https://sandbox.esignlive.com/api, I am getting the following error message {"messageKey":"error.unauthorised.no

Replies Created

Reply to: Unauthorised and NoSession

0 votes
Below is the detail about the request URL and my API key. I took the API key from sandbox login as said in the sample or forum. https://sandbox.esignlive.com/api/packages?type=TEMPLATE //Request URL
HttpClient myClient = new HttpClient();
myClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", "api_key");//API key
myClient.DefaultRequestHeaders.Add("Accept", "application/json,application/zip,text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
HttpResponseMessage packageStatusResponse = myClient.GetAsync(new Uri(url)).Result;
I have written some samples for sending the package and the same issue happens there, like on first request it gives Unauthorised status, then drag the call again to the same request it works and sends the package also. I have attached the fiddler request snap for your consideration which also gives the Unauthorised status in the response.

Reply to: Unauthorised and NoSession

0 votes
I tried today also changing the Content-Type: application/json but still getting the same error Unauthorised using the fiddler. I have attached the screenshot for your consideration. What are all the other possibilities for this type of error. And also I tried using the Silanis.ESL.dll version 11.8 which gives me different problem.
  DocumentPackage documentPackage = PackageBuilder.NewPackageNamed("Package from template via Dlls " + DateTime.Now)
                    .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings())
                    .DescribedAs("Package from template via Dlls")
                    .WithEmailMessage("This message should be delivered to all signers")
                    .WithStatus(DocumentPackageStatus.SENT)
                    .WithVisibility(Visibility.ACCOUNT)
                    .WithAutomaticCompletion()

                    // Define the 1st signer first and last name
                    .WithSigner(SignerBuilder.NewSignerWithEmail(contract.emailAddress)
                                             .WithFirstName(contract.firstName)
                                             .WithLastName(contract.lastName)
                                             .Replacing(new Placeholder(placeHolderId1)))

                    // Define the 2nd signer first and last name
                    .WithSigner(SignerBuilder.NewSignerWithEmail(contract.emailAddressSigner2)
                                             .WithFirstName(contract.firstNameSigner2)
                                             .WithLastName(contract.lastNameSigner2)
                                             .Replacing(new Placeholder(placeHolderId2)))

                    .WithDocument(DocumentBuilder.NewDocumentNamed("Electronic Disclosures and Signatures Consent"))

                    // Define the document
                    .WithDocument(DocumentBuilder.NewDocumentNamed("sample_contract2")
                                        .WithInjectedField(FieldBuilder.Label()
                                            .WithName("FirstName")
                                            .WithValue(contract.firstName))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("LastName")
                                            .WithValue(contract.lastName))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("Email")
                                            .WithValue(contract.emailAddress))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("Company")
                                            .WithValue(contract.company))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("Address")
                                            .WithValue(contract.address))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("City")
                                            .WithValue(contract.city))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("State")
                                            .WithValue(contract.state))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("Country")
                                            .WithValue(contract.country))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("Zip")
                                            .WithValue(contract.zip))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("PhoneNumber")
                                            .WithValue(contract.phone))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("PolicyNumber")
                                            .WithValue(contract.policyNumber))
                                        .WithInjectedField(FieldBuilder.TextField()
                                            .WithName("PolicyNumberSigner2")
                                            .WithValue(contract.policyNumberSigner2))

                ).Build();

 string templateId = "tMs3tH1EWD3uKKQCgaLbjG64f-A=";
                PackageId templatePackage = new PackageId(templateId);
                EslClient eslClient = new EslClient(Constants.SANDBOX_API_KEY, Constants.SANDBOX_URL);
sentPackageId = eslClient.CreatePackageFromTemplate(templatePackage, documentPackage);
It gives me exception as Document fileName must be set. Kindly suggest how to proceed further on the both issues. Thanks in advance.

Attachments
Capture-1.gif200.56 KB

Reply to: Unauthorised and NoSession

0 votes
It happens for the all the request. The first request response is always Unauthorised, when you drag it in visual studio for the same request again it works fine. Today also I tried with Retrieve package by id for which the first response Unauthorised and you drag it again it works fine. Regarding the SDK sample will try and let you know.

Reply to: Unauthorised and NoSession

0 votes
Today when I tried with SDK sample, the same Unauthorized error it gives. Below is the exception details Silanis.ESL.SDK.EslServerException: Could not create a new package. Exception: The remote server returned an error: (401) Unauthorized. HTTP POST on URI https://sandbox.esignlive.com/api/packages. Optional details: {"messageKey":"error.unauthorised.noSession","message":"Failed to retrieve Session","code":401,"name":"Unauthorized"} ---> Silanis.ESL.SDK.EslServerException: The remote server returned an error: (401) Unauthorized. HTTP POST on URI https://sandbox.esignlive.com/api/packages. Optional details: {"messageKey":"error.unauthorised.noSession","message":"Failed to retrieve Session","code":401,"name":"Unauthorized"} ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at Silanis.ESL.SDK.Internal.HttpMethods.PostHttp(String apiToken, String path, Byte[] content) --- End of inner exception stack trace --- at Silanis.ESL.SDK.Internal.HttpMethods.PostHttp(String apiToken, String path, Byte[] content) at Silanis.ESL.SDK.RestClient.Post(String path, String jsonPayload) at Silanis.ESL.SDK.Services.PackageService.CreatePackage(Package package) --- End of inner exception stack trace --- at Silanis.ESL.SDK.Services.PackageService.CreatePackage(Package package) at Silanis.ESL.SDK.EslClient.CreatePackage(DocumentPackage package) at Silanis.ESL.SDK.EslClient.CreateAndSendPackage(DocumentPackage package). I used the code sample (7389_Car_Loan_Net) obtained from the eSignLive quick demo or from the forum and changed the signer email's and file path. Even the SDK is throwing Failed to retrieve Session exception.
 class CarLoanApplication
    {
        private static string API_KEY = "";
        private static string API_URL = ""; //e.g. https://sandbox.esignlive.com/api
        public static void start()
        {
            EslClient eslClient = new EslClient(API_KEY, API_URL);

            DocumentPackage documentPackage = PackageBuilder.NewPackageNamed("Car Loan Application")
                .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                        .WithFirstName("John")
                        .WithLastName("Smith")
                        .WithCustomId("Signer1")
                        .WithSMSSentTo("418-555-5585")
                        .WithAttachmentRequirement(AttachmentRequirementBuilder.NewAttachmentRequirementWithName("Driver license")
                            .WithDescription("Please upload a copy of your driver license.")
                            .IsRequiredAttachment()
                            .Build()))
                .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                        .WithFirstName("Patty")
                        .WithLastName("Galant")
                        .WithCustomId("Signer2")
                        .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion("What's 1+1?")
                            .Answer("2")))
                .WithDocument(DocumentBuilder.NewDocumentNamed("Car Loan Agreement")
                        .FromFile("../4B-CarLoan.pdf")
                        .EnableExtraction()
                        .WithSignature(SignatureBuilder.SignatureFor("[email protected]")
                                .WithName("applicant_signature")
                                .WithPositionExtracted()
                                .WithField(FieldBuilder.SignatureDate()
                                        .WithName("Date")
                                        .WithPositionExtracted())
                                .WithField(FieldBuilder.CheckBox()
                                        .WithName("agree")
                                        .WithPositionExtracted())
                                .WithField(FieldBuilder.RadioButton("radioGroup")
                                        .WithName("radio1")
                                        .WithPositionExtracted()
                                        .WithValue("X"))
                                .WithField(FieldBuilder.RadioButton("radioGroup")
                                        .WithName("radio2")
                                        .WithPositionExtracted())
                                .WithField(FieldBuilder.RadioButton("radioGroup")
                                        .WithName("radio3")
                                        .WithPositionExtracted()))
                        .WithSignature(SignatureBuilder.SignatureFor("[email protected]")
                                .WithName("coapplicant_signature")
                                .WithPositionExtracted())
                        .WithInjectedField(FieldBuilder.TextField()
                                .WithName("amount")
                                .WithValue("50000"))
                        .WithInjectedField(FieldBuilder.TextField()
                                .WithName("applicant_name")
                                .WithValue("John Smith"))
                        .WithInjectedField(FieldBuilder.TextField()
                                .WithName("applicant_email")
                                .WithValue("[email protected]"))
                        .WithInjectedField(FieldBuilder.TextField()
                                .WithName("coapplicant_email")
                                .WithValue("[email protected]"))
                        .WithInjectedField(FieldBuilder.TextField()
                                .WithName("coapplicant_name")
                                .WithValue("Patty Galant"))
                        .WithInjectedField(FieldBuilder.TextField()
                                .WithName("radio5")
                                .WithValue("X"))
                        )
                .Build();

            PackageId packageId = eslClient.CreateAndSendPackage(documentPackage);
        }
    }
Kindly suggest solution to proceed further.

Subscriptions

Topics Replies Freshness Views Users
I always get this error while trying to retrieve session id for the in-person signing ceremony using Iframe.
2 6 years 2 months ago 74
Profile picture for user harishaidary
Whenever I make request to the https://sandbox.esignlive.com/api, I am getting the following error message {"messageKey":"error.unauthorised.no
32 3 years ago 611
Profile picture for user Duo_Liang
Profile picture for user harishaidary

Code Share

This user has not submitted any code shares.

Subscriptions Release Notes

This user is not subscribed to any release notes.