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 DocuSignAPI.RequestRecipientTokenAuthenticationAssertion assertion = new DocuSignAPI.RequestRecipientTokenAuthenticationAssertion(); assertion.AssertionID = new Guid().ToString(); assertion.AuthenticationInstant = DateTime.Now; assertion.AuthenticationMethod = DocuSignAPI.RequestRecipientTokenAuthenticationAssertionAuthenticationMethod.Password; assertion.SecurityDomain = "DocuSignSample"; // Construct the URLs to which the iframe will redirect upon every event DocuSignAPI.RequestRecipientTokenClientURLs urls = new DocuSignAPI.RequestRecipientTokenClientURLs(); String urlBase = Request.Url.AbsoluteUri.Replace("GetStatusAndDocs.aspx", "pop.html"); urls.OnSigningComplete = urlBase + "?event=SignComplete"; urls.OnViewingComplete = urlBase + "?event=ViewComplete"; urls.OnCancel = urlBase + "?event=Cancel"; urls.OnDecline = urlBase + "?event=Decline"; urls.OnSessionTimeout = urlBase + "?event=Timeout"; urls.OnTTLExpired = urlBase + "?event=TTLExpired"; urls.OnIdCheckFailed = urlBase + "?event=IDCheck"; urls.OnAccessCodeFailed = urlBase + "?event=AccessCode"; urls.OnException = urlBase + "?event=Exception"; DocuSignAPI.APIServiceSoapClient 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) { base.GoToErrorPage(ex.Message); } // Set the source of the iframe to the token hostiframe.Visible = true; hostiframe.Attributes["src"] = token; }