コード例 #1
0
        override public void Execute()
        {
            senderEmail = System.Guid.NewGuid().ToString() + "@e-signlive.com";
            senderEmail = senderEmail.Replace("-", "");
			eslClient.AccountService.InviteUser(
				AccountMemberBuilder.NewAccountMember(senderEmail)
				.WithFirstName("firstName")
				.WithLastName("lastName")
				.WithCompany("company")
				.WithTitle("title")
				.WithLanguage( "language" )
				.WithPhoneNumber( "phoneNumber" )
				.Build()
			);

			SenderInfo senderInfo = SenderInfoBuilder.NewSenderInfo(senderEmail)
				.WithName(SENDER_FIRST_NAME, SENDER_SECOND_NAME)
				.WithTitle(SENDER_TITLE)
				.WithCompany(SENDER_COMPANY)
				.Build();

			package = PackageBuilder.NewPackageNamed( "CustomSenderInfoExample " + DateTime.Now )
				.WithSenderInfo( senderInfo )
                .DescribedAs( "This is a package created using the e-SignLive SDK" )
                .ExpiresOn( DateTime.Now.AddMonths(1) )
                .WithEmailMessage( "This message should be delivered to all signers" )
                .Build();

			packageId = eslClient.CreatePackage( package );
        }
コード例 #2
0
		public void BuildWithPackageIdConstructor()
		{
			PackageId packageId = new PackageId("myPackageId");
			ReminderScheduleBuilder builder = ReminderScheduleBuilder.ForPackageWithId(packageId);
			ReminderSchedule built = builder.Build();
			Assert.AreEqual(packageId, built.PackageId);
		}
コード例 #3
0
		public ReminderScheduleBuilder( PackageId packageId )
        {
			this.packageId = packageId;
			daysUntilFirstReminder = DEFAULT_DAYS_UNTIL_FIRST_REMINDER;
			daysBetweenReminders = DEFAULT_DAYS_BETWEEN_REMINDERS;
			numberOfRepetitions = DEFAULT_NUMBER_OF_REPETITIONS;
        }
コード例 #4
0
 public DocumentPackage(PackageId id, string packageName, bool autocomplete, IDictionary<string, Signer> signers, IDictionary<string, Document> documents)
 {
     Id = id;
     Name = packageName;
     Autocomplete = autocomplete;
     Signers = signers;
     Documents = documents;
 }
コード例 #5
0
		/// <summary>
		/// Sender rejects signer's attachment requirement with a comment.
		/// </summary>
		/// <param name="packageId">Package identifier.</param>
		/// <param name="signer">Signer.</param>
		/// <param name="attachmentId">Attachment identifier.</param>
		/// <param name="senderComment">Sender comment.</param>
        public void RejectAttachment(PackageId packageId, Signer signer, String attachmentId, String senderComment)
        {
            signer.Attachments[attachmentId].SenderComment = senderComment;
            signer.Attachments[attachmentId].Status = RequirementStatus.REJECTED;
            Role apiRole = new SignerConverter(signer).ToAPIRole(System.Guid.NewGuid().ToString());
            
            apiClient.RejectAttachment(packageId.Id, apiRole);
        }
