Last active
February 20, 2018 22:17
-
-
Save DSDevCenter/6769e8608ec80469e08099a167c4bebe to your computer and use it in GitHub Desktop.
DocuSign C# SDK REST API - Quickstart Create Envelope from Template
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}"; | |
// set the clientUserId on the recipient to mark them as embedded (ie we will generate their signing link) | |
tRole.ClientUserId = "1001"; | |
List<TemplateRole> rolesList = new List<TemplateRole>() { tRole }; | |
// add the role to the envelope and assign valid templateId from your account | |
envDef.TemplateRoles = rolesList; | |
envDef.TemplateId = "{TEMPLATE_ID}"; | |
// set envelope status to "sent" to immediately send the signature request | |
envDef.Status = "sent"; | |
// |EnvelopesApi| contains methods related to creating and sending Envelopes (aka signature requests) | |
EnvelopesApi envelopesApi = new EnvelopesApi(); | |
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef); | |
// print the JSON response | |
Console.WriteLine("EnvelopeSummary:\n{0}", JsonConvert.SerializeObject(envelopeSummary)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment