AddSignersDocumentsToSession

Add additional signers and documents to an existing Signing Session by sending a list of documents and or signers.  When adding documents, you can specify the location (sequence) of the new document in the Signing Session document order. When adding new signers and specifying SignerRoles, roles currently assigned to an existing signer will not be add and an error message will be returned specifying the signer and the role.

URI POST rest//v1/sessions/updatesession

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″]
string uri = “rest//v1/sessions/updatesession”;
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;
string responseString = string.Empty;

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

sessionConfig.SessionInfo.Id = “Signing Session ID”;

Document documentConfig = new Document();
documentConfig.FileName = “AddedDocument.docx”;
documentConfig.FormId = “TemplateId”; //Template ID
documentConfig.FormTag = “Tag”;
documentConfig.Sequence = 2;
documentConfig.FileBytes = File.ReadAllBytes(@”D:\doc\AddedDocument.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 2”; //(see signer roles Appendix B)
signer.AuthMethod = Authentication.KBAPlusPassword;
signer.AuthenticationSettings = new eSignAPI.AuthenticationSettings();
signer.AuthenticateSigner.Password = “password”;

signers.Add(signer);

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

signers.Add(signer);

sessionConfig.Signers = signers.ToArray();

var data = new
{
userName = userName,
session = sessionConfig
};
string json = serializer.Serialize(data);

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(host + uri);
request.Headers.Add(“Authorization” , encryptedToken);
request.Method = “POST”;
request.ContentType = “application/json”;

using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
{
writer.Write(json);
}

HttpWebResponse response = (HttpWebResponse)request.GetResponse();
responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
sessionResponse = jss.Deserialize<RequestResponse>(responseString);

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

System.Diagnostics.Process.Start(url);

[/gdlr_notification]