Exemple #1
0
        /// <summary>
        ///     Gets details of a specified contact.
        /// </summary>
        /// <param name="contact_id">The contact_id is the identifer of the contact for which going to get the details.</param>
        /// <returns>Contact object.</returns>
        public Contact Get(string contact_id)
        {
            var url      = baseAddress + "/" + contact_id;
            var responce = ZohoHttpClient.get(url, getQueryParameters());

            Console.WriteLine(responce.Content.ReadAsStringAsync().Result);
            return(ContactParser.getContact(responce));
        }
Exemple #2
0
        /// <summary>
        ///     Update an existing contact. To delete a contact person remove it from the contact_persons list.
        /// </summary>
        /// <param name="contact_id">The contact_id is the identifier of the contact.</param>
        /// <param name="update_info">The update_info is the Contact object which contains the update information.</param>
        /// <returns>Contact object.</returns>
        public Contact Update(string contact_id, Contact update_info)
        {
            var url        = baseAddress + "/" + contact_id;
            var json       = JsonConvert.SerializeObject(update_info);
            var jsonstring = new Dictionary <object, object>();

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

            return(ContactParser.getContact(responce));
        }
Exemple #3
0
        /// <summary>
        ///     Creates a contact with given information.
        /// </summary>
        /// <param name="new_contact_info">
        ///     The new_contact_info is the Contact object which provides the information to create a
        ///     contact with contact_name as mandatory parameters.
        /// </param>
        /// <returns>Contact object.</returns>
        public Contact Create(Contact new_contact_info)
        {
            var url        = baseAddress;
            var json       = JsonConvert.SerializeObject(new_contact_info);
            var jsonstring = new Dictionary <object, object>();

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

            return(ContactParser.getContact(responce));
        }