コード例 #6
0
		/// <summary>
		/// Sender accepts signer's attachment requirement.
		/// </summary>
		/// <param name="packageId">Package identifier.</param>
		/// <param name="signer">Signer.</param>
		/// <param name="attachmentId">Attachment identifier.</param>
		public void AcceptAttachment(PackageId packageId, Signer signer, String attachmentId)
        {
            signer.Attachments[attachmentId].SenderComment = "";
            signer.Attachments[attachmentId].Status = Silanis.ESL.SDK.RequirementStatus.COMPLETE;
            
            Role apiRole = new SignerConverter(signer).ToAPIRole(System.Guid.NewGuid().ToString());
            
            apiClient.AcceptAttachment(packageId.Id, apiRole);
        }
        override public void Execute()
        {
            // Invite the sender to account
            eslClient.AccountService.InviteUser(AccountMemberBuilder.NewAccountMember(senderEmail)
                .WithFirstName("firstName")
                .WithLastName("lastName")
                .WithCompany("company")
                .WithTitle("title")
                .WithPhoneNumber("phoneNumber")
                .WithStatus(SenderStatus.ACTIVE)
                .Build()
            );

            // Create the template specifying the sender
            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("CreateTemplateOnBehalfOfAnotherSenderExample " + DateTime.Now)
                .DescribedAs("This is a package created using the e-SignLive SDK")
                .WithEmailMessage("This message should be delivered to all signers")
                .WithSenderInfo(SenderInfoBuilder.NewSenderInfo(senderEmail)
                    .WithName(SENDER_FIRST_NAME, SENDER_LAST_NAME)
                    .WithTitle(SENDER_TITLE)
                    .WithCompany(SENDER_COMPANY)
                    .Build())
                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                    .WithFirstName("Patty")
                    .WithLastName("Galant"))
                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                    .WithId("documentId")
                    .FromStream(fileStream1, DocumentType.PDF)
                    .WithSignature(SignatureBuilder.SignatureFor(senderEmail)
                        .AtPosition(200, 200)
                        .OnPage(0))
                    .WithSignature(SignatureBuilder.SignatureFor(email1)
                        .AtPosition(200, 400)
                        .OnPage(0)))
                .Build();

            // Create a template on behalf of another sender
            templateId = eslClient.CreateTemplate(superDuperPackage);

            DocumentPackage packageFromTemplate = PackageBuilder.NewPackageNamed("PackageFromTemplateOnBehalfOfSender" + DateTime.Now)
                .WithSenderInfo(SenderInfoBuilder.NewSenderInfo(senderEmail)
                    .WithName(SENDER_FIRST_NAME, SENDER_LAST_NAME)
                    .WithTitle(SENDER_TITLE)
                    .WithCompany(SENDER_COMPANY)
                    .Build())
                .WithDocument(DocumentBuilder.NewDocumentNamed("Second Document")
                    .WithId("documentId2")
                    .FromStream(fileStream2, DocumentType.PDF))
                .Build();

            // Create package from template on behalf of another sender
            packageId = eslClient.CreatePackageFromTemplate(templateId, packageFromTemplate);
        }
コード例 #8
0
		public static void Main (string[] args)
		{
			// Create new esl client with api token and base url
			EslClient client = new EslClient (apiToken, baseUrl);
			PackageId packageId = new PackageId ("GLK2xasqLvFe2wc4qwO5iTKyjx42");

			byte[] documentContent = client.DownloadDocument (packageId, "testing");
			File.WriteAllBytes (Directory.GetCurrentDirectory() + "/downloaded.pdf", documentContent);

			byte[] evidenceContent = client.DownloadEvidenceSummary (packageId);
			File.WriteAllBytes (Directory.GetCurrentDirectory() + "/evidence-summary.pdf", evidenceContent);

			byte[] zipContent = client.DownloadZippedDocuments (packageId);
			File.WriteAllBytes (Directory.GetCurrentDirectory() + "/package-documents.zip", zipContent);
		}
コード例 #9
0
        override public void Execute()
        {
            PackageId packageId = new PackageId("");

            IList<FieldSummary> fieldSummaries = eslClient.FieldSummaryService.GetFieldSummary(packageId);

            Console.WriteLine("SignerId,\t DocumentId, \tFieldId \tFieldName \tValue");
            foreach (FieldSummary fieldSummary in fieldSummaries)
            {
                Console.WriteLine(fieldSummary.SignerId + ", \t" +
                    fieldSummary.DocumentId + ", \t" +
                    fieldSummary.FieldId + ", \t" +
                    fieldSummary.FieldName + ", \t" +
                    fieldSummary.FieldValue + "\n");
            }
        }
