You are here:
InsCensusServiceStd:findContacts
Search for existing contacts by first name, last name, and email, or by a search key and group account.
Class: InsCensusServiceStd
Method: findContacts
How It Works
-
If a service request payload contains an array of members with first name, last name, email address, and a group account:
-
The service queries the Contact entity and retrieves all contacts with matching first name and/or last name and/or email address and account.
-
All matched contacts Id, first name, last name and email are added to the 'contacts' node list in the response.
-
-
If a service request payload contains a searchKey and a group account:
-
If the given search key contains one word, the service queries the Contact entity and retrieve all contacts with partial/exact matching names and account. Partial match is supported for names starting with the given search word.
-
If the given searchkey contains more than one word:
-
The service considers only the first two words (separated by a space) for the Contacts search and ignores the rest of the words in the search key.
-
The service queries the Contact entity and retrieves all contacts with either (first name starts with first word and last name starts with second word of the search key) or (first name starts with second word and last name starts with first word of the search key) and account.
-
-
All matched contacts Id, first name, last name and email are added to the 'contacts' node list in the response.
-
Inputs
| Input | Description |
|---|---|
accountId
|
Required GroupAccountId of contacts. |
searchKey
|
Required if not using members. One or more words used to search contacts with contact name containing search key words. |
members
|
Required if not using searchKey. List of members to search for in contacts. |
| member node | |
FirstName
|
first name |
LastName
|
last name |
Email
|
|
Remote Options
| Option | Description |
|---|---|
accountId
|
Required. GroupAccountId of contacts. |
searchKey
|
Required if not using members. One or more words used to search contacts with contact name containing search key words. |
members
|
Required if not using searchKey. List of members to search for in contacts. |
| member node | |
FirstName
|
first name |
LastName
|
last name |
Email
|
|
Input JSON
Here's the sample input JSON:
{
"contacts":[
{
"Id":"003B000000LEreFIAT",
"FirstName":"Christine",
"LastName":"Boon",
"Email":"cBoon@test.com"
},
{
"Id":"003B000000M07HDIAZ",
"FirstName":"David",
"LastName":"Boon",
"Email":"cBoon@test.com"
}
] }
Output JSON
Here's the sample output JSON:
{
"contacts":[
{
"FirstName":"Christine",
"LastName":"Boon",
"Email":"cBoon@test.com",
"Id":"003B000000LEreFIAT"
},
{
"FirstName":"Christine",
"LastName":"Boon",
"Email":"cBoon@test.com",
"Id":"003B000000M07HDIAZ"
},
...
] }
