Skip to content
SignNow.Net is the official .NET 4.5+ and .NET Standard class library for the SignNow API. SignNow allows you to embed legally-binding e-signatures into your app, CRM or cloud storage. Send documents for signature directly from your website. Invite multiple signers to finalize contracts.
C#
Branch: develop
Clone or download

README.md

SignNow.NET

Build status Codecov Codacy NuGet Version NuGet Downloads License

About SignNow

SignNow.Net is the official .NET 4.5+ and .NET Standard class library for the SignNow API. SignNow allows you to embed legally-binding e-signatures into your app, CRM or cloud storage. Send documents for signature directly from your website. Invite multiple signers to finalize contracts. Track status of your requests and download signed copies automatically.

Get your account at https://www.signnow.com/developers

Contents

  1. Get started
  2. Platform dependencies
  3. Installation
  4. Documentation
  5. Features
  6. Contribution guidelines
  7. License

Get started

To start using the API you will need an API key. You can get one here https://www.signnow.com/api. For a full list of accepted parameters, refer to the SignNow REST Endpoints API guide: https://docs.signnow.com/reference.

API and Application

Resources Sandbox Production
API: api-eval.signnow.com:443 api.signnow.com:443
Application: https://app-eval.signnow.com https://app.signnow.com
Entry page: https://eval.signnow.com

Platform Dependencies

Windows

  • .Net Framework 4.5 or newer version should be installed in your system, or
  • .Net Core 3.0 and newer

MacOS and Linux

  • .Net Core 3.0 and newer

Installation

Install .Net package

dotnet add package SignNow.Net --version <package-version>

Install using Package manager

Install-Package SignNow.Net -Version <package-version>

Documentation

Read about the available SignNow features in SignNow API Docs.

Features

Authorization

Get your access token via OAuth 2.0 service.

// App credentials from signnow account
var clientId = "0fa****-EXAMPLE_CLIENT_ID-****13";
var clientSecret = "0fb**-EXAMPLE_CLIENT_SECRET-**13";

// Api URL (Sandbox or Production)
var apiBaseUrl = new Uri("https://api-eval.signnow.com");

// User credentials
var login = "signnow_dotnet_sdk@example.com";
var password = "example-user-password";

// init OAuth2 service
var oauth = new OAuth2Service(apiBaseUrl, clientId, clientSecret);
// Token retrieval
var token = oauth.GetTokenAsync(login, password, Scope.All).Result;

Upload a document to SignNow

All the features in SignNow require a document_id. Once you upload a document to SignNow, you get the document_id from a successful response.

string documentId = default;

var pdfFilePath = "./file-path/document-example.pdf";
var pdfFileName = "document-example.pdf";

// using token from the Authorization step
var signNowContext = new SignNowContext(token);

using (var fileStream = File.OpenRead(pdfFilePath))
{
    var uploadResponse = signNowContext.Documents.UploadDocumentAsync(fileStream, pdfFileName).Result;

    documentId = uploadResponse.Id;
}

Download a document from SignNow

Choose the type of download for your document:

  • PdfOriginal - download a document in a state it's been when uploaded to SignNow, before any changes
  • PdfCollapsed - download a document in PDF file format
  • ZipCollapsed - download a document in ZIP archive
  • PdfWithHistory - download a document with its history, a full log of changes on a separate page.
// using token from the Authorization step
var signNowContext = new SignNowContext(token);

// using `documentId` from the Upload document step
var downloadPdf = signNowContext.Documents.DownloadDocumentAsync(documentId, DownloadType.PdfCollapsed).Result;

using (FileStream output = new FileStream(@"./outputDir/" + downloadPdf.Filename, FileMode.Create))
{
  downloadPdf.Document.CopyTo(output);
}

Console.WriteLine("Downloaded successful: " + downloadPdf.Filename);

Create a signing link to the document for signature

Signing link - a single-use link to a document that requires a signature. When the document is signed (or the signer declines to sign it), the link is no longer valid. Having followed the link, signers can click anywhere on the document to sign it.

Steps:

▶ Upload a document or Get the ID of the document you’d like to have signed

▶ Send a signing link

// using token from the Authorization step
var signNowContext = new SignNowContext(token);

// using `documentId` from the Upload document step
var signingLinks = signNowContext.Documents.CreateSigningLinkAsync(documentId).Result;

