protected void SignFirst(DocuSignAPI.EnvelopeStatus status) { // Create the assertion using the current time, password and demo information DocuSignAPI.RequestRecipientTokenAuthenticationAssertion assertion = new DocuSignAPI.RequestRecipientTokenAuthenticationAssertion(); assertion.AssertionID = new Guid().ToString(); assertion.AuthenticationInstant = DateTime.Now; assertion.AuthenticationMethod = DocuSignAPI.RequestRecipientTokenAuthenticationAssertionAuthenticationMethod.Password; assertion.SecurityDomain = "DocuSignSample"; DocuSignAPI.RecipientStatus recipient = status.RecipientStatuses[0]; // Construct the URLs to which the iframe will redirect upon every event DocuSignAPI.RequestRecipientTokenClientURLs urls = new DocuSignAPI.RequestRecipientTokenClientURLs(); String urlBase = Request.Url.AbsoluteUri.Replace("EmbedDocuSign.aspx", "pop.html") + "?source=embed"; urls.OnSigningComplete = urlBase + "&event=SignComplete1"; urls.OnViewingComplete = urlBase + "&event=ViewComplete1"; urls.OnCancel = urlBase + "&event=Cancel1"; urls.OnDecline = urlBase + "&event=Decline1"; urls.OnSessionTimeout = urlBase + "&event=Timeout1"; urls.OnTTLExpired = urlBase + "&event=TTLExpired1"; urls.OnIdCheckFailed = urlBase + "&event=IDCheck1"; urls.OnAccessCodeFailed = urlBase + "&event=AccessCode1"; urls.OnException = urlBase + "&event=Exception1"; DocuSignAPI.APIServiceSoapClient client = CreateAPIProxy(); String token = null; try { // Request the token for a specific recipient token = client.RequestRecipientToken(status.EnvelopeID, recipient.ClientUserId, recipient.UserName, recipient.Email, assertion, urls); } catch (Exception ex) { base.GoToErrorPage(ex.Message); } // Set the signer message if (_oneSigner) { signerMessage = "Have the signer fill out the Envelope"; } else { signerMessage = "Have the first signer fill out the Envelope"; } messagediv.Visible = true; // Set the source of the iframe to the token hostiframe.Visible = true; hostiframe.Attributes["src"] = token; }
protected void StartSigning(string userName, string clientID, string email, string envelopeID) { // Create the assertion using the current time, password and demo information var assertion = new DocuSignAPI.RequestRecipientTokenAuthenticationAssertion { AssertionID = new Guid().ToString(), AuthenticationInstant = DateTime.Now, AuthenticationMethod = DocuSignAPI.RequestRecipientTokenAuthenticationAssertionAuthenticationMethod.Password, SecurityDomain = "DocuSignSample" }; // Construct the URLs to which the iframe will redirect upon every event String urlBase = Request.Url.AbsoluteUri.Replace("GetStatusAndDocs.aspx", "pop.html"); var urls = new DocuSignAPI.RequestRecipientTokenClientURLs { OnSigningComplete = urlBase + "?event=SignComplete", OnViewingComplete = urlBase + "?event=ViewComplete", OnCancel = urlBase + "?event=Cancel", OnDecline = urlBase + "?event=Decline", OnSessionTimeout = urlBase + "?event=Timeout", OnTTLExpired = urlBase + "?event=TTLExpired", OnIdCheckFailed = urlBase + "?event=IDCheck", OnAccessCodeFailed = urlBase + "?event=AccessCode", OnException = urlBase + "?event=Exception" }; var client = CreateAPIProxy(); String token = null; try { // Request the token for a specific recipient token = client.RequestRecipientToken(envelopeID, clientID, userName, email, assertion, urls); } catch (Exception ex) { GoToErrorPage(ex.Message); } // Set the source of the iframe to the token hostiframe.Visible = true; hostiframe.Attributes[Keys.Source] = token; }
protected void SignSecond(DocuSignAPI.EnvelopeStatus status) { // Create the assertion using the current time, password and demo information DocuSignAPI.RequestRecipientTokenAuthenticationAssertion assertion = new DocuSignAPI.RequestRecipientTokenAuthenticationAssertion(); assertion.AssertionID = new Guid().ToString(); assertion.AuthenticationInstant = DateTime.Now; assertion.AuthenticationMethod = DocuSignAPI.RequestRecipientTokenAuthenticationAssertionAuthenticationMethod.Password; assertion.SecurityDomain = "DocuSignSample"; DocuSignAPI.RecipientStatus recipient = status.RecipientStatuses[1]; // Construct the URLs to which the iframe will redirect upon every event DocuSignAPI.RequestRecipientTokenClientURLs urls = new DocuSignAPI.RequestRecipientTokenClientURLs(); // TODO: replace urlBase with your own test url String urlBase = Request.Url.AbsoluteUri.Replace("EmbedDocuSign.aspx", "pop.html") + "?source=embed"; urls.OnSigningComplete = urlBase + "&event=SignComplete2"; urls.OnViewingComplete = urlBase + "&event=ViewComplete2"; urls.OnCancel = urlBase + "&event=Cancel2"; urls.OnDecline = urlBase + "&event=Decline2"; urls.OnSessionTimeout = urlBase + "&event=Timeout2"; urls.OnTTLExpired = urlBase + "&event=TTLExpired2"; urls.OnIdCheckFailed = urlBase + "&event=IDCheck2"; urls.OnAccessCodeFailed = urlBase + "&event=AccessCode2"; urls.OnException = urlBase + "&event=Exception2"; DocuSignAPI.APIServiceSoapClient client = CreateAPIProxy(); String token = null; try { // Request the token for a specific recipient token = client.RequestRecipientToken(status.EnvelopeID, recipient.ClientUserId, recipient.UserName, recipient.Email, assertion, urls); } catch (Exception ex) { base.GoToErrorPage(ex.Message); } // Set the signer message signerMessage = "The first signer has completed the Envelope. Now the second signer will be asked to fill out details in the Envelope."; messagediv.Visible = true; // Set the source of the iframe to the token hostiframe.Visible = true; hostiframe.Attributes["src"] = token; }
protected void StartSigning(string userName, string clientID, string email, string envelopeID) { // Create the assertion using the current time, password and demo information var assertion = new DocuSignAPI.RequestRecipientTokenAuthenticationAssertion { AssertionID = new Guid().ToString(), AuthenticationInstant = DateTime.Now, AuthenticationMethod = DocuSignAPI.RequestRecipientTokenAuthenticationAssertionAuthenticationMethod.Password, SecurityDomain = "DocuSignSample" }; // Construct the URLs to which the iframe will redirect upon every event String urlBase = Request.Url.AbsoluteUri.Replace("GetStatusAndDocs.aspx", "pop.html"); var urls = new DocuSignAPI.RequestRecipientTokenClientURLs { OnSigningComplete = urlBase + "?event=SignComplete", OnViewingComplete = urlBase + "?event=ViewComplete", OnCancel = urlBase + "?event=Cancel", OnDecline = urlBase + "?event=Decline", OnSessionTimeout = urlBase + "?event=Timeout", OnTTLExpired = urlBase + "?event=TTLExpired", OnIdCheckFailed = urlBase + "?event=IDCheck", OnAccessCodeFailed = urlBase + "?event=AccessCode", OnException = urlBase + "?event=Exception" }; var client = CreateAPIProxy(); String token = null; try { // Request the token for a specific recipient token = client.RequestRecipientToken(envelopeID, clientID, userName, email, assertion, urls); } catch (Exception ex) { GoToErrorPage(ex.Message); } // Set the source of the iframe to the token hostiframe.Visible = true; hostiframe.Attributes[Keys.Source] = token; }