override public void Execute()
        {
            IDictionary <string, string> additionalRequestHeaders = new Dictionary <string, string>();

            additionalRequestHeaders.Add("customHeader1", "value1");
            additionalRequestHeaders.Add("customHeader2", "value2");
            additionalRequestHeaders.Add("customHeader3", "value3");
            additionalRequestHeaders.Add("customHeader4", "value4");

            eslClient = new EslClient(props.Get("api.key"), props.Get("api.url"), true, null, additionalRequestHeaders);

            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed(PackageName)
                                                .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings().WithInPerson())
                                                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                            .WithFirstName("John1")
                                                            .WithLastName("Smith1"))
                                                .WithDocument(DocumentBuilder.NewDocumentNamed(DOCUMENT_NAME)
                                                              .FromStream(fileStream1, DocumentType.PDF)
                                                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                                                             .OnPage(0)
                                                                             .AtPosition(100, 100)))
                                                .Build();

            packageId = eslClient.CreatePackage(superDuperPackage);
            eslClient.SendPackage(packageId);
            retrievedPackage = eslClient.GetPackage(packageId);
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);
            FileInfo  file   = new FileInfo(Directory.GetCurrentDirectory() + "/src/document-with-fields.pdf");

            DocumentPackage package = PackageBuilder.NewPackageNamed("Field extraction example")
                                      .DescribedAs("This is a new package")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromFile(file.FullName)
                                                    .EnableExtraction()
                                                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                   .WithName("AGENT_SIG_1")
                                                                   .EnableExtraction())
                                                    .WithInjectedField(FieldBuilder.Label()
                                                                       .WithName("AGENT_SIG_2")
                                                                       .WithValue("Value to be stamped")))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            client.SendPackage(id);

            Console.WriteLine("Package {0} was sent", id.Id);
        }
Esempio n. 3
0
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);
            FileInfo  file   = new FileInfo(Directory.GetCurrentDirectory() + "/src/document.pdf");

            DocumentPackage package = PackageBuilder.NewPackageNamed("C# Package " + DateTime.Now)
                                      .DescribedAs("This is a new package")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromFile(file.FullName)
                                                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 100))
                                                    .WithSignature(SignatureBuilder.InitialsFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 200))
                                                    .WithSignature(SignatureBuilder.CaptureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 300)))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            client.SendPackage(id);

            Console.WriteLine("Package {0} was sent", id.Id);
        }
        public static void createPackage()
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);
            FileInfo  file   = new FileInfo(Directory.GetCurrentDirectory() + "/src/document.pdf");

            DocumentPackage package = PackageBuilder.NewPackageNamed("C# Package " + DateTime.Now)
                                      .DescribedAs("This is a new package")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith")
                                                  .WithId("SIGNER1"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromFile(file.FullName)
                                                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 100))
                                                    .WithSignature(SignatureBuilder.InitialsFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 200))
                                                    .WithSignature(SignatureBuilder.CaptureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 300)))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            client.CreateAndSendPackage(package);

            Console.WriteLine("Package was created and sent", id.Id);

            // Optionally, get the session token for integrated signing.
            SessionToken sessionToken = client.SessionService.CreateSessionToken(id, "SIGNER1");
        }
Esempio n. 5
0
        public static void Main(string[] args)
        {
            EslClient client = new EslClient(apiToken, baseUrl);
            FileInfo  file   = new FileInfo(Directory.GetCurrentDirectory() + "/src/document.pdf");

            // 1. Create a package
            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("Policy " + DateTime.Now)
                                                .DescribedAs("This is a package demonstrating document upload")
                                                .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                            .WithFirstName("John")
                                                            .WithLastName("Smith")
                                                            .WithTitle("Managing Director")
                                                            .WithCompany("Acme Inc."))
                                                .Build();

            superDuperPackage.Id = client.CreatePackage(superDuperPackage);

            // 2. Construct a document
            Document document = DocumentBuilder.NewDocumentNamed("First Document")
                                .FromFile(file.FullName)
                                .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                               .OnPage(0))
                                .Build();

            // 3. Attach the document to the created package by uploading the document.
            client.UploadDocument(document.FileName, document.Content, document, superDuperPackage);

            Console.WriteLine("Document was uploaded");
        }
        public static void Main(string[] args)
        {
            FileInfo        file              = new FileInfo(Directory.GetCurrentDirectory() + "/src/document.pdf");
            EslClient       eslClient         = new EslClient(apiToken, baseUrl);
            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("DocumentPackageSettings " + DateTime.Now)
                                                .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings()
                                                              .WithInPerson()
                                                              .WithoutDecline()
                                                              .WithOptOut()
                                                              .WithOptOutReason("Reason One")
                                                              .WithOptOutReason("Reason Two")
                                                              .WithOptOutReason("Reason Three")
                                                              .WithHandOverLinkHref("http://www.google.ca")
                                                              .WithHandOverLinkText("click here")
                                                              .WithHandOverLinkTooltip("link tooltip")
                                                              .WithCeremonyLayoutSettings(CeremonyLayoutSettingsBuilder.NewCeremonyLayoutSettings()
                                                                                          .WithoutProgressBar()
                                                                                          .WithoutSessionBar()
                                                                                          .WithoutGlobalNavigation()
                                                                                          .WithoutBreadCrumbs()))
                                                .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                            .WithFirstName("John")
                                                            .WithLastName("Smith"))
                                                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                                                              .FromFile(file.FullName)
                                                              .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                             .OnPage(0)
                                                                             .AtPosition(100, 100)))
                                                .Build();

            PackageId       packageId     = eslClient.CreatePackage(superDuperPackage);
            DocumentPackage customPackage = eslClient.GetPackage(packageId);
        }
