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

FreshdeskClient.GetContact Method

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

GetContact(Int64)

Retrieves a contact.

public (Response, Contact) GetContact(long contactID);

Parameters

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

Returns

This method is returned as a Tuple.

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

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, Contact contact) = freshdesk.GetContact(28000000000);
            if (response.StatusCode == HttpStatusCode.OK)
                Console.WriteLine(contact.Name);
        }
    }
}

Remarks

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

Clone this wiki locally