Advertisement
bit

Untitled

bit
Jan 19th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. static public string SendDocumentForSignature(string scenario, string recipientEmail, string senderEmail, string documentMessage, string documentName, string documentPath, string documentFileName, string callbackUrl)
  2. {
  3. EchoSignDocumentService19 ES = new EchoSignDocumentService19();
  4.  
  5. Dictionary<string, string> oScenario = GetScenario(scenario);
  6.  
  7.  
  8. SenderInfo senderInfo = new SenderInfo();
  9. senderInfo.email = senderEmail;
  10. DocumentCreationInfo documentCreationInfo = new DocumentCreationInfo();
  11. documentCreationInfo.daysUntilSigningDeadline = 2;
  12. documentCreationInfo.message = documentMessage;
  13. documentCreationInfo.name = documentName;
  14.  
  15.  
  16. RecipientInfo recipientInfo = new RecipientInfo();
  17. recipientInfo.email = recipientEmail;
  18.  
  19. recipientInfo.roleSpecified = true;
  20. recipientInfo.role = RecipientRole.SIGNER;
  21.  
  22. CallbackInfo cbInfo = new CallbackInfo();
  23. if(callbackUrl!=null && callbackUrl.Length>0)
  24. cbInfo.signedDocumentUrl = callbackUrl;
  25.  
  26. documentCreationInfo.callbackInfo = cbInfo;
  27.  
  28. documentCreationInfo.recipients = new RecipientInfo[] { recipientInfo };
  29. var fileInfo = new PMGSPEUtils.AdobeEchoSign.com.echosign.secure.FileInfo();
  30. fileInfo.file = System.IO.File.ReadAllBytes(documentPath);
  31. fileInfo.mimeType = "application/msword";
  32. fileInfo.fileName = documentFileName;
  33.  
  34. documentCreationInfo.fileInfos = new PMGSPEUtils.AdobeEchoSign.com.echosign.secure.FileInfo[] { fileInfo };
  35.  
  36. SendDocumentInteractiveOptions sendDocumentInteractiveOptions = new SendDocumentInteractiveOptions();
  37.  
  38. // sendDocumentInteractiveOptions
  39.  
  40. var response = ES.sendDocumentInteractive(oScenario["apiKey"], senderInfo, documentCreationInfo, sendDocumentInteractiveOptions);
  41.  
  42. if (response.success == false)
  43. throw (new Exception(response.errorMessage));
  44.  
  45. return response.documentKey.documentKey;
  46.  
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement