This repository was archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
FreshdeskClient.UpdateContact Method
Jean-Sebastien Carle edited this page Jul 24, 2019
·
5 revisions
Updates a contact and returns the updated contact.
public (Response, Contact) UpdateContact(Contact contact);| Name | Type | Description |
|---|---|---|
| contact | Contact | The contact's information to update. |
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. |
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);
}
}
}ℹ️ The Response StatusCode will return HttpStatusCode.OK if the contact was successfully updated.