GET api/Contacts/Search

Searches contacts, matching a particular term.

Request

Parameters

Name Description Default
term Search term.
matchType How the search term is matched. all
fuzzyMatching Whether similar results are included. true

Response

Body

Content Type: application/xml or application/json
Data set containing the search results, or an error message.

XML JSON
<Response>                                         
  <Result>                                         
    <SearchResults>                                <!--Array of 'Item'--> 
      <Item>                                       
        <ContactID>long</ContactID>                <!--Contact number (unique ID)--> 
        <ContactCode>string</ContactCode>          <!--Historical code--> 
        <Name>string</Name>                        <!--File-as name--> 
        <Location>string</Location>                <!--General location (based on physical address)--> 
        <JobTitle>string</JobTitle>                <!--Position--> 
        <AssociatedWith>string</AssociatedWith>    <!--Associated entity or head office--> 
        <IsEntity>bool</IsEntity>                  <!--Whether the contact is an entity--> 
        <IsBranch>bool</IsBranch>                  <!--Whether the contact is a branch of another entity--> 
        <HasBranches>bool</HasBranches>            <!--Whether the contact has branches--> 
        <AverageRank>int</AverageRank>             <!--Rank/relevance (higher is better)--> 
        <IsFuzzy>bool</IsFuzzy>                    <!--Whether the result is similar only--> 
        <FuzzyTerm>string</FuzzyTerm>              <!--Term that the result is similar to--> 
      </Item>                                      
    </SearchResults>                               
    <NoiseWords>                                   <!--Array of 'Item'--> 
      <Item>string</Item>                          
    </NoiseWords>                                  
  </Result>                                        
  <Message>string</Message>                        <!--Error message--> 
</Response>                                        
{                                       
   "Result": {                          
      "SearchResults": [{               
         "ContactID": "long",           // Contact number (unique ID)
         "ContactCode": "string",       // Historical code
         "Name": "string",              // File-as name
         "Location": "string",          // General location (based on physical address)
         "JobTitle": "string",          // Position
         "AssociatedWith": "string",    // Associated entity or head office
         "IsEntity": "bool",            // Whether the contact is an entity
         "IsBranch": "bool",            // Whether the contact is a branch of another entity
         "HasBranches": "bool",         // Whether the contact has branches
         "AverageRank": "int",          // Rank/relevance (higher is better)
         "IsFuzzy": "bool",             // Whether the result is similar only
         "FuzzyTerm": "string"          // Term that the result is similar to
      }],                               
      "NoiseWords": [ "string" ]        
   },                                   
   "Message": "string"                  // Error message
}                                       
                                        

Status Codes

Code Condition
200 OK The operation completed successfully.
400 Bad RequestInvalid search term, syntax error or term contains only noise words.
401 Unauthorized Access token is invalid, expired or not specified.
406 Not Acceptable Content type specified in the Accept header isn't supported.
500 Internal Server Error An internal error occurred.

Remarks

By default, the search term is split into words (tokens) of no less than 3 characters. You can enclose the term in double quotes to skip tokenisation.

The match type can be one of the following values:

Value Description
all Match all words in the search term.
any Match any words in the search term.