コード例 #10
0
 public string BuildRedirectToDesignerForUserAuthenticationToken(string userAuthenticationToken, PackageId packageId)
 {
     try {
         string redirectPath = webpageTemplate.UrlFor(UrlTemplate.DESIGNER_REDIRECT_PATH)
                 .Replace("{packageId}", packageId.Id)
                 .Build();
         string encodedRedirectPath = HttpUtility.UrlEncode(redirectPath);
         string path = authenticationTemplate.UrlFor(UrlTemplate.AUTHENTICATION_PATH_FOR_USER_AUTHENTICATION_TOKEN_WITH_REDIRECT)
                 .Replace("{authenticationToken}", userAuthenticationToken)
                 .Replace("{redirectUrl}", encodedRedirectPath)
                 .Build();
         return path;
     } catch (Exception e) {
         throw new EslException("Could not authenticate using a user authentication token."+ " Exception: " + e.Message, e);
     }
 }        
コード例 #11
0
 public string CreateSenderAuthenticationToken (PackageId packageId)
 {
     try {
         string path = template.UrlFor (UrlTemplate.SENDER_AUTHENTICATION_TOKEN_PATH).Build ();
         SenderAuthenticationToken senderAuthenticationToken = new SenderAuthenticationToken();
         senderAuthenticationToken.PackageId = packageId.Id;
         string serializedObject = JsonConvert.SerializeObject(senderAuthenticationToken);
         string response = restClient.Post(path, serializedObject);              
         return JsonConvert.DeserializeObject<SenderAuthenticationToken> (response).Value;
     } 
     catch (EslServerException e) {
         throw new EslServerException ("Could not create an authentication token for a sender." + " Exception: " + e.Message, e.ServerError, e);
     }
     catch (Exception e) {
         throw new EslException ("Could not create an authentication token for a sender." + " Exception: " + e.Message, e);
     }
 }
コード例 #12
0
        public void UpdateApprovals(PackageId packageId, string documentId, IList<Approval> approvalList)
        {
            string path = template.UrlFor(UrlTemplate.APPROVAL_PATH)
                .Replace("{packageId}", packageId.Id)
                .Replace("{documentId}", documentId)
                .Build();

            try {
                string json = JsonConvert.SerializeObject (approvalList, jsonSettings);
                restClient.Put(path, json);
            }
            catch (EslServerException e) {
                throw new EslServerException("Could not update signatures.\t" + " Exception: " + e.Message, e.ServerError, e);
            }
            catch (Exception e) {
                throw new EslException("Could not update signatures.\t" + " Exception: " + e.Message, e);
            }
        }
コード例 #13
0
        public void ModifyApproval(PackageId packageId, string documentId, Approval approval)
        {
            string path = template.UrlFor(UrlTemplate.APPROVAL_ID_PATH)
                .Replace("{packageId}", packageId.Id)
                    .Replace("{documentId}", documentId)
                    .Replace("{approvalId}", approval.Id)
                    .Build();

            try {
                string json = JsonConvert.SerializeObject (approval, jsonSettings);
                restClient.Put(path, json);
            }
            catch (EslServerException e) {
                throw new EslServerException("Could not modify signature.\t" + " Exception: " + e.Message, e.ServerError, e);
            }
            catch (Exception e) {
                throw new EslException("Could not modify signature.\t" + " Exception: " + e.Message, e);
            }
        }
コード例 #14
0
        public string AddApproval(PackageId packageId, string documentId, Approval approval)
        {
            string path = template.UrlFor(UrlTemplate.APPROVAL_PATH)
                .Replace("{packageId}", packageId.Id)
                    .Replace("{documentId}", documentId)
                    .Build();

            try {
                string json = JsonConvert.SerializeObject (approval, jsonSettings);
                string response = restClient.Post(path, json);
                Silanis.ESL.API.Approval apiApproval = JsonConvert.DeserializeObject<Silanis.ESL.API.Approval> (response, jsonSettings);
                return apiApproval.Id;
            }
            catch (EslServerException e) {
                throw new EslServerException("Could not add signature.\t" + " Exception: " + e.Message, e.ServerError, e);
            }
            catch (Exception e) {
                throw new EslException("Could not add signature.\t" + " Exception: " + e.Message, e);
            }
        }
