This is small nestjs project that has zoho sign integration to send pdf documents for signature for recipients.
-
Nodejs
-
npm
-
Nestjs
-
create a zoho sign account
-
How to setup zoho sign client:
https://www.zoho.com/accounts/protocol/oauth-setup.html -
How to create pdf file with e-sign tags:
https://help.zoho.com/portal/en/kb/zoho-sign/user-guide/sending-a-document/articles/automatic-field-addition-in-zoho-sign -
API Documentation for Zoho Sign:
https://www.zoho.com/sign/api/#introduction
- Clone the repository
git clone git@github.com:AnishRane/E-Sign-Document.git - Go to project directory
cd E-Sign-Document - Install dependencies
npm install - Create a Environment folder within the repository
mkdir env - Create respective .env file accordingly
touch ./env/local.env - Environment variables needed to be configured to run the project:
ZOHO_REFRESH_TOKEN="" ZOHO_CLIENT_ID="" ZOHO_CLIENT_SECRET="" ZOHO_OAUTH_TOKEN_API="https://accounts.zoho.in/oauth/v2/token"
- Generate new Oauth access token for zoho apis
GET /document/token GET /document/tokenDetails POST /document/sendSignRequest| Parameter | Type | Description |
|---|---|---|
recipients |
array of object |
Required. Name and email address of recipients |
files |
files |
Required. Files to be uploaded |
This api accepts the receipients in array like:
[
{
"name":"",
"email":""
}
]
And files to be uploaded and sent for e-signing.
- Curl request:
curl --location 'http://localhost:3000/document/sendSignRequest' \
--form 'documents=@"/Users/anishrane/Downloads/testDoc2.pdf"' \
--form 'documents=@"/Users/anishrane/Downloads/testDoc2.pdf"' \
--form 'recipients="[
{
\"name\":\"Anish Rane\",
\"email\":\"anish.rane21@outlook.com\"
},
{
\"name\":\"Anish Manoj Rane\",
\"email\":\"anishrane.dev@gmail.com\"
}
]"'
This can be imported to postman for testing the API.
Configure your NODE_ENV environment in package.json
"start:dev": "NODE_ENV=local nest start --watch"Start the server
npm run start:dev