You are here:
InsCensusServiceStd:findAccounts
Search for existing person accounts by first name, last name, and email, or by a search key and group account.
Class: InsCensusServiceStd
Method: findAccounts
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 Account entity and retrieves all person accounts with matching first name and/or last name and/or email address and account.
-
All matched person account Id, first name, last name and email are added to the 'accounts' 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 Account entity and retrieves all person accounts with partial/exact matching names and account. Partial match is supported for names starting with the given search word.
-
If the given search key contains more than one word:
-
The service considers only the first two words (separated by a space) for Account search and ignores the rest of the words in the search key.
-
The service queries the Account entity and retrieves all person accounts 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 person accounts Id, first name, last name and email are added to the 'accounts' node list in the response.
-
Inputs
| Input | Description |
|---|---|
accountId
|
Required. GroupAccountId of person accounts. |
searchKey
|
Required if not using members. One or more words used to search person account with account name containing search key words. |
members
|
Required if not using searchKey. List of members to search accounts. |
| member node | |
members.FirstName
|
first name |
members.LastName
|
last name |
members.PersonEmail
|
Remote Options
| Option | Description |
|---|---|
accountId
|
Required. GroupAccountId of contacts |
searchKey
|
Required if not using members. One or more words used to search person accounts with contact name containing search key words. |
members
|
Required if not using searchKey. List of members to search person accounts. |
| member node | |
FirstName
|
first name |
LastName
|
last name |
PersonEmail
|
Input JSON
Here's the sample input JSON:
{
"accounts":[
{
"Id":"001B000001QZObgIAH",
"FirstName":"Christine",
"LastName":"Boon",
"PersonEmail":"cBoon@test.com"
},
{
"Id":"001B000001QZObgIAJ",
"FirstName":"David",
"LastName":"Boon",
"PersonEmail":"cBoon@test.com"
}
] }Output JSON
Here's the sample output JSON:
{
"accounts":[
{
"FirstName":"Christine",
"LastName":"Boon",
"PersonEmail":"cBoon@test.com",
"Id":"001B000001QZObgIAJ"
},
{
"FirstName":"Christine",
"LastName":"Boon",
"Email":"cBoon@test.com",
"PersonEmail":"001B000001QZObgIAR"
},
...
] }
