Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static public string SendDocumentForSignature(string scenario, string recipientEmail, string senderEmail, string documentMessage, string documentName, string documentPath, string documentFileName, string callbackUrl)
- {
- EchoSignDocumentService19 ES = new EchoSignDocumentService19();
- Dictionary<string, string> oScenario = GetScenario(scenario);
- SenderInfo senderInfo = new SenderInfo();
- senderInfo.email = senderEmail;
- DocumentCreationInfo documentCreationInfo = new DocumentCreationInfo();
- documentCreationInfo.daysUntilSigningDeadline = 2;
- documentCreationInfo.message = documentMessage;
- documentCreationInfo.name = documentName;
- RecipientInfo recipientInfo = new RecipientInfo();
- recipientInfo.email = recipientEmail;
- recipientInfo.roleSpecified = true;
- recipientInfo.role = RecipientRole.SIGNER;
- CallbackInfo cbInfo = new CallbackInfo();
- if(callbackUrl!=null && callbackUrl.Length>0)
- cbInfo.signedDocumentUrl = callbackUrl;
- documentCreationInfo.callbackInfo = cbInfo;
- documentCreationInfo.recipients = new RecipientInfo[] { recipientInfo };
- var fileInfo = new PMGSPEUtils.AdobeEchoSign.com.echosign.secure.FileInfo();
- fileInfo.file = System.IO.File.ReadAllBytes(documentPath);
- fileInfo.mimeType = "application/msword";
- fileInfo.fileName = documentFileName;
- documentCreationInfo.fileInfos = new PMGSPEUtils.AdobeEchoSign.com.echosign.secure.FileInfo[] { fileInfo };
- SendDocumentInteractiveOptions sendDocumentInteractiveOptions = new SendDocumentInteractiveOptions();
- // sendDocumentInteractiveOptions
- var response = ES.sendDocumentInteractive(oScenario["apiKey"], senderInfo, documentCreationInfo, sendDocumentInteractiveOptions);
- if (response.success == false)
- throw (new Exception(response.errorMessage));
- return response.documentKey.documentKey;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement