This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a new envelope object that we will manage the signature request through | |
var envDef = new docusign.EnvelopeDefinition(); | |
envDef.emailSubject = 'Please sign this document sent from Node SDK'; | |
envDef.templateId = '{TEMPLATE_ID}'; | |
// create a template role with a valid templateId and roleName and assign signer info | |
var tRole = new docusign.TemplateRole(); | |
tRole.roleName = '{ROLE}'; | |
tRole.name = '{USER_NAME}'; | |
tRole.email = '{USER_EMAIL}'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EnvelopeDefinition envDef = new EnvelopeDefinition(); | |
envDef.EmailSubject = "[DocuSign C# SDK] - Please sign this doc"; | |
// assign recipient to template role by setting name, email, and role name. Note that the | |
// template role name must match the placeholder role name saved in your account template. | |
TemplateRole tRole = new TemplateRole(); | |
tRole.Email = "{USER_EMAIL}"; | |
tRole.Name = "{USER_NAME}"; | |
tRole.RoleName = "{ROLE}"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a new envelope to manage the signature request | |
EnvelopeDefinition envDef = new EnvelopeDefinition(); | |
envDef.setEmailSubject("DocuSign Java SDK - Sample Signature Request"); | |
// assign template information including ID and role(s) | |
envDef.setTemplateId("{TEMPLATE_ID}"); | |
// create a template role with a valid templateId and roleName and assign signer info | |
TemplateRole tRole = new TemplateRole(); | |
tRole.setRoleName("{ROLE}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RecipientViewRequest viewOptions = new RecipientViewRequest() | |
{ | |
ReturnUrl = "https://www.docusign.com/", | |
ClientUserId = "1001", // must match clientUserId of the embedded recipient | |
AuthenticationMethod = "email", | |
UserName = "{USER_NAME}", | |
Email = "{USER_EMAIL}" | |
}; | |
// instantiate an envelopesApi object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read a file from disk to use as a document. | |
byte[] fileBytes = File.ReadAllBytes("/Path/To/Document"); | |
EnvelopeDefinition envDef = new EnvelopeDefinition(); | |
envDef.EmailSubject = "[DocuSign C# SDK] - Please sign this doc"; | |
// Add a document to the envelope | |
Document doc = new Document(); | |
doc.DocumentBase64 = System.Convert.ToBase64String(fileBytes); | |
doc.Name = "TestFile.pdf"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// instantiate a new EnvelopesApi object | |
EnvelopesApi envelopesApi = new EnvelopesApi(); | |
// set the url where you want the recipient to go once they are done signing | |
RecipientViewRequest view = new RecipientViewRequest(); | |
view.setReturnUrl("https://www.docusign.com"); | |
view.setAuthenticationMethod("email"); | |
// recipient information must match embedded recipient info we provided in step #2 | |
view.setEmail("[RECIPIENT_EMAIL]"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a byte array that will hold our document bytes | |
byte[] fileBytes = null; | |
String pathToDocument = "[PATH/TO/DOCUMENT]"; | |
try | |
{ | |
String currentDir = System.getProperty("user.dir"); | |
// read file from a local directory | |
Path path = Paths.get(currentDir + pathToDocument); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// instantiate a new EnvelopesApi object | |
var envelopesApi = new docusign.EnvelopesApi(); | |
// set the url where you want the recipient to go once they are done signing | |
// should typically be a callback route somewhere in your app | |
var viewRequest = new docusign.RecipientViewRequest(); | |
viewRequest.returnUrl = 'https://www.docusign.com/'; | |
viewRequest.authenticationMethod = 'email'; | |
// recipient information must match embedded recipient info we provided in step #2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a byte array that will hold our document bytes | |
var fileBytes = null; | |
try { | |
var fs = require('fs'); | |
var path = require('path'); | |
// read file from a local directory | |
fileBytes = fs.readFileSync(path.resolve(__dirname, "test.pdf")); | |
// fileBytes = fs.readFileSync(path.resolve(__dirname, "[PATH/TO/DOCUMENT]")); | |
} catch (ex) { | |
// handle error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const passport = require('passport'); | |
var session = require('express-session'); | |
var docusign = require('./src/index'); | |
const app = express(); | |
const port = process.env.PORT || 3000; | |
const host = process.env.HOST || 'localhost'; | |
app.use(session({ |
NewerOlder