Search contacts
$client->accounts->contacts->search(string accountID, string query): ContactSearchResponse
GET/v1/accounts/{accountID}/contacts
Search contacts on a specific account using merged account contacts, network search, and exact identifier lookup. The exact lookup only runs when the query is a phone number, email address, or username; pass one of those to resolve a specific person.
Parameters
query: string
Text to search contacts by. A phone number, email address, or username written with a leading @ is additionally looked up as an exact identifier on the network; any other text, such as a bare handle or a person or business name, searches existing contacts only. Matching behavior depends on the network.
Search contacts
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
$client = new Client(accessToken: 'My Access Token');
$response = $client->accounts->contacts->search('accountID', query: 'x');
var_dump($response);{
"items": [
{
"id": "id",
"cannotMessage": true,
"email": "email",
"fullName": "fullName",
"imgURL": "imgURL",
"isSelf": true,
"phoneNumber": "phoneNumber",
"username": "username"
}
]
}Returns Examples
{
"items": [
{
"id": "id",
"cannotMessage": true,
"email": "email",
"fullName": "fullName",
"imgURL": "imgURL",
"isSelf": true,
"phoneNumber": "phoneNumber",
"username": "username"
}
]
}