Overview

This request retrieves the properties of a specified contact. You can use unique or system-generated contact IDs to specify the contact.

The Method

TypeRequestMethod
RESTGEThttps://[Your URL]/api/2.0/contacts/:id
XML-RPCCallcontacts.GetContact

Your method must be structured as follows:

Parameters

Required Parameters

The following parameter is required for this request to work:

Property TypeDescriptionRequired
$idinteger The ID of the contact to retrieve. Can be contact unique ID or contact ID.yes

Responses

TypeDescription
objectThe contact object.

Code Samples

PHP (using REST API)

$url = '(Your URL)/api/2.0/contacts/:contact_id';
$method = 'GET';
$cSession = curl_init();
$headers = array();
$auth = base64_encode($username . ':' . $apikey);
$headers[] = 'Authorization: Basic ' . $auth;
curl_setopt($cSession, CURLOPT_URL, $url);
curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cSession, CURLOPT_HEADER, false);
curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method));
curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($cSession);
curl_close($cSession);