Hellosign e-signature API

Documents & Productivity

HelloSign API Documentation

HelloSign is an electronic signature service that offers a comprehensive API for developers to integrate their e-signature platform with other applications. Here, we will explore the available APIs and how to use them in JavaScript.

Getting Started

To start using HelloSign's API, you'll need an API key, which you can obtain from your account settings. Once you have your API key, you can make requests to the HelloSign API.

Let's take a look at some possible examples:

Create a Signature Request

To create a new signature request, use the following code in JavaScript:

const hs = require('hellosign-sdk');
hs.configure({
  api_key: 'YOUR_API_KEY_HERE'
});
const opts = {
  test_mode: 1,
  title: 'Test Document',
  subject: 'Test Agreement',
  message: 'Please sign this document.',
  signers: [
    {
      email_address: 'example@gmail.com',
      name: 'John Doe'
    }
  ],
  file_url: 'https://www.example.com/document.pdf',
  allow_decline: 1
};
 
hs.signatureRequest.createEmbedded(opts).then((result) => {
  console.log(result);
}).catch((err) => {
  console.log(err);
});

In this example code, we created a new signature request with several options. We specified that it's a test mode, set the title, subject, and message of the document, added a signer, set a document URL, and allowed the signer to decline the request. Finally, we used the createEmbedded function to create an embedded signature request. The create function can also be used to create a non-embedded signature.

Get Signature Request Info

To get information about a signature request, use this code:

hs.signatureRequest.get(signatureRequestId).then((result) => {
  console.log(result);
}).catch((err) => {
  console.log(err);
});

This returns information about the specified signature request, including its ID, title, subject, and status.

Download Documents

To download a signed document from a signature request, use this code:

hs.signatureRequest.download(signatureRequestId, downloadType).then((result) => {
  console.log(result);
}).catch((err) => {
  console.log(err);
});

Specify the downloadType parameter as pdf, zip, or original. The pdf option downloads the document as a PDF file, the zip option downloads all signed documents as a ZIP file, and the original option downloads the original file used for the signature request.

Wrap Up

HelloSign API is very versatile, and we covered only some examples of what can be accomplished with its API. You can find more APIs and use cases in their documentation.

With the above code examples, you can create signature requests, get information about them, and download the signed documents. With HelloSign's API, you can integrate e-signatures in any application and establish a seamless signing process. Happy coding!

Related APIs in Documents & Productivity