The client library acts as a JavaScript wrapper for the Harmony RightAddress Services. The objects used by the library are JavaScript representations of those found in the Harmony RightAddress service API.
Name | Type | Description |
---|---|---|
Harmony.ENV_PREVIEW | Environment | The PREVIEW environment |
Harmony.ADDRESS | Field | The single-line Address field |
Harmony.ATTRIBUTES | Field | The Attributes field |
Harmony.BUILDING_NAME | Field | The Building Name field |
Harmony.CITY | Field | The City field |
Harmony.DISTRICT | Field | The District field |
Harmony.EID | Field | The Encrypted ID field |
Harmony.FULL_ADDRESS | Field | The Full Address field |
Harmony.ID | Field | The ID field |
Harmony.LOCALITY | Field | The Locality field |
Harmony.POSTAL | Field | The Postal field |
Harmony.POSTCODE | Field | The Postcode field |
Harmony.POSTCODE_LOCALITY | Field | The Postcode and Locality combined field |
Harmony.PROVINCE | Field | The Province field |
Harmony.SOURCE_OF_TRUTH | Field | The Source of Truth field |
Harmony.STATE | Field | The State field |
Harmony.STATE_TOWN_CITY | Field | The State and Town/City combined field |
Harmony.STREET | Field | The Street field |
Harmony.STREET_ADDRESS | Field | The Street Address field |
Harmony.STREET_NUMBER | Field | The Street Number field |
Harmony.SUBDWELLING | Field | The Subdwelling field |
Harmony.SUBURB | Field | The Suburb field |
Harmony.TOWN_CITY | Field | The Town/City field |
Harmony.AUSTRALIA | Locale | The Australian locale |
Harmony.NEW_ZEALAND | Locale | The New Zealand locale |
Harmony.INTERNATIONAL | Locale | The international locale except Australian and New Zealand |
Harmony.CORS | Protocol | Cross-Origin Resource Sharing (CORS) protocol |
Harmony.JSONP | Protocol | JSON with Padding (JSONP) protocol |
Harmony.AUPAF | Source of Truth | The Australian Postal Address Source of Truth |
Harmony.AUSOTS | Source of Truth | The combined Australian Source of Truth |
Harmony.GNAF | Source of Truth | The Australian Geo-coded Address Source of Truth |
Harmony.NZPAF | Source of Truth | The New Zealand Postal Address Source of Truth |
Harmony.NZAD | Source of Truth | It is a snapshot of addresses (at the time of the extract) that contains all addresses in New Zealand Post's National Postal Address Database (NPAD) |
Harmony.ERROR | Status | The error status |
Harmony.SUCCESS | Status | The success status |
Name | Description | Since |
---|---|---|
Harmony.address | Lookup addresses using a single-line input address. | 1.0.0 |
Harmony.buildingName | Lookup building names. | 1.0.0 |
Harmony.init | Initialises the client. | 1.0.0 |
Harmony.locality | Lookup localities. | 1.0.0 |
Harmony.postal | Lookup postal addresses. | 1.0.0 |
Harmony.postcode | Lookup postcode/locality combinations. | 1.0.0 |
Harmony.street | Lookup streets. | 1.0.0 |
Harmony.streetNumber | Lookup street numbers. | 1.0.0 |
Harmony.subdwelling | Lookup subdwellings. | 1.0.0 |
Harmony.suburb | Lookup suburbs. | 1.0.0 |
Harmony.townCity | Lookup towns and cities. | 1.0.0 |
Harmony.transaction | Indicate a transaction has been completed. | 1.1.0 |
Harmony.useEnv | Specify the environment to use. | 1.2.0 |
Harmony.useProtocol | Specify the connection protocol to use. | 1.3.0 |
Harmony.useFeatureOptions | Specify the feature options value to use. | 1.4.0 |
Harmony.Types.floorLevel | Lists the floor-level type data. | 1.0.0 |
Harmony.Types.postal | Lists the postal type data. | 1.0.0 |
Harmony.Types.street | Lists the street type data. | 1.0.0 |
Harmony.Types.streetSuffix | Lists the floor-level type data. | 1.0.0 |
Harmony.Types.unitFlat | Lists the floor-level type data. | 1.0.0 |
Harmony.Extensions.identify | Retrieves and provides additional data for an address. | 1.1.0 |
Harmony.International.address | Lookup international addresses using a single-line input address. | 1.6.5 |
Harmony.International.identify | Retrieves and provides additional data for an international address. | 1.6.5 |
Invokes the address service.
The following example performs a single-line address search for '1 abc street' in the AUPAF Source of Truth:
Harmony.address({ fullAddress: "1 abc street" }, Harmony.AUPAF, function(response) { if (response.status == Harmony.SUCCESS) { // Do something with the response payload. for (var i = 0; i < response.payload.length; i++) { var address = response.payload[i]; ... } } else { // Show any error messages. for (var i = 0; i < response.messages.length; i++) { alert(response.messages[i]); ... } } } );
Invokes the buildingName service.
The following example performs a search for building names beginning with 'anz':
Harmony.buildingName({ buildingName: "anz" }, Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Initialises the client.
The following example initialises the Harmony client with the credentials 'bob'/'password' and the Australian locale:
Harmony.init("bob", "password", Harmony.AUSTRALIA);
Invokes the locality service.
The following example performs a search for localities beginning with 'syd':
Harmony.locality({ locality: "syd" }, Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the postal service.
The following example performs a search for postal addresses in the 'Sydney' locality (postcode '2001') beginning with 'gpo box 1':
Harmony.postal({ postcode: "2001", locality: "sydney", postal: "gpo box 1" }, Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the postcode service.
The following example performs a search for locality/postcode combinations for the postcode '2000':
Harmony.postcode({ postcode: "2000" }, Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the street service.
The following example performs a search for streets in the locality 'sydney' (with postcode '2000') beginning with 'geor':
Harmony.street({ postcode: "2000", locality: "sydney", street: "geor" }, Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the streetNumber service.
The following example performs a search for street numbers in the locality 'sydney' (with postcode '2000') on the street 'george st' beginning with '22':
Harmony.streetNumber( { postcode: "2000", locality: "sydney", street: "george st", streetNumber: "22" }, Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the subdwelling service.
The following example performs a search for subdwellings in the locality 'sydney' (with postcode '2000') at number '220 on the street 'george st' beginning with '202':
Harmony.subdwelling( { postcode: "2000", locality: "sydney", street: "george st", streetNumber: "220", subdwelling: "202" }, Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the suburb service.
The following example performs a search for suburbs beginning with 'wellin':
Harmony.suburb({ suburb: "wellin" }, Harmony.NZPAF, function(response) { // Perform any action with the response ... } );
Invokes the townCity service.
The following example performs a search for towns and cities beginning with 'wellin':
Harmony.townCity({ townCity: "wellin" }, Harmony.NZPAF, function(response) { // Perform any action with the response ... } );
Invokes the transaction service.
The following example invokes transaction
with no callback:
Harmony.transaction(Harmony.AUPAF);
Specifies the non-production service environment to be used for the requests. The default environment is Production.
The following example configures the Harmony client to use the PREVIEW environment:
Harmony.useEnv(Harmony.ENV_PREVIEW);
Specifies the protocol to be used for the service requests. The default protocol is Cross-Origin Resource Sharing (CORS).
The following example configures the Harmony client to use the JSONP protocol over GET requests:
Harmony.useProtocol(Harmony.JSONP);
Specifies the FeatureOptions value when invoking the address lookup REST service methods.
The following example configures feature options for address lookup service methods:(Only need to specify the option value if want a different value from system default)
Harmony.useFeatureOptions({singleLineHitNumber:'10', displayGnafLot: 1, exposeAttributes:'1', exposePhantom:'0'});
Invokes the floorLevel types service.
The following example retrieves the floor level types:
Harmony.Types.floorLevel(Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the postal types service.
The following example retrieves the postal types:
Harmony.Types.postal(Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the street types service.
The following example retrieves the street types:
Harmony.Types.street(Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the streetSuffix types service.
The following example retrieves the street suffix types:
Harmony.Types.streetSuffix(Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the unitFlat types service.
The following example retrieves the unit/flat types:
Harmony.Types.unitFlat(Harmony.AUPAF, function(response) { // Perform any action with the response ... } );
Invokes the identify extension service.
The following example identifies the input address with EID 'wAcKtCUXx5glttrgaxxY1l6S5LEZrjIE':
Harmony.Extensions.identify({ eid: "wAcKtCUXx5glttrgaxxY1l6S5LEZrjIE" }, function(response) { // Perform any action with the response ... } );
Invokes the international address lookup service.
The following example performs a single-line address search for '1 abc street' in Canada:
Harmony.International.address({ fullAddress: "1 abc street", country: "CA"}, function(response) { if (response.status == Harmony.SUCCESS) { // Do something with the response payload. for (var i = 0; i < response.payload.length; i++) { var address = response.payload[i]; ... } } else { // Show any error messages. for (var i = 0; i < response.messages.length; i++) { alert(response.messages[i]); ... } } } );
Invokes the international address retrieve service.
The following example identifies the input address with id 'CA|CP|A|494524':
Harmony.International.identify({ id: "CA|CP|A|494524"}, function(response) { if (response.status == Harmony.SUCCESS) { // Do something with the response payload. for (var i = 0; i < response.payload.length; i++) { var address = response.payload[i]; ... } } else { // Show any error messages. for (var i = 0; i < response.messages.length; i++) { alert(response.messages[i]); ... } } } );