Authensure 1.0.0

dotnet add package Authensure --version 1.0.0
                    
NuGet\Install-Package Authensure -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Authensure" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Authensure" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Authensure" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Authensure --version 1.0.0
                    
#r "nuget: Authensure, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Authensure@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Authensure&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Authensure&version=1.0.0
                    
Install as a Cake Tool

Authensure .NET SDK

NuGet Version .NET Version License: MIT

Official .NET SDK for Authensure - the electronic signature and document authentication platform.

Features

  • Full API Coverage - Access all Authensure API endpoints
  • .NET 8.0+ - Modern .NET with nullable reference types
  • Async/Await - Full async support with CancellationToken
  • Automatic Retries - Built-in exponential backoff for transient errors
  • Webhook Verification - Easy webhook signature verification
  • File Uploads - Simplified document upload handling
  • Strongly Typed - Full type safety with models

Installation

dotnet add package Authensure

Or via NuGet Package Manager:

Install-Package Authensure

Quick Start

using Authensure;

var client = AuthensureClient.WithApiKey("your_api_key");

// Create an envelope
var envelope = await client.Envelopes.CreateAsync(
    name: "Contract Agreement",
    message: "Please review and sign this document"
);

Console.WriteLine($"Created envelope: {envelope.Id}");

Configuration

// With API Key
var client = AuthensureClient.WithApiKey("your_api_key");

// With Access Token
var client = AuthensureClient.WithAccessToken("your_token");

// With custom options
var client = new AuthensureClient(new AuthensureClientOptions
{
    ApiKey = "your_api_key",
    BaseUrl = "https://api.authensure.app/api",
    Timeout = 30,
    RetryAttempts = 3
});

API Reference

Envelopes

// List envelopes
var envelopes = await client.Envelopes.ListAsync(status: "DRAFT");

// Get an envelope
var envelope = await client.Envelopes.GetAsync("envelope_id");

// Create an envelope
var envelope = await client.Envelopes.CreateAsync(
    name: "My Contract",
    message: "Please sign"
);

// Add a recipient
var recipient = await client.Envelopes.AddRecipientAsync(
    envelopeId: "envelope_id",
    email: "signer@example.com",
    name: "John Doe",
    role: "signer"
);

// Send for signing
await client.Envelopes.SendAsync("envelope_id");

// Void an envelope
await client.Envelopes.VoidAsync("envelope_id", "Contract cancelled");

Documents

// Upload a document
var fileContent = await File.ReadAllBytesAsync("contract.pdf");
var document = await client.Documents.UploadAsync("envelope_id", fileContent, "contract.pdf");

// Download a document
var content = await client.Documents.DownloadAsync("document_id");
await File.WriteAllBytesAsync("signed_contract.pdf", content);

Templates

// Use a template
var envelope = await client.Templates.UseAsync("template_id", new
{
    name = "New Contract",
    recipients = new[]
    {
        new { roleId = "role_1", email = "signer@example.com", name = "John Doe" }
    }
});

Webhooks

// Create a webhook
var webhook = await client.Webhooks.CreateAsync(
    url: "https://your-app.com/webhooks/authensure",
    events: new List<string> { "envelope.signed", "envelope.completed" }
);

// Verify webhook signature
var isValid = WebhooksResource.VerifySignature(payload, signature, "your_webhook_secret");

// Construct verified event
var webhookEvent = WebhooksResource.ConstructEvent(payload, signature, "your_webhook_secret");
Console.WriteLine($"Event type: {webhookEvent.Event}");

Error Handling

try
{
    var envelope = await client.Envelopes.GetAsync("invalid_id");
}
catch (NotFoundException)
{
    Console.WriteLine("Envelope not found");
}
catch (AuthenticationException)
{
    Console.WriteLine("Invalid API key");
}
catch (RateLimitException ex)
{
    Console.WriteLine($"Rate limited, retry after: {ex.RetryAfter} seconds");
}
catch (ValidationException ex)
{
    Console.WriteLine($"Validation errors: {ex.Details}");
}
catch (AuthensureException ex)
{
    Console.WriteLine($"API error: {ex.Message} (code: {ex.ErrorCode})");
}

ASP.NET Core Integration

Register in Program.cs:

builder.Services.AddSingleton<AuthensureClient>(sp =>
    AuthensureClient.WithApiKey(builder.Configuration["Authensure:ApiKey"]!));

Use in controllers:

public class EnvelopesController : ControllerBase
{
    private readonly AuthensureClient _authensure;

    public EnvelopesController(AuthensureClient authensure)
    {
        _authensure = authensure;
    }

    [HttpPost]
    public async Task<IActionResult> Create([FromBody] CreateEnvelopeRequest request)
    {
        var envelope = await _authensure.Envelopes.CreateAsync(
            name: request.Name,
            message: request.Message
        );
        return Ok(envelope);
    }
}

Development

# Build
dotnet build

# Run tests
dotnet test

# Pack
dotnet pack

Resources

License

This package is open-sourced software licensed under the MIT license.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 109 2/7/2026