here-apihere-maps-rest

Receiving ERR_CONNECTION_REFUSED when trying to fetch autocomplete suggestions


I have an registered account with the here-api's and just today created a new apiKey, because we where still using the old authentication method. No matter what authentication we use though, we receive an ERR_CONNECTION_REFUSED error when trying to access the suggestion.json-endpoint. Other endpoints work fine. I.e. this request works fine:

https://geocoder.ls.hereapi.com/6.2/geocode.json?searchtext=200%20S%20Mathilda%20Sunnyvale%20CA&gen=9&apiKey={API_KEY}

but this fails:

http://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json?query=Pariser+1+Berl&beginHighlight=<b>&endHighlight=</b>&apiKey={API_KEY}

using, the same API key obviously, with the aforementioned ERR_CONNECTION_REFUSED error.

What's also confusing me is that removing a character from the apiKey in the first request leads to a senseful response

{
  "error": "Unauthorized",
  "error_description": "ApiKey invalid. ApiKey not found."
}

Whereas doing this in the second request still just returns the ERR_CONNECTION_REFUSED error.


Solution

  • Could you please try to use https instead of http in your request as -

    https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json?query=Pariser+1+Berl&beginHighlight=<b>&apiKey=apikey
    

    As Example for Javascript is also using https and which is working.

    https://developer.here.com/documentation/examples/rest/geocoding_suggestions