コード例 #15
0
		private void uploadAttachment(PackageId packageId, string attachmentId, string filename, Stream fileStream, string sessionId)
		{
			string path = template.UrlFor(UrlTemplate.ATTACHMENT_REQUIREMENT_PATH)
				.Replace("{packageId}", packageId.Id)
				.Replace("{attachmentId}", attachmentId)
				.Build();
			byte[] fileBytes = new StreamDocumentSource(fileStream).Content();
			string fileName = DocumentTypeUtility.NormalizeName (DocumentType.PDF, filename);
			string boundary = GenerateBoundary();

			byte[] bytes = new byte[fileName.Length * sizeof(char)];
			System.Buffer.BlockCopy(fileName.ToCharArray(), 0, bytes, 0, bytes.Length);

			byte[] content = CreateMultipartContent(fileName, fileBytes, bytes, boundary);

			try {
				client.PostMultipartFile(path, content, boundary, sessionId, Converter.ToString(bytes));
			} catch (Exception e) {
				throw new EslException ("Could not upload attachment for signer." + " Exception: " + e.Message, e);
			}
		}
        override public void Execute()
        {
            senderEmail = System.Guid.NewGuid().ToString().Replace("-","") + "@e-signlive.com";
            eslClient.AccountService.InviteUser(
                AccountMemberBuilder.NewAccountMember(senderEmail)
                .WithFirstName("firstName")
                .WithLastName("lastName")
                .WithCompany("company")
                .WithTitle("title")
                .WithLanguage( "language" )
                .WithPhoneNumber( "phoneNumber" )
                .Build()
            );

            DocumentPackage template =
                PackageBuilder.NewPackageNamed("CustomSenderInfoInCreateNewTemplateExample: " + DateTime.Now)
                .DescribedAs("This is a template created using the e-SignLive SDK")
                .WithEmailMessage("This message should be delivered to all signers")
                .WithSigner(SignerBuilder.NewSignerPlaceholder(new Placeholder("PlaceholderId1")))
                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                              .FromStream(fileStream1, DocumentType.PDF)
                              .WithSignature(SignatureBuilder.SignatureFor(new Placeholder("PlaceholderId1"))
                                             .OnPage(0)
                                             .AtPosition(100, 100)
                                            )
                             )
                .Build();

            templateId = eslClient.CreateTemplate(template);

            packageId = eslClient.CreatePackageFromTemplate(templateId,
                        PackageBuilder.NewPackageNamed("CustomSenderInfoInCreatePackageFromTemplate packageFromTemplate")
                        .WithSenderInfo( SenderInfoBuilder.NewSenderInfo(senderEmail)
                                         .WithName(SENDER_FIRST_NAME, SENDER_SECOND_NAME)
                                         .WithTitle(SENDER_TITLE)
                                         .WithCompany(SENDER_COMPANY) )
                                     .Build() );
        }
コード例 #17
0
        override public void Execute()
        {
            Document document = DocumentBuilder.NewDocumentNamed(DOCUMENT_NAME)
                .WithId(DOCUMENT_ID)
                .FromStream(fileStream1, DocumentType.PDF)
                .Build();

            DocumentPackage documentPackage = PackageBuilder.NewPackageNamed(PACKAGE_NAME)
                .DescribedAs(PACKAGE_DESCRIPTION)
                .WithEmailMessage(PACKAGE_EMAIL_MESSAGE)
                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                    .WithFirstName(PACKAGE_SIGNER1_FIRST)
                    .WithLastName(PACKAGE_SIGNER1_LAST))
                .WithSigner(SignerBuilder.NewSignerWithEmail(email2)
                    .WithFirstName(PACKAGE_SIGNER2_FIRST)
                    .WithLastName(PACKAGE_SIGNER2_LAST))
                .WithDocument(document)
                .Build();

            packageId = eslClient.CreatePackage(documentPackage);

            templateId = eslClient.CreateTemplateFromPackage(packageId, PACKAGE_NAME_NEW);
        }
