Overview

This request will return a subset of all your contacts. Use the page and count parameters to get the whole list.

The Method

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

Your method must be structured as follows:

Parameters

You can include the following parameters to affect the list which the system returns.

PropertyTypeDescription
$pageintegerThe page number of the list.
$countintegerThe number of results to return per page.
$orderstringThe name of the field to order the listing with.
$directionstringThe direction to order the list in (‘asc’ or ‘desc’).
$filtersstructarrayThe fields to filter on.

Responses

TypeDescription
arrayAn array of contacts.

Code Samples

PHP (using REST API)

$url = '(Your URL)/api/2.0/contacts';
$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);