Console.WriteLine("Authorize and Sign the Document" + signingLinks.Url);
Console.WriteLine("Sign the Document" + signingLinks.AnonymousUrl);

Create a freeform invite to the document for signature

Freeform invite - an invitation to sign a document which doesn’t contain any fillable fields.

Simply upload a document and send it for signature right away. No need for adding fields and configuring roles. Just add the signer's email address and customize the message in your email. The document will be available for signing via a button in the email. Clicking the button opens a document in SignNow editor. Signers can click anywhere on a document to add their signature.

Remember: if your document contains even one fillable field, you have to create a role-based invite to get it signed.

// using token from the Authorization step
var signNowContext = new SignNowContext(token);

var invite = new FreeFormInvite("signer@signnow.com");

// using `documentId` from the Upload document step
// creating Invite request
var inviteResponse = signNowContext.Invites.CreateInviteAsync(documentId, invite).Result;

Create a role-based invite to the document for signature

Role-based invite - an invitation to sign a document which contains at least one fillable field assigned to one role.

Role-based invites allow you to build e-signature workflows. The document can be signed by multiple signers: each with individual access settings, all arranged in a specific order.

Upload a document or create one from a template.

The document will be available for signing via a button in the email. You can customize email messages for every signer. Clicking the button opens a document in SignNow editor. Signers can sign only the fields designated for their role.

You can add more roles either in SignNow web app while editing the fields, or with ISignInvite interface from SDK while specifying parameters of the SignerOptions object.

// using token from the Authorization step
var signNowContext = new SignNowContext(token);

// For example, let use document with only two fillable fields
var pdfFilePath = "./file-path/document-with-fields.pdf";

// Upload document with fillable fields and extract fields
using (var fileStream = File.OpenRead(pdfFilePath))
{
    var documentId = signNowContext.Documents.UploadDocumentWithFieldExtractAsync(fileStream, "DocumentWithFields.pdf").Result.Id;
}

// Get the SignNow document instance by uploaded documentId
var document = signNowContext.Documents.GetDocumentAsync(documentId).Result;

// Create role-based invite using document with fillable fields
var roleBasedInvite = new RoleBasedInvite(document);

// Get all document signer roles
var roles = roleBasedInvite.DocumentRoles();

// Creates options for signers
var signer1 = new SignerOptions("signer1@signnow.com", roles.First());
var signer2 = new SignerOptions("signer2@signnow.com", roles.Last())
    {
        ExpirationDays = 15,
        RemindAfterDays = 7
    }
    .SetAuthenticationByPassword("***secret***");

// Attach signers to existing roles in the document
roleBasedInvite.AddRoleBasedInvite(signer1);
roleBasedInvite.AddRoleBasedInvite(signer2);

// Send invite request for sharing the document to be signed
var inviteResponse = signNowContext.Invites.CreateInviteAsync(documentId, invite).Result;

// Finally - check if document has invite request
var documentUpdated = signNowContext.Documents.GetDocumentAsync(documentId).Result;
var fieldInvites = documentUpdated.FieldInvites.First();

// Get field invite request status for the first signer
var status = fieldInvites.Status.ToString(); // "Pending"
var roleName = fieldInvites.RoleName; // "Signer 1"
var signer1email = fieldInvites.Email; // "signer1@signnow.com"

Contribution guidelines

XML doc generation

For XML documentation generation, install InheritDocTool (the project build will fail without it):

dotnet tool install -g InheritDocTool

More about the InheritDoc here

Important notes

Thanks to all contributors who got interested in this project. We're excited to hear from you. Here are some tips to make our collaboration meaningful and bring its best results to life:

  • We accept pull requests from the community. Please, send your pull requests to the DEVELOP branch which is the consolidated work-in-progress branch. We don't accept requests to the Master branch.

  • Please, check in with the documentation first before you open a new Issue.

  • When suggesting new functionality, give as many details as possible. Add a test or code example if you can.

  • When reporting a bug, please, provide full system information. If possible, add a test that helps us reproduce the bug. It will speed up the fix significantly.

License

This SDK is distributed under the MIT License, see LICENSE for more information.

API Contact Information

If you have questions about the SignNow API, please visit https://docs.signnow.com/reference or email api@signnow.com.

Support: To contact SignNow support, please email support@signnow.com or api@signnow.com.

Sales: For pricing information, please call (800) 831-2050, email sales@signnow.com or visit https://www.signnow.com/contact.

You can’t perform that action at this time.