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

FreshdeskClient.DeleteContact Method

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

Overloads

Method Description
DeleteContact(Int64) Deletes a contact.
DeleteContact(Int64, Boolean) Deletes a contact permanently.

DeleteContact(Int64)

Deletes a contact.

public Response DeleteContact(long contactID);

Parameters

Name Type Description
contactID Int64 The ID of the contact to delete.

Returns

Type Description
Response The server response that was returned by the request.

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");
            Response response = freshdesk.DeleteContact(28000000001);
            if (response.StatusCode == HttpStatusCode.NoContent)
                Console.WriteLine("Iosef didn't make it.");
        }
    }
}

Remarks

ℹ️ The Response StatusCode will return HttpStatusCode.NoContent if the contact was successfully deleted.


DeleteContact(Int64, Boolean)

Deletes a contact permanently.

public Response DeleteContact(long contactID, bool permanently);

Parameters

Name Type Description
contactID Int64 The ID of the contact to delete.
permanently Boolean If true the deletion is permanent, otherwise a soft-delete is performed.

Returns

Type Description
Response The server response that was returned by the request.

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");
            Response response = freshdesk.DeleteContact(28000000001, true);
            if (response.StatusCode == HttpStatusCode.NoContent)
                Console.WriteLine("Iosef didn't make it.");
        }
    }
}

Remarks

ℹ️ The Response StatusCode will return HttpStatusCode.NoContent if the contact was successfully deleted.

Clone this wiki locally