コード例 #1
0
        /// <summary>
        /// Send estimates to your customers by email. Maximum of 10 estimates can be sent at once.
        /// </summary>
        /// <param name="parameters">The parameters is the dictionary object which contains the key,value pair parameters.<br></br>The parameters are<br></br>
        /// <table><tr>estimate_ids*<td></td><td>Comma separated estimate ids which are to be emailed.</td></tr></table>
        /// </param>
        /// <returns>System.String.<br></br>The success message is "Mission accomplished! We've sent all the estimates."</returns>
        public string EmailEstimates(Dictionary <object, object> parameters)
        {
            string url      = baseAddress + "/email";
            var    responce = ZohoHttpClient.post(url, getQueryParameters(parameters));

            return(EstimateParser.getMessage(responce));
        }
コード例 #2
0
        /// <summary>
        /// Update the pdf template associated with the estimate.
        /// </summary>
        /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param>
        /// <param name="template_id">The template_id is the identifier of the template.</param>
        /// <returns>System.String.<br></br>The success message is "Estimate information has been updated."</returns>
        public string UpdateTemplate(string estimate_id, string template_id)
        {
            string url      = baseAddress + "/" + estimate_id + "/templates/" + template_id;
            var    responce = ZohoHttpClient.put(url, getQueryParameters());

            return(EstimateParser.getMessage(responce));
        }
コード例 #3
0
        /// <summary>
        /// Marks a draft estimate as sent.
        /// </summary>
        /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param>
        /// <returns>System.String.<br></br>The success message is "Estimate status has been changed to Sent."</returns>
        public string MarkAsSent(string estimate_id)
        {
            string url      = baseAddress + "/" + estimate_id + "/status/sent";
            var    responce = ZohoHttpClient.post(url, getQueryParameters());

            return(EstimateParser.getMessage(responce));
        }
コード例 #4
0
        /// <summary>
        /// Deletes an existing estimate.
        /// </summary>
        /// <param name="estimate_id">The estimate_id is the identifier of the Estimate.</param>
        /// <returns>System.String.<br></br>The success message is "The estimate has been deleted."</returns>
        public string Delete(string estimate_id)
        {
            string url      = baseAddress + "/" + estimate_id;
            var    responce = ZohoHttpClient.delete(url, getQueryParameters());

            return(EstimateParser.getMessage(responce));
        }
コード例 #5
0
        /// <summary>
        /// Deletes an estimate comment.
        /// </summary>
        /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param>
        /// <param name="comment_id">The comment_id is the identifier of the comment.</param>
        /// <returns>System.String.<br></br>The success message is "The comment has been deleted."</returns>
        public string DeleteComment(string estimate_id, string comment_id)
        {
            string        url         = baseAddress + "/" + estimate_id + "/comments/" + comment_id;;
            var           responce    = ZohoHttpClient.delete(url, getQueryParameters());
            StringBuilder queryString = new StringBuilder();

            return(EstimateParser.getMessage(responce));
        }
コード例 #6
0
        /// <summary>
        ///  Mark a sent estimate as declined if the customer has rejected it.
        /// </summary>
        /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param>
        /// <returns>System.String.<br></br>The success message is "Estimate status has been changed to Declined."</returns>
        public string MarkAsDeclined(string estimate_id)
        {
            string url             = baseAddress + "/" + estimate_id + "/status/declined";
            var    responce        = ZohoHttpClient.post(url, getQueryParameters());
            var    responceContent = responce.Content.ReadAsStringAsync().Result;

            return(EstimateParser.getMessage(responce));
        }
コード例 #7
0
        /// <summary>
        /// Update the shipping address for an existing estimate alone (You can set this address as default shipping address for your customer by specifying 'is_update_customer' param as true).
        /// </summary>
        /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param>
        /// <param name="update_info">The update_info is the Address object which contains the change details.</param>
        /// <returns>System.String.<br></br>The success message is "Shipping address updated"</returns>
        public string UpdateShippingAddress(string estimate_id, Address update_info)
        {
            string url        = baseAddress + "/" + estimate_id + "/address/shipping";
            var    json       = JsonConvert.SerializeObject(update_info);
            var    jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var responce = ZohoHttpClient.put(url, getQueryParameters(jsonstring));

            return(EstimateParser.getMessage(responce));
        }
コード例 #8
0
        /// <summary>
        /// Email an estimate to the customer. Input json string is not mandatory. If input json string is empty, mail will be send with default mail content.
        /// </summary>
        /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param>
        /// <param name="email_details">The email_details is the EmailNotification object with to_mail_ids as mandatory attribute.</param>
        /// <param name="attachment_paths">The attachment_paths are the file paths which are going to be attached with the mail.</param>
        /// <returns>System.String.<br></br>The success message is "Your estimate has been sent."</returns>
        public string SendEmail(string estimate_id, EmailNotification email_details, string[] attachment_paths)
        {
            string url        = baseAddress + "/" + estimate_id + "/email";
            var    json       = JsonConvert.SerializeObject(email_details);
            var    jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var files    = new KeyValuePair <string, string[]>("attachments", attachment_paths);
            var responce = ZohoHttpClient.post(url, getQueryParameters(), jsonstring, files);

            return(EstimateParser.getMessage(responce));
        }