Here's everything you need to know about integrating DocuSign with Knit and making API calls

Integrating DocuSign with the Knit UI component

To get started with using Adobe Acrobat Sign APIs, first you'll have to create an OAuth application inside adobe

How to create OAuth app?

  1. From your DocuSign Developer account, start by going to the Apps and Keys page

  2. Select the Add App and Integration Key button and provide the name of your app.

  3. After you create the app, you'll see the Integration Key

  4. Go to the Secret Keys section and add a secret key

  1. Navigate to Additional Settings and add the following redirect URL to https://app.getknit.dev/oauth/authorize

  2. Click on Save to save your app

Adding credentials in the Knit UI Component

Once you have your app credentials, you can use those to integrate with DocuSign in the Knit UI Component

Enter the Integration Key and Integration Secret you got from above steps in the respective fields.

That's it! Click on submit, and if you've entered the correct credentials, you should be redirected to the DocuSign login page, following which you will able to see that the Authorization has been successfully completed

Sending Document for Signature using DocuSign

To send a document out for signature, we'll use Knit's Send Document for Signing API.

API Parameters

The following table gives an overview of the parameters of the API and how Adobe Acrobat Sign interprets them

ParameterIs parameter supported?Notes
signers[].nameSupportedName of the Signer
signers[].emailIdSupportedIs mapped to the Signer's email.
signers[].signTypeSupportedCan either be
WHATSAPP
SMS
ELECTRONIC
signers[].commentSupportedIs mapped to the Signer's omment.
signers[].signCoordinatesSupported
documentNameSupported
documentSupported
contentTypeSupportedThe content-type of the document you are sending. Click here to see examples : https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
notifyForSigningSupportedSends direct signing link over email
referenceNumSupportedA document reference number that can be used across the lifecycle of the signing process
redirectURLSupportedPlease refer to <> to read more about post signature redirection
webhookURLSupportedPlease refer to <> to read more about post signature webhooks
metadata.emailSubjectSupportedAdditional parameter in the metadata to configure the email subject

Default is "Please sign this document set"
signers[].phoneNot Supported
senderNameNot Supported
senderEmailIdNot Supported

📘

Use notifyForSigning parameter to control signing flows

DocuSign supports two flows for signing:

  • Remote Signing: In which a remote signing link is sent to the signer, and a sign url cannot be generated programmatically and it does not support post signature redirection
  • Embedded Signing: In which a remote signing link is not sent to the signer, but the sign url has to be generated programmatically and it supports post signature redirection

If the notifyForSigning parameter is set to true, then the signing flow would be considered as Remote Signing and a sign url would not be generated

If the notifyForSigning parameter is set to false, then the signing flow would be considered as Embedded Signing and a sign url would be generated

A cURL request to send a document for signature could look like:

curl --request POST \
     --url https://api.getknit.dev/v1.0/sign.document.send \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --header 'X-Knit-Integration-Id: <YOUR_INTEGRATION_ID>' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "signers": [
    {
      "name": "Signer1",
      "emailId": "[email protected]",
      "signType": "ELECTRONIC",
      "comment": "Offer Letter"
    }
  ],
  "documentName": "Offer Letter.pdf",
  "document": "base64 string",
  "contentType": "application/pdf",
  "notifyForSigning": false,
  "referenceNum": "OL0001",
  "redirectURL": "https://server/redirect",
  "webhookURL": "https://server/webhook"
}
'

And the response would look like:

{
  "documentSignId": "uniqueSignId",
  "redirectionSupported": true,
  "signers": [
    {
      "name": "Signer 1",
      "email": "[email protected]",
      "phone": null,
      "signUrl": null
    }
  ]
}

Getting the Sign URLs using DocuSign

To get the sign URLs, we'll use Knit's Get Sign URLs API.

🚧

Use the Get Sign URLs API to fetch the signing URL

DocuSign sign URLs have an expiry of 5 mins. Use the Get Sign URLs API to fetch the sign URL when needed.

A cURL request to get the signing URLs could look like:

curl --request GET \
     --url 'https://api.getknit.dev/v1.0/sign.signers.url?documentSignId=<YOUR_DOCUMENT_ID>' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --header 'X-Knit-Integration-Id: <YOUR_INTEGRATION_ID>' \
     --header 'accept: application/json'

And the response would look like:

{
  "signers": [
    {
      "name": "Signer1",
      "email": "[email protected]",
      "signUrl": "https://sign_here.com/123"
    }
  ]
}