コード例 #18
0
 public string BuildRedirectToDesignerForSender(string senderAuthenticationToken, PackageId packageId)
 {
     return(authenticationService.BuildRedirectToDesignerForSender(senderAuthenticationToken, packageId));
 }
コード例 #19
0
 public string BuildRedirectToPackageViewForSender(string userAuthenticationToken, PackageId packageId)
 {
     return(authenticationService.BuildRedirectToPackageViewForSender(userAuthenticationToken, packageId));
 }
コード例 #20
0
		public static ReminderScheduleBuilder ForPackageWithId( PackageId packageId )
		{
			return new ReminderScheduleBuilder(packageId);
		}
コード例 #21
0
 public string BuildRedirectToSigningForSigner(string signerAuthenticationToken, PackageId packageId)
 {
     return(authenticationService.BuildRedirectToSigningForSigner(signerAuthenticationToken, packageId));
 }
コード例 #22
0
 /// <summary>
 /// Sender downloads the attachment file.
 /// </summary>
 /// <returns>The attachment file with file name.</returns>
 /// <param name="packageId">Package identifier.</param>
 /// <param name="attachmentId">Attachment identifier.</param>
 public DownloadedFile DownloadAttachmentFile(PackageId packageId, String attachmentId)
 {
     return(apiClient.DownloadAttachmentFile(packageId.Id, attachmentId));
 }
コード例 #23
0
ファイル: EslClient.cs プロジェクト: janstadt/esl.sdk.net
		public byte[] DownloadDocument (PackageId packageId, string documentId)
		{
			return packageService.DownloadDocument (packageId, documentId);
		}
コード例 #24
0
 public void DeleteSignerVerification(Silanis.ESL.SDK.PackageId packageId, String roleId)
 {
     signerVerificationService.DeleteSignerVerification(packageId, roleId);
 }
コード例 #25
0
ファイル: EslClient.cs プロジェクト: vtcharlie/esl.sdk.net
		public Document UploadDocument( Document document, PackageId packageId ) {
			DocumentPackage documentPackage = GetPackage(packageId);

			return UploadDocument(document, documentPackage);
		}
コード例 #26
0
ファイル: EslClient.cs プロジェクト: vtcharlie/esl.sdk.net
		public DocumentPackage GetPackage (PackageId id)
		{
			Silanis.ESL.API.Package package = packageService.GetPackage (id);

            return new DocumentPackageConverter(package).ToSDKPackage();
		}
コード例 #27
0
ファイル: LayoutService.cs プロジェクト: vanroth1/esl.sdk.net
 /// <summary>
 /// Apply a document layout to a document in a DocumentPackage. Adds fields to signer's signature or if the signer
 /// does not exist, will create placeholders.
 /// </summary>
 /// <param name="packageId">The package id of the DocumentPackage to apply layout.</param>
 /// <param name="documentId">The document id of the document to apply layout.</param>
 /// <param name="layoutId">The layout id of the layout to apply.</param>
 public void ApplyLayout(PackageId packageId, string documentId, string layoutId)
 {
     apiClient.ApplyLayout(packageId.Id, documentId, layoutId);
 }
コード例 #28
0
ファイル: EslClient.cs プロジェクト: janstadt/esl.sdk.net
		public SessionToken CreateSessionToken(PackageId packageId, string signerId)
		{
			return CreateSignerSessionToken(packageId, signerId); 
		}
コード例 #29
0
ファイル: EslClient.cs プロジェクト: janstadt/esl.sdk.net
		public SigningStatus GetSigningStatus (PackageId packageId, string signerId, string documentId)
		{
			return packageService.GetSigningStatus (packageId, signerId, documentId);
		}
コード例 #30
0
ファイル: EslClient.cs プロジェクト: janstadt/esl.sdk.net
		public byte[] DownloadZippedDocuments (PackageId packageId)
		{
			return packageService.DownloadZippedDocuments (packageId);
		}
コード例 #31
0
 public byte[] DownloadAttachment(PackageId packageId, String attachmentId)
 {
     return(DownloadAttachmentFile(packageId, attachmentId).Contents);
 }
