Deprecated JS Library v2.0.1
Last updated
Last updated
This method has been deprecated. Please use current version for new implementations.
JavaScript client is a JavaScript library that can be included on a web page, allowing website users to connect directly to the Harmony API services without any server-side processing requirements. For versions earlier than 1.8.0 please refer to for code snippet.
For the best experience, we recommend you to use the latest versions of your favourite browsers.
As of version 1.3.0, the Harmony RightAddress JavaScript client can be configured to use either Cross Origin Resource Sharing (CORS) or JSON with Padding (JSONP). CORS is preferable for modern browsers.
Please note that IE 11 will no longer be supported by Microsoft after August 17th, 2021.
UsernamePasswordAddress Id
Copy and paste the following code snippet into your web page.
Before you can use the Harmony RightAddress client, you must make sure you have:
An active Harmony RightAddress account
A Harmony RightAddress username and password for your domain
A proficiency in JavaScript
The versions of the JavaScript client can be downloaded using the following link:
For any earlier versions of client please contact us.
Before making service requests, the client must be initialised. This is done by invoking the init
method on the global Harmony
object:
This method must be called before any other methods are invoked on the Harmony
object.
During initialisation, the client environment is set to Production and the protocol is set to CORS. To use the Production environment or the JSONP protocol, the useEnv
and useProtocol
methods can be used.
Once the Harmony RightAddress client has been initialised, any methods available to the supplied user can be invoked. These methods are invoked using the global Harmony
object.
The following example invokes the find
method with the single-line address '1 abc street' in Canada. The callback method then output the addresses in a textarea with the id 'output':
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
Finds a list of international addresses based on the input address and country information
1.8.0
Retrieves and provides additional data for an international address.
1.8.0
Reverse geocode lookup for international addresses based on the input latitude and longitude. It has more options for Australia and New Zealand addresses.
1.8.0
Initialises the client.
1.0.0
Specify the environment to use.
1.2.0
Specify the connection protocol to use.
1.3.0
Specify the feature options value to use.
1.4.0
Parses a free-form address string.
1.1.0
International reverseGeocode lookup based on the input latitude and longitude.
1.8.0
Retrieves and provides geocode information for international addresses.
1.8.0
Validates an email address.
1.2.0
Validates a mobile phone number.
1.2.0
Look up ABN.
1.6.0
Type: AddressThe input Address object.
Type: StringThe Source of Truth to use for overriding default SOT for Australia or New Zealand address lookup. It is Optional.
Type: FunctionThe function that will be invoked when the service response is received.
The following example performs a single-line address search for '1 abc street' in Canada:
Type: AddressThe input Address object.
Type: FunctionThe function that will be invoked when the service response is received.
The following example identifies the input address with id of the address from the above find API.
Type: AddressThe input Address object.
Type: StringIt is optional for Australia and New Zealand. If value is specified it will only reverse geocode lookup for this country only.
Type: FunctionThe function that will be invoked when the service response is received.
The following example performs a combined reverseGeocode lookup:
Initialises the client.
Type: StringThe username used to connect to Harmony RightAddress.
Type: StringThe password used to connect to Harmony RightAddress.
Type: StringThe locale used when connecting to Harmony RightAddress.
The following example initialises the Harmony client with the credentials 'bob'/'password' and the Australian locale:
Specifies the non-production service environment to be used for the requests. The default environment is Production.
Type: StringThe non-production service environment to use.
The following example configures the Harmony client to use the PREVIEW environment:
Specifies the protocol to be used for the service requests. The default protocol is Cross-Origin Resource Sharing (CORS).
Type: StringThe protocol to use.
The following example configures the Harmony client to use the JSONP protocol over GET requests:
Type: String or FeatureOptionThe option values when invoking the address lookup REST service methods. Only need to specify it if you want a different value from the default value.
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)
Type: String or AddressThe input address String or the input Address object. The Address object input only available for harmony.min.js since version 1.6.0.
Type: FunctionThe function that will be invoked when the service response is received.
The following example parses the input address '220 george street, sydney 2000' as a String:
The following example parses the input address '220 george street, sydney 2000' in an Address object (only available for harmony.min.js since version 1.6.0):
Type: AddressThe input Address object.
Type: FunctionThe function that will be invoked when the service response is received.
The following example performs the international reverseGeocode lookup:
Type: AddressThe input Address object.
Type: FunctionThe function that will be invoked when the service response is received.
The following example get geocode information for an Australia Address:
Type: String or EmailAddressThe input email address as a String or the input EmailAddress object. The EmailAddress object input only available for harmony.min.js since version 1.6.0.
Type: StringThe Source of Truth to use for the validation - optional. The default Source of Truth is VE_ALL.
Type: FunctionThe function that will be invoked when the service response is received.
The following example performs a validation on the email address 'bob@example.org' as a String in VE_ALL Source of Truth:
The following example performs a validation on the email address 'bob@example.org' in an EmailAddress object in VE_ALL Source of Truth (only available for harmony.min.js since version 1.6.0.):
Type: PhoneThe input phone object containing a number and country code.
Type: FunctionThe function that will be invoked when the service response is received.
The following example performs a validation on the mobile phone number '0412341234' for Australia:
Type: StringThe input company name for lookup/validation
Type: StringThe name of the API used for lookup, for example "SearchByABNv201408", "SearchByASICv201408", and etc.
Type: StringThe optional configuration
Type: StringYou only need to specify this value if you want to use your own guid, otherwise, use null or empty string as the value.
Type: FunctionThe function that will be invoked when the service response is received.
The following example performs a lookup on the company name 'mastersoft':
See thedocumentation for details on invoking the other Harmony API service methods.
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 .
It is recommended to use the current Javascript Client Address lookup methods. However is still available.
Invokes the service.
Invokes the service.
Invokes the service to get addresses with input latitude and longitude
Specifies the value when invoking the address lookup REST service methods.
Invokes the parse service.
Invokes the service to get addresses with input latitude and longitude
Invokes the service.
Invokes the validate service.
Invokes the validate service.
Invokes the service. The following are the explanations of the parameters used. Please refer to for more details.