Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/BoldSign.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
</ItemGroup>

<ItemGroup>
<None Update="assets\sample.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="doc-1.pdf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
108 changes: 108 additions & 0 deletions examples/BrandingExamples.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using BoldSign.Api;
using BoldSign.Model;

namespace BoldSign.Examples
{
/// <summary>
/// The branding examples.
/// </summary>
public class BrandingExamples
{
private readonly BrandingClient BrandingClient;

/// <summary>
/// Initializes a new instance of the <see cref="BrandingExamples" /> class.
/// </summary>
/// <param name="BrandingClient">The brand api.</param>
public BrandingExamples(BrandingClient BrandingClient) => this.BrandingClient = BrandingClient;

/// <summary>
/// Deletes the brand.
/// </summary>
public void DeleteBrand()
{
// This is an example brand id, add your own brand id upon usage.
var brandId = "Your brand-id";
this.BrandingClient.DeleteBrand(brandId);
}

/// <summary>
/// Reset the default brand.
/// </summary>
public void ResetDefaultBrand()
{
// This is an example brand id, add your own brand id upon usage.
var brandId = "Your brand-id";
this.BrandingClient.ResetDefaultBrand(brandId);
}

/// <summary>
/// Create the brand.
/// </summary>
public BrandingData CreateBrand()
{
var createBrandData = new BrandSettings()
{
// This is an example brand settings data to create, add your own brand settings upon usage.
BrandName = "Brand from SDK",
BrandLogo = new DocumentFileBytes
{
ContentType = "image/jpg",
FileName = "assets/sample.jpg",
},
CombineAuditTrail = false,
IsDefault = false,
CanHideTagLine = false,
DisclaimerDescription = "Consumer disclosure regarding conducting business electronically, receiving electronic notices, disclosures and other documents and to electronically sign documents.",
DisclaimerTitle = "Classic Company Policy",
EmailDisplayName = "{SenderName} via Your company name",
BackgroundColor = "#EEF4F8",
ButtonColor = "#00BDD4",
ButtonTextColor = "#FFFFFF",
RedirectUrl = "https://app.boldsign.com/dashboard",
};
var result = this.BrandingClient.CreateBrand(createBrandData);
return result;
}

/// <summary>
/// Edit the brand.
/// </summary>
public BrandingData EditBrand()
{
string brandId = "Your brand-id";

var editBrandData = new BrandSettings()
{
// This is an example brand settings data to edit, add your own brand settings upon usage.
BrandName = "Brand edit from SDK",
BrandLogo = new DocumentFileBytes
{
ContentType = "image/jpg",
FileName = "assets/sample.jpg",
},
CombineAuditTrail = false,
IsDefault = false,
CanHideTagLine = false,
DisclaimerDescription = "Consumer disclosure regarding conducting business electronically, receiving electronic notices, disclosures and other documents and to electronically sign documents.",
DisclaimerTitle = "Classic Company Policy",
EmailDisplayName = "{SenderName} via Your company name",
BackgroundColor = "#EEF4F8",
ButtonColor = "#00BDD4",
ButtonTextColor = "#FFFFFF",
RedirectUrl = "https://app.boldsign.com/dashboard",
};
var result = this.BrandingClient.EditBrand(brandId, editBrandData);
return result;
}

/// <summary>
/// list the brand.
/// </summary>
public BrandingRecords ListBrand()
{
var brandRecords = this.BrandingClient.ListBrand();
return brandRecords;
}
}
}
61 changes: 60 additions & 1 deletion examples/DocumentExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ public DocumentRecords ListDocuments()
return documents;
}

/// <summary>
/// Lists the team documents.
/// </summary>
public TeamDocumentRecords ListTeamDocuments()
{
var documents = this.DocumentClient.ListTeamDocuments(page: 1, pageSize: 20);

return documents;
}

/// <summary>
/// Lists the document by senders.
/// </summary>
Expand Down Expand Up @@ -141,6 +151,44 @@ public void DeleteDocument()
this.DocumentClient.DeleteDocument(documentId);
}