コード例 #32
0
		/// <summary>
		/// Sender downloads the attachment.
		/// </summary>
		/// <returns>The attachment.</returns>
		/// <param name="packageId">Package identifier.</param>
		/// <param name="attachmentId">Attachment identifier.</param>
		public byte[] DownloadAttachment(PackageId packageId, String attachmentId)
		{
            return apiClient.DownloadAttachments(packageId.Id, attachmentId);
		}
コード例 #33
0
 public void UpdateSignerVerification(Silanis.ESL.SDK.PackageId packageId, String roleId, SignerVerification signerVerification)
 {
     Silanis.ESL.API.Verification verification = new SignerVerificationConverter(signerVerification).ToAPISignerVerification();
     signerVerificationService.UpdateSignerVerification(packageId, roleId, verification);
 }
コード例 #34
0
 public void UploadAttachment(PackageId packageId, string attachmentId, IDictionary <string, byte []> files, string signerSessionId)
 {
     apiClient.UploadAttachment(packageId, attachmentId, files, signerSessionId);
 }
コード例 #35
0
ファイル: LayoutService.cs プロジェクト: vanroth1/esl.sdk.net
 /// <summary>
 /// Apply a document layout to a document in a DocumentPackage. Adds fields to signer's signature or if the signer
 /// does not exist, will create placeholders.
 /// </summary>
 /// <param name="packageId">The package id of the DocumentPackage to apply layout.</param>
 /// <param name="documentId">The document id of the document to apply layout.</param>
 /// <param name="layoutName">The layout name of the layout to apply.</param>
 public void ApplyLayoutByName(PackageId packageId, string documentId, string layoutName)
 {
     apiClient.ApplyLayoutByName(packageId.Id, documentId, layoutName);
 }
コード例 #36
0
 public static ReminderScheduleBuilder ForPackageWithId(PackageId packageId)
 {
     return(new ReminderScheduleBuilder(packageId));
 }
コード例 #37
0
ファイル: EslClient.cs プロジェクト: janstadt/esl.sdk.net
		public byte[] DownloadEvidenceSummary (PackageId packageId)
		{
			return packageService.DownloadEvidenceSummary (packageId);
		}
コード例 #38
0
 public byte[] DownloadAllAttachmentsForPackage(PackageId packageId)
 {
     return(DownloadAllAttachmentFilesForPackage(packageId).Contents);
 }
コード例 #39
0
ファイル: EslClient.cs プロジェクト: janstadt/esl.sdk.net
		public DocumentPackage GetPackage (PackageId id)
		{
			Silanis.ESL.API.Package package = packageService.GetPackage (id);

			return new PackageBuilder (package).Build ();
		}
コード例 #40
0
ファイル: EslClient.cs プロジェクト: vtcharlie/esl.sdk.net
 public PackageId CreatePackageFromTemplate(PackageId templateId, string packageName)
 {
     DocumentPackage sdkPackage = PackageBuilder.NewPackageNamed( packageName ).Build();
     return CreatePackageFromTemplate( templateId, sdkPackage );
 }
コード例 #41
0
ファイル: EslClient.cs プロジェクト: janstadt/esl.sdk.net
		public void SendPackage (PackageId id)
		{
			packageService.SendPackage (id);
		}
コード例 #42
0
ファイル: EslClient.cs プロジェクト: vtcharlie/esl.sdk.net
        public PackageId CreatePackageFromTemplate(PackageId templateId, DocumentPackage delta)
        {
			return templateService.CreatePackageFromTemplate( templateId, new DocumentPackageConverter(delta).ToAPIPackage() );
        }
コード例 #43
0
 public void UpdatePackage(Silanis.ESL.SDK.PackageId packageId, DocumentPackage sentSettings)
 {
     packageService.UpdatePackage(packageId, new DocumentPackageConverter(sentSettings).ToAPIPackage());
 }
コード例 #44
0
 public string CreateSignerAuthenticationToken(PackageId packageId, string signerId)
 {
     return(CreateSignerAuthenticationToken(packageId, signerId, null));
 }