Getting Started with the HelloSign API Using .NET Core

"Getting Started with the HelloSign API Using .NET Core" header image

If you are looking for an eSignature solution to integrate with your .NET Core application, the secure, scalable, and highly customizable HelloSign API is a great fit.  The structure of the HelloSign response objects integrates easily with the Entity Framework ORM, and getting started is simple and free.  The Developer Portal will help you with details on many possible implementations, but your initial .NET set-up can be done in just a few easy steps.


Building with the HelloSign .NET SDK

The first thing you’ll need to do to begin incorporating HelloSign into your .NET application is to visit the HelloSign website to sign up for an account and get an API key.  From the HelloSign web app, click on your username in the top right corner. From the responding dropdown menu, click "My Settings." Then, navigate to the "API" tab. Here you can generate an API key.

Image showing where to find your API key in HelloSign settings
Finding your API Key

For some use cases like Embedded Signing or White Labeling you will also need to create a HelloSign API App. To do that click on “Create” in the API Apps section.  Give your API App a name and a domain. As long as you are in the testing phases of development, you can ignore the domain verification fields, as those are only required for production applications. Once you have created an application, you will receive a Client ID associated with that specific API App.  Use .NET’s System.Environment class to save your API key and Client secret:

  
    string setAPIKey = Environment.SetEnvironmentVariable("apiKey", `YOUR_API_KEY`);
    string setClientID = Environment.SetEnvironmentVariable(“clientID”, `YOUR_CLIENT_ID`);
  

While you are developing a new project with the HelloSign API, you can use the  test_mode parameter to test out all features of the API at no cost. (Note that signature requests made in test mode are not legally binding, and are marked as such.)  The API Reference has detailed documentation of all API endpoints and response data, making it easy to plan your application.


The next step is to install the HelloSign SDK in your application. For .NET applications, it is available as a NuGet package, with in-depth documentation available in the ReadMe.


With your account set up and the package installed, you are ready to get started. To demonstrate the set-up for HelloSign in .NET, we’ll walk through a hypothetical use case.


Imagine you are creating a service to help very early-stage startups get set up with IP contracts, funding agreements, and other legal documents. Depending on the user experience you want to provide, there are multiple ways to use the HelloSign API on your site, but the initial setup is very similar.


Create and Send a Signature Request

When you have a document that needs to be signed, you can initiate the SignatureRequest from your .NET application. HelloSign’s Signature Request Walkthrough provides details on different options for implementation.


If you are working in an MVC application using Entity Framework, you will likely want to create your own SignatureRequest model and include the calls to the HelloSign client in the methods for that Entity or in an `ApiHelper.cs` file in the same namespace. This will make the relationships between ApplicationUsers and SignatureRequests query-able with LINQ and give you a clean way of managing SignatureRequests for a large number of accounts.


If you are working in a lighter-weight .NET implementation, such as `dotnet new webapp`, you can put the HelloSign client code in a file in your `Pages` directory.


In either case, the call to generate a new SignatureRequest is the same.  


Using Existing Files in a SignatureRequest

The simplest way to handle SignatureRequests is to allow HelloSign to generate an email to all signers and include your files in that email.

  
    var client = new Client(Environment.GetEnvironmentVariable("apiKey"));
    var request = new SignatureRequest();
    request.TestMode = true;
    request.Title = "Intellectual Property Sharing Agreement";
    request.Subject = "IP Sharing Agreement for Our Project";
    request.Message = "Please review this agreement that we discussed in our last team meeting.  If we need to discuss further, you can decline.";
    request.AddSigner("pat@example.com", "Pat");
    request.AddSigner("sam@example.com", "Sam");
    request.AddCc("lawyer@lawfirm.com");
    request.AddFile("C:\Users\Me\My Documents\IP Agreement.pdf");
    request.AddFile("C:\Users\Me\My Documents\AppendixA.pdf");
    request.AllowDecline = true;
    var response = client.SendSignatureRequest(request);
  

Note that the files parameter is using a path to a single file but can also be used with a URL or include multiple files in the signature request. For URLs, you will use file_url : [array] instead.


Send a SignatureRequest With A Template

For our startup platform, in some cases a better option might actually be to use templates. While many teams will want to draft and revise their own contracts, others will be very happy to have boilerplate contracts. Using templates for standardized forms makes the signing experience faster and more uniform across documents, which, for some users, will be exactly what they want. Read through the Templates Walkthrough for more information.


Creating a template is easy, but you will need to do it on the HelloSign website.  After you’ve made a template, you can reference the template with template_id and Send with a Template.

  
    var templateRequest = new TemplateSignatureRequest();
    request.AddTemplate("YOUR_TEMPLATE ID");
    request.Subject = "Expense Sharing Agreement";
    request.Message = "A standard agreement for dividing business expenses.";
    request.AddSigner("Designer", "george@example.com", "George");
    request.AddSigner("Developer", "bess@example.com", "Bess");
    request.TestMode = true;
    var response = client.SendSignatureRequest(request);
  

Embedding Your SignatureRequests Directly In Your Application

Eventually, as your application scales and you invest more in branding and UX, you can embed the HelloSign functionality you need directly on your website. With the HelloSign API, you can let users do an assortment of tasks directly in your app, like sign documents with Embedded Signing, request signatures with Embedded Requesting, and create and edit templates with Embedded Templates. You can even White Label the entire signing flow with your own branding to make the experience completely seamless.


For .NET applications, developing embedded flows will require using some JavaScript code. While your backend can still make calls via the HelloSign .NET SDK, the corresponding links are embedded in an iFrame on the front end using the hellosign-embedded library, which is available through NPM or via CDN.


Using the .NET SDK to build with the HelloSign API

For developers building applications with eSignature needs, the HelloSign .NET SDK is a great way to improve efficiency and speed up implementation. Whether you’re building for signature requests or embedded signing, the .NET SDK offers quick, flexible, and scalable access to HelloSign API endpoints using built-in methods.


To learn more about the HelloSign API and start testing for free, visit HelloSign’s Developer Portal

Ready to integrate signatures into your app or website?

Let us help you build a custom API plan that fits your unique business needs.

Get news, insights and posts directly in your inbox

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form
Oops! Something went wrong while submitting the form.
true