/// <summary>
///Add the Tag.
/// </summary>
public void AddTags()
{
// This is an example document id, add your own document id upon usage.
DocumentTags addTags = new DocumentTags()
{
DocumentId = "0ab99f4e-6d03-415e-b7bb-0d4b7c083e17",
Tags = new List<string>
{
"test",
"test1"
}

};
this.DocumentClient.AddTag(addTags);

}

/// <summary>
///Delete the Tag.
/// </summary>
public void DeleteTags()
{
// This is an example document id, add your own document id upon usage.
DocumentTags deletetags = new DocumentTags()
{
DocumentId = "0ab99f4e-6d03-415e-b7bb-0d4b7c083e17",
Tags = new List<string>
{
"test",
"test1"
},

};
this.DocumentClient.DeleteTag(deletetags);
}
/// <summary>
/// Sends the reminder.
/// </summary>
Expand All @@ -165,6 +213,17 @@ public void ChangeAccessCode()
this.DocumentClient.ChangeAccessCode(documentId, "signer1@email.com", "newAccessCodeHere");
}

/// <summary>
/// chnages the recipient details.
/// </summary>
public void ChangeRecipient()
{
// This is an example document id, add your own document id upon usage.
var documentId = "1ace7c82-6770-4d03-b514-b593e20c4550";

this.DocumentClient.ChangeRecipient(documentId, "signer1@gmail.com", "wrong email", "signer2", "signer2@email.com");
}

/// <summary>
/// Changes the access code (When Document signing order enabled).
/// </summary>
Expand Down Expand Up @@ -215,7 +274,7 @@ public async Task<DocumentCreated> CreateDocument()
{
new DocumentSigner(
name: "Signer Name 1",
emailAddress: "signer1@email.com",
emailAddress: "test@boldsign.dev",
signerOrder: 1,
authenticationCode: "123",
signerType: SignerType.Signer,
Expand Down
2 changes: 2 additions & 0 deletions examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ private static async Task Main(string[] args)

var documentExamples = new DocumentExamples(new DocumentClient(apiClient));
var templateExamples = new TemplateExamples(new TemplateClient(apiClient));
var userExamples = new UserExamples(new UserClient(apiClient));
var brandingExamples = new BrandingExamples(new BrandingClient(apiClient));
await documentExamples.CreateDocument().ConfigureAwait(false);

}
Expand Down
81 changes: 81 additions & 0 deletions examples/TeamExamples.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
namespace BoldSign.Examples
{
using BoldSign.Api;
using BoldSign.Model;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;

/// <summary>
/// The team examples.
/// </summary>
public class TeamExamples
{
private readonly TeamClient TeamClient;

/// <summary>
/// Initializes a new instance of the <see cref="TeamExamples" /> class.
/// </summary>
/// <param name="TeamClient">The team api.</param>
public TeamExamples(TeamClient TeamClient) => this.TeamClient = TeamClient;

/// <summary>
/// Gets the Team Details.
/// </summary>
/// <returns>A Team Response.</returns>
public TeamDetails GetTeamDetails()
{
// This is an example team id, add your own team id upon usage.
var teamId = "91e302a6-2eab-430b-9684-999b484aef2b";

var teamDetails = this.TeamClient.GetTeamDetails(teamId);

return teamDetails;
}

/// <summary>
/// Get the team list.
/// </summary>
/// <returns>A Team List Response.</returns>
public TeamList List()
{
var teamListDetails = this.TeamClient.ListTeam(page: 1, pageSize: 1);

return teamListDetails;
}

/// <summary>
/// Creates a new team.
/// </summary>
/// <returns>A Created team.</returns>
public TeamCreated Create()
{
var createTeam = new CreateTeam()
{
TeamName = "Team test1",
};

var create = this.TeamClient.CreateTeam(createTeam);

return create;
}

/// <summary>
/// Updates team Name.
/// </summary>
public void Update()
{
var updateTeam = new UpdateTeam()
{
// This is an example team id, add your own team id upon usage.
TeamId = "bc51981f-5669-4cb2-95e0-f043e44366e2",
TeamName = "Team test1",
};

this.TeamClient.UpdateTeam(updateTeam);
}
}
}
Loading