0

I have been trying to get the location from zip code, but I am getting this error in the console

Uncaught SyntaxError: Unexpected token '<'
geocode.component.ts:33 Error: [timeout] https://geocoder.api.here.com/6.2/geocode.json?xnlp=CL_JSMv3.0.17.0&app_id=null&app_code=null&searchText=boston request failed
    at Object.Zc (eval at <anonymous> (mapsjs-core.js:56), <anonymous>:11:176)
    at b (eval at <anonymous> (mapsjs-core.js:56), <anonymous>:9:440)
    at eval (eval at <anonymous> (mapsjs-core.js:56), <anonymous>:10:43)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
    at Object.onInvokeTask (core.js:26247)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
    at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:498)
    at ZoneTask.invoke (zone.js:487)
    at timer (zone.js:3070)

On clicking this, it is shown Invalid credentials. What should be done?

  • 1
    Hi, welcome to SO! Please add the relevant code which makes the api call. It will make it easier for others to understand your problem. – Chiel Jun 17 '20 at 15:17
  • "app_id=null&app_code=null", seems missed the values needed. Please check if valid credentials are provided to the api call. –  Jun 18 '20 at 00:05

1 Answers1

0

You need to include your API key.

https://geocoder.ls.hereapi.com/6.2/geocode.json?apiKey={YOUR_API_KEY}&searchtext=425+W+Randolph+Chicago

For more on creating an API key for the here api, check out the docs.

Matt Croak
  • 2,788
  • 2
  • 17
  • 35