nl_tokens: class Sapi
pl_tokens: function Sapi ( key , opts ) { opts = opts || { } ; function _authRequire ( result , cb ) { // SAPI does not differentiate required authentication and failed authentication // since both return status code 403, need to check key param existence to differentiate the two if ( key ) { cb ( new Error ( 'Authentication failed -  invalid key ' + key ) ) ; } else { cb ( new Error ( 'Authentication required - set API key in Sapi constructor' ) ) ; } } this . params = { <mask> : key } ; this . url = ( opts . url || 'http://api.sensis.com.au/ob-20110511/test' ) . replace ( / \/$ / , '' ) ; this . opts = { handlers : { 403 : _authRequire } } ; }