Esempio n. 7
0
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);
            FileInfo  file   = new FileInfo(Directory.GetCurrentDirectory() + "/src/document.pdf");

            DocumentPackage package = PackageBuilder.NewPackageNamed("Fields example " + DateTime.Now)
                                      .DescribedAs("This is a new package")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromFile(file.FullName)
                                                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 100)
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 200)
                                                                              .WithValidation(FieldValidatorBuilder.Alphabetic()
                                                                                              .MaxLength(10)
                                                                                              .MinLength(3)
                                                                                              .Required()
                                                                                              .WithErrorMessage("This field is not alphabetic")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 300)
                                                                              .WithValidation(FieldValidatorBuilder.Numeric()
                                                                                              .WithErrorMessage("This field is not numeric")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 400)
                                                                              .WithValidation(FieldValidatorBuilder.Alphanumeric()
                                                                                              .WithErrorMessage("This field is not alphanumeric")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 500)
                                                                              .WithValidation(FieldValidatorBuilder.Email()
                                                                                              .WithErrorMessage("The value in this field is not an email address")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 600)
                                                                              .WithValidation(FieldValidatorBuilder.URL()
                                                                                              .WithErrorMessage("The value in this field is not a valid URL")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 700)
                                                                              .WithValidation(FieldValidatorBuilder.Regex("^[0-9a-zA-Z]+$")
                                                                                              .WithErrorMessage("The value in this field does not match the expression")))))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            client.SendPackage(id);

            Console.WriteLine("Package {0} was sent", id.Id);
        }
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client     = new EslClient(apiToken, baseUrl);
            FileInfo  file       = new FileInfo(Directory.GetCurrentDirectory() + "/src/document.pdf");
            Stream    fileStream = File.OpenRead(file.FullName);

            DocumentPackage package = PackageBuilder.NewPackageNamed("C# Package " + DateTime.Now)
                                      .DescribedAs("This is a new package")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromStream(fileStream, DocumentType.PDF))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            Console.WriteLine("Package {0} was created", id.Id);
        }
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);
            //Get my hands on the list of signers somehow...
            List <SignerInfo> signers = Signers();
            //Get my hands on the list of documents somehow...
            List <DocumentInfo> documents = Documents();

            PackageBuilder packageBuilder = PackageBuilder.NewPackageNamed("Package with variable number of signers and documents")
                                            .DescribedAs("This is a new package");

            foreach (SignerInfo signer in signers)
            {
                packageBuilder.WithSigner(SignerBuilder.NewSignerWithEmail(signer.Email)
                                          .WithFirstName(signer.FirstName)
                                          .WithLastName(signer.LastName)
                                          .Build());
            }

            foreach (DocumentInfo document in documents)
            {
                DocumentBuilder documentBuilder = DocumentBuilder.NewDocumentNamed(document.Name).FromFile(document.File.FullName);

                foreach (SignerInfo signer in signers)
                {
                    documentBuilder.WithSignature(SignatureBuilder.SignatureFor(signer.Email)
                                                  .OnPage(0)
                                                  .AtPosition(500, 100)
                                                  .Build());
                }
            }

            PackageId id = client.CreatePackage(packageBuilder.Build());

            client.SendPackage(id);

            Console.WriteLine("Package {0} was sent", id.Id);
        }
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);

            //Signer firstname, lastname, email, title, company
            DocumentPackage package = PackageBuilder.NewPackageNamed("C# Package " + DateTime.Now)
                                      .DescribedAs("This is a new package")
                                      .ExpiresOn(DateTime.Now.AddDays(5))
                                      .WithEmailMessage("This message should appear in email invitation to signers")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith")
                                                  .WithTitle("Super Duper")
                                                  .WithCompany("Acme Inc")
                                                  .WithSMSSentTo("3334445555"))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            Console.WriteLine("Package {0} was created", id.Id);
        }
Esempio n. 11
0
        public static void Main(string[] args)
        {
            EslClient eslClient = new EslClient(apiToken, baseUrl);

            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("Sample Insurance policy")
                                                .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                            .WithFirstName("John")
                                                            .WithLastName("Smith"))
                                                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                                                              .FromFile("src/document-with-fields.pdf")
                                                              .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                             .OnPage(0)
                                                                             .AtPosition(100, 100))
                                                              .WithInjectedField(FieldBuilder.TextField()
                                                                                 .WithId("AGENT_SIG_1")
                                                                                 .WithPositionExtracted()
                                                                                 .WithName("AGENT_SIG_1")
                                                                                 .WithValue("Test Value")))
                                                .Build();

            PackageId packageId = eslClient.CreatePackage(superDuperPackage);

            eslClient.SendPackage(packageId);
        }