Skip Navigation Links
 

DirectoryLookup

Definition

DirectoryLookupResult[] DirectoryLookup ( string username, string password, Name name, string[] postcodes, string[] towns, Option[] options )

Description:

Searches the BT OSIS database and returns an array of DirectoryLookupResults that match the query. Due to licence restrictions, we can only return the first 200 matching results. Should you get an answer which has exactly 200 results then you would be best advised to narrow your criteria by selecting a more precise location or name.

The search criteria are handled with the following rules:

Name Restrictions

  • The surname can contain a wildcard (asterix *). If you do not specify one then it will not automatically add one.
  • A wildcard on the surname can only be added after 4 characters. (e.g smit*)
  • The Forename and MiddleName do not need to be specified, but if they are specified then they will further filter the results.
  • The Forename and MiddleName will automatically have a wildcard appended if they are just 1 character in length. (e.g. R will search for R*).
  • The Forename and MiddleName can have a manual wildcard added at any point (e.g. Rich*)

Location Restrictions

  • The location restrictions are specified by passing in an array of localities and/or (partial) postcodes.
  • As a minimum, you must specify at least one postcode or one location.
  • Any specified location must be listed in full and be contained within this location list.
  • Postcodes can be specified as a full postcodes or partial postcodes. Partial postcodes automatically have a wildcard appended on them.
  • Partial postcodes understand the hierarchical structure of a postcode. For example, specifying "B" (for Birmingham) does not include "BS" (for Bristol) despite the fact that they share the same first letter. Specifying "CH6" does not include "CH65".
  • Postcode lists are OR'd together. Location lists are OR'd together.
  • You can specify both a postcode list AND a location list - the results are AND'd together. For example "CH" and "LONDON" will return no records. "CH" and "CHESTER" will return records within CHESTER with a CH* postcode. It is generally not useful to specify both a Postcode list and a Location list.

View all Telephone Number Directory Methods

Code Samples

Language:

<!-- Import the Integr8 Ajax API -->
<script src="http://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key" type="text/javascript">
</script>

<script type="text/javascript">

function loadIntegr8() {
  // Load the TelephoneDirectory Integr8 service
  data8.load('TelephoneDirectory');
}

function DirectoryLookupSimple(forename, middleName, surname, postcodes, towns) {
  var telephonedirectory = new data8.telephonedirectory();
  
  telephonedirectory.directorylookupsimple(
    forename,
    middleName,
    surname,
    postcodes,