Esempio n. 1
0
        public ActionResult <string> DocusignGBME9Request(GBME9Request getData)
        {
            var emailTemplate    = new EmailTemplate("Signature Request", "Hello please read the document and provide your signature in respective fields.");
            var docuSignTemplate = new DocuSignTemplate(getData.TemplateId, new List <string> {
                "Signer"
            });
            var docuSignCredentials = new DocuSignCredentials(Configuration.GetSection("ClientEndPoints").GetSection("AccountUserName").Value, Configuration.GetSection("ClientEndPoints").GetSection("AccountPassword").Value, Configuration.GetSection("ClientEndPoints").GetSection("IntegratedKey").Value);
            var documentGenerator   = new GenerateDocumentGBME9(docuSignCredentials, emailTemplate, docuSignTemplate);
            var returnedURL         = documentGenerator.GenerateDocument(getData);

            return(new JsonResult(returnedURL));
        }
Esempio n. 2
0
        public static string CreateAuthHeader(string userName, string password, string integratorKey)
        {
            DocuSignCredentials dsCreds = new DocuSignCredentials()
            {
                Username      = userName,
                Password      = password,
                IntegratorKey = integratorKey
            };

            string authHeader = Newtonsoft.Json.JsonConvert.SerializeObject(dsCreds);

            return(authHeader);
        }
Esempio n. 3
0
 public DocuSignClient(DocuSignCredentials docusignCredentials)
 {
     this.docusignCredentials = docusignCredentials;
 }
 public GenerateDocumentGBME9(DocuSignCredentials credentials, EmailTemplate emailTemplate, DocuSignTemplate docuSignTemplate)
 {
     this.DocuSignCredentials = credentials;
     this.EmailTemplate       = emailTemplate;
     this.DocuSignTemplate    = docuSignTemplate;
 }
Esempio n. 5
0
        public static void Main()
        {
            DocuSignCredentials credentials = new DocuSignCredentials();

            credentials.username      = "";                     // your account email
            credentials.password      = "";                     // your account password
            credentials.integratorKey = "";                     // your account Integrator Key (found on Preferences -> API page)
            credentials.accountId     = "";
            credentials.baseUrl       = "https://demo.docusign.net/";

            DocuSignClient client = new DocuSignClient(credentials);

            Envelope envelope = new Envelope();

            envelope.status       = "sent";
            envelope.emailSubject = "Test API Call Create Envelope";

            Signer signer = new Signer();

            signer.email       = "";
            signer.name        = "";
            signer.recipientId = 1;

            SignHereTab signHereTab = new SignHereTab();

            signHereTab.anchorString  = "/S1Sign/";
            signHereTab.anchorXOffset = "-20";
            signHereTab.anchorYOffset = "120";

            InitialHereTab initialHereTab = new InitialHereTab();

            initialHereTab.anchorString  = "/S1Initial/";
            initialHereTab.anchorXOffset = "10";
            initialHereTab.anchorYOffset = "120";

            FullNameTab fullNameTab = new FullNameTab();

            fullNameTab.anchorString  = "/S1FullName/";
            fullNameTab.anchorXOffset = "-20";
            fullNameTab.anchorYOffset = "120";

            DateSignedTab dateSignedTab = new DateSignedTab();

            dateSignedTab.anchorString  = "/S1Date/";
            dateSignedTab.anchorXOffset = "-20";
            dateSignedTab.anchorYOffset = "120";

            signer.tabs = new Tabs();
            signer.tabs.signHereTabs = new List <SignHereTab>();
            signer.tabs.signHereTabs.Add(signHereTab);

            signer.tabs.initialHereTabs = new List <InitialHereTab>();
            signer.tabs.initialHereTabs.Add(initialHereTab);

            signer.tabs.fullNameTabs = new List <FullNameTab>();
            signer.tabs.fullNameTabs.Add(fullNameTab);

            signer.tabs.dateSignedTabs = new List <DateSignedTab>();
            signer.tabs.dateSignedTabs.Add(dateSignedTab);

            envelope.recipients         = new Recipients();
            envelope.recipients.signers = new List <Signer>();
            envelope.recipients.signers.Add(signer);

            Document document = new Document();

            document.name       = "Try DocuSigning.docx"; // copy document with same name and extension into project directory (i.e. "test.pdf")
            document.documentId = 1;

            envelope.documents = new List <Document>();
            envelope.documents.Add(document);

            CreateEnvelopeResponse response = client.CreateAndSendEnvelope(envelope);

            Trace.WriteLine(response);
        }