SignRequest API - Node Example
Example to GET, create documents and send sign requests to SignRequest's API
Getting Started
- Clone this Repository
- Install Dependencies with:
npm install
.
Create a Document:
createdoc.js
- Add your team subdomain in "baseUrl".
- Create a Document at createdoc.js:
i) Fill the header with your Token in "your_token_here".
ii) Add the data in "file_from_url", a sharable url with a .pdf document.
Obs: You can send a pdf document encoding it to base64, for that, use the snippet provided in 'pdf2base64.pdf'. For that, use
file_from_content
andfile_from_content_name
andname
. Obs2: To run tests, use the attached 'demo_document.pdf'. - Run the code with:
node createdoc.js
.
Create a Sign Request:
createsignrequests.js
- Add your team subdomain in "baseUrl".
DATA OBJECT:
- Add your newly created document in data.document.
- Add the signers information in data.signers[].
- Add the sender e-mail address at "from_email".
- Add your customized message.
- Add any additional information in the Data Object, such as "who" needs to sign or subject.
For more information check the documentation for the "/signrequests/" endpoint.
https://signrequest.com/api/v1/docs/#tag/signrequests
- Add your team's Token in the "createSignRequest" header at "Authorization".
Quickly Create Document and Sign Request:
quicklycreate.js
To send a request to the "/signrequest-quick-create/" endpoint, which incorporates both previous endpoints in one. You can use "quicklycreate.js" file.
For more info, check the documentation: https://signrequest.com/api/v1/docs/#tag/signrequest-quick-create
Cancel Sign Request
cancelsr.js
To cancel a sign request, send a POST request to /signrequests/uuid/cancel_signrequest/
including the sign request's uuid.
Resend Sign Request
resendsr.js
To resend the email of a sign request, send a POST request to /signrequests/uuid/resend_signrequest_email/
including the sign request's uuid.
iframe.html
You can use this boilerplate for an iframe embeded url of a sign request.