コード例 #1
0
        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);
        }
コード例 #2
0
        override public void Execute()
        {
            DocumentPackage package = PackageBuilder.NewPackageNamed("Signing Order " + DateTime.Now)
                                      .DescribedAs("This is a signer workflow example")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email2)
                                                  .WithFirstName("Coco")
                                                  .WithLastName("Beware")
                                                  .SigningOrder(2))
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith")
                                                  .SigningOrder(1))
                                      .Build();

            packageId = eslClient.CreatePackage(package);

            Console.WriteLine("Package created, id = " + packageId);

            savedPackage = EslClient.GetPackage(packageId);

            // Reorder signers
            afterReorder = eslClient.GetPackage(packageId);
            afterReorder.Signers[email2].SigningOrder = 1;
            afterReorder.Signers[email1].SigningOrder = 2;
            eslClient.PackageService.OrderSigners(afterReorder);

            afterReorder = eslClient.GetPackage(packageId);

            Console.WriteLine("Signer order changed");
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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("Custom Consent Document")
                                                    .FromFile(Directory.GetCurrentDirectory() + "/src/document.pdf")
                                                    .WithSignature(SignatureBuilder.AcceptanceFor("*****@*****.**")))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromFile(file.FullName)
                                                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(100, 100)))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            client.SendPackage(id);

            package = client.GetPackage(id);

            Console.WriteLine("Package was created and sent", id.Id);
        }
コード例 #5
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")
                                                  .WithCompany("Acme Inc")
                                                  .WithTitle("Managing Director"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromFile(file.FullName)
                                                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 100)
                                                                   .WithField(FieldBuilder.SignatureDate()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 200))
                                                                   .WithField(FieldBuilder.SignerName()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 300))
                                                                   .WithField(FieldBuilder.SignerTitle()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 400))
                                                                   .WithField(FieldBuilder.SignerCompany()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 500))))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            client.SendPackage(id);

            Console.WriteLine("Package {0} was sent", id.Id);

            DocumentPackage retrievedPackage = client.GetPackage(id);

            Console.WriteLine("id = " + retrievedPackage.Id);
            Console.WriteLine("status = " + retrievedPackage.Status);
        }