Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

FreshdeskClient.UpdateContact Method

Jean-Sebastien Carle edited this page Jul 24, 2019 · 5 revisions

UpdateContact(Contact)

Updates a contact and returns the updated contact.

public (Response, Contact) UpdateContact(Contact contact);

Parameters

Name Type Description
contact Contact The contact's information to update.

Returns

This method is returned as a Tuple.

Type Description
Response The server response that was returned by the request.
Contact The updated contact. Is null if the contact was not updated.

Examples

The following code example demonstrates this method.

using Freshdesk;

namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            string freshdeskDomain = "yourcompany.freshdesk.com";
            string apiKey = "yourapikey";
            FreshdeskClient freshdesk = new FreshdeskClient(freshdeskDomain, apiKey, "X");
            Contact contact = new Contact();
            contact.ID = 28000000002;
            contact.Name = "John Wick";
            contact.Email = "john.wick@hightable.org";
            (Response response, Contact contact) = freshdesk.UpdateContact(contact);
            if (response.StatusCode == HttpStatusCode.OK)
                Console.WriteLine(contact.Name);
        }
    }
}

Remarks

⚠️ The contact's ID field must be supplied for the update to succeed.

ℹ️ The Response StatusCode will return HttpStatusCode.OK if the contact was successfully updated.

Clone this wiki locally