DocuSign
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?
-
From your DocuSign Developer account, start by going to the Apps and Keys page
-
Select the Add App and Integration Key button and provide the name of your app.
-
After you create the app, you'll see the Integration Key
-
Go to the Secret Keys section and add a secret key
-
Navigate to Additional Settings and add the following redirect URL to https://app.getknit.dev/oauth/authorize
-
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
Parameter | Is parameter supported? | Notes |
---|---|---|
signers[].name | Supported | Name of the Signer |
signers[].emailId | Supported | Is mapped to the Signer's email. |
signers[].signType | Supported | Can either beWHATSAPP SMS ELECTRONIC |
signers[].comment | Supported | Is mapped to the Signer's omment. |
signers[].signCoordinates | Supported | |
documentName | Supported | |
document | Supported | |
contentType | Supported | The 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 |
notifyForSigning | Supported | Sends direct signing link over email |
referenceNum | Supported | A document reference number that can be used across the lifecycle of the signing process |
redirectURL | Supported | Please refer to <> to read more about post signature redirection |
webhookURL | Supported | Please refer to <> to read more about post signature webhooks |
metadata.emailSubject | Supported | Additional parameter in the metadata to configure the email subject Default is "Please sign this document set" |
signers[].phone | Not Supported | |
senderName | Not Supported | |
senderEmailId | Not Supported |
Use
notifyForSigning
parameter to control signing flowsDocuSign 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 totrue
, then the signing flow would be considered as Remote Signing and a sign url would not be generatedIf the
notifyForSigning
parameter is set tofalse
, 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"
}
]
}
Updated 10 months ago