public void AddEmailSubjectAndBlurbToExisitingEnvelopeAndVeryifyStatusTest()
 {
     var envelope = new Envelope { Login = _account };
     byte[] doc1 = { 36, 45, 34, 67, 121, 87, 99, 32, 32, 32, 54, 54, 55, 56, 32 };
     var signers = new List<Signer>();
     signers.Add(new Signer { email = "*****@*****.**", name = "test2", recipientId = "1", routingOrder = "1" });
     envelope.Recipients = new Recipients { signers = signers.ToArray()};
     Assert.IsTrue(envelope.Create(doc1, "test-self-signed.doc"));
     Assert.IsNull(envelope.RestError);
     Assert.IsTrue(envelope.AddEmailInformation("DocuSign Client Tests Message", "DocuSign Client Tests Message"));
     Assert.IsNull(envelope.RestError);
     var time = envelope.GetStatus(envelope.EnvelopeId);
     Assert.AreEqual("created", envelope.Status);
     // envelope was created very recently...
     Assert.IsTrue(DateTime.Now.Subtract(time).Ticks < 10000);
     // send envelope
     envelope.Status = "sent";
     envelope.UpdateStatus();
 }
Example #2
0
        //==========================================================================================
        // *** Walkthrough #2 - Get Envelope Information
        //==========================================================================================
        private void GetEnvelopeInformation()
        {
            //*****************************************************************
            // ENTER VALUES FOR FOLLOWING VARIABLES!
            //*****************************************************************
            string AccountEmail = "***";
            string AccountPassword = "******";
            string EnvelopeId = "***";
            //*****************************************************************

            // user credentials 
            Account account = new Account();
            account.Email = AccountEmail;
            account.Password = AccountPassword;

            // make the login call (retrieves your baseUrl and accountId)
            bool result = account.Login();
            if (!result)
            {
                Console.WriteLine("Login API call failed for user {0}.\nError Code:  {1}\nMessage:  {2}", account.Email, account.RestError.errorCode, account.RestError.message);
                return;
            }

            // create envelope object and assign login info
            Envelope envelope = new Envelope();
            envelope.Login = account;

            DateTime sentTime = envelope.GetStatus(EnvelopeId);

            if (envelope.RestError != null)
            {
                Console.WriteLine("Error code:  {0}\nMessage:  {1}", envelope.RestError.errorCode, envelope.RestError.message);
                return;
            }

            Console.WriteLine("Envelope originally sent {0} currently has status:  {1}\nEnvelope Email Subject is:  {2}", sentTime, envelope.Status, envelope.EmailSubject);
        }