CreateSession

Starts a new signing session by sending a list of documents and signers to be used in the creation of a signing session.  You can assign a foreign application for session synchronization with partner applications by setting the ApplicationKey property. You can assign a template using the document.FormId, assign signer roles for each signer and specify signer authentication such as Knowledge Base Authentication (KBA).  See Appendix B for a list of predefined signer roles available.

Returns – A SessionResponse containing a Signing Session Id and an array of Session Object(s).  (See SessionResponse in Appendix B)

Parameters

Name Type Description
encryptedToken string Required. Encrypted Token returned from client authentication.
Returns null if token has expired or is invalid.
username string Required. Username (email address) of the user who’s starting the signing session.
session Session Required. See Session class in Appendix B

Example – C#
[gdlr_notification icon=”none” type=”color-border” border=”#31BEF9″ color=”#000000″]
ServiceAPIClient ws = new ServiceAPIClient();

string signsessionId = string.Empty;
string url = string.Empty;
string autologinUrl = landingURL + “token={0}&user={1}&ssid={2}&page={3}”;
List<Document> documents = new List<Document>();
SessionResponse sessionResponse;

Session sessionConfig = new Session();
sessionConfig.SessionInfo = new SessionInfo();

sessionConfig.SessionInfo.TransactionId = “New Session”;
sessionConfig.SessionInfo.Title = “New Session”;
sessionConfig.SessionInfo.ApplicationKey = “ApplicationKey”; //Webhook ID
sessionConfig.SessionInfo.UseSequence = 1; // 0=NonSequential, 1=Sequential, 2=Suspended
sessionConfig.SessionInfo.AllowDelegation = true;
sessionConfig.SessionInfo.CopyTo = “user1@docs.constellation1.com,user2@docs.constellation1.com”;
sessionConfig.SessionInfo.Password = “password”;
sessionConfig.SessionInfo.FirstSigner = true;
sessionConfig.SessionInfo.EmailOptions = 3;

sessionConfig.SessionInfo.ExpiresOn = DateTime.Now.AddDays(20); //New property to specify session’s expiration date. Maximum 90 days in the future.
sessionConfig.SessionInfo.ReminderFrequencyDays = 2;  //New property to specify session reminder frequency.

Document documentConfig = new Document();
documentConfig.FileName = “Test.docx”;
documentConfig.FormId = “TemplateId”;

documentConfig.HasAnchorTags= true;  // New property telling eSign to process this document for Anchor Tags. Refer to Anchor Tags section.

documentConfig.FileBytes = File.ReadAllBytes(@”D:\doc\Test.docx”);

documents.Add(documentConfig);
sessionConfig.Documents = documents.ToArray();

Signer signer;
List<Signer> signers = new List<Signer>();

signer = new Signer();
signer.EmailAddress = “email1@docs.constellation1.com”;
signer.FirstName = “FirstName”;
signer.LastName = “LastName”;
signer.SignerRole = “Seller 1”; //(see signer roles Appendix B)
signer.AuthMethod = Authentication.KBAPlusPassword;
signer.AuthenticationSettings = new eSignAPI.AuthenticationSettings();
signer.AuthenticationSettings.Password = “password”;

signer.AuthMethods = new List<AuthenticationMethod>(); // Required to instantiate

signer.Properties = new Dictionary<object, object>();  // Required to instantiate

// Here we’re assuming the template used has two merge fields one called “CompanyName” and the other “Job Title”. So, you supply their values this way.

signer.MergeFieldMapping = new Dictionary<string, string>() { { “CompanyName”, “RED” }, { “Job Title”, “Manager” } };

signer.SignerEmailMessage = “email message”;

signer.SignerEmailSubject = “subject line”;

signers.Add(signer);

signer = new Signer();
signer.EmailAddress = “email2@docs.constellation1.com”;
signer.FirstName = “FirstName”;
signer.LastName = “LastName”;
signer.SignerRole = “Buyer 1”; //(see signer roles Appendix B)
signer.AuthMethod = Authentication.KBA;

signer.AuthMethods = new List<AuthenticationMethod>(); // Required to instantiate

signer.Properties = new Dictionary<object, object>();  // Required to instantiate

signer.SignerEmailMessage = “email message”;

signer.SignerEmailSubject = “subject line”;

 

signers.Add(signer);

sessionConfig.Signers = signers.ToArray();

sessionResponse = ws.CreateSession(encryptedToken, “username”, sessionConfig);

signsessionId = sessionResponse.SigningSessionId.ToString();
url = string.Format(autologinUrl, encryptedToken, user, signsessionId, “continue”);

System.Diagnostics.Process.Start(url);