Receiving ERR_CONNECTION_REFUSED when trying to fetch autocomplete suggestions - here-api

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.

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

Related

Logic App Http POST request UnsupportedMediaType error

I am getting the following error in my logic app:
{ "type": "https://errors-api.cloud.com/common/unsupportedMediaType", "detail": "Content type '' not supported", "parameters": null }
The following is my set up:
This works in Postman.
However, I noticed that in the Logic App if I add in a text in the Body section. For example "body". It works fine
The Body is not needed in the Postman so it's confusing to me why it needed in Logic app. Anyone come across similar issue?
Issue is with content-type in your case. I have tried to reproduce issue from my side, but I did not get any error. I have found similar issue like you in link
Also, can you add Accept as shown below in header request,
Accept:*/*
I have created logic app as shown below,
In Get Bearer Token, getting access token from authentication url,
Using access token from Get bearer token getting data from api as shown below,
The logic app ran successfully,

How to implement a Google Cloud Platform (GCP) Authorization call via HTTP call in postman

I want to implement an HTTP call to Google Cloud Platform (GCP) to generate the Authorization token.
Cant find a the correct GCP documentation for the same as well.
Using the reference from below URL, I was able to generate a Authorizaton token from Postman, using postmans Authorization UI and not the HTTP call UI.
https://www.vulongtran.com/how-to-use-postman-with-google-cloud-platform-apis
And the call to GCP API are working using the token generated from above process.
I tried implementing the same call via HTTP POST request, but not getting expected result.
HTTP POST
URL - https://accounts.google.com/o/oauth2/token
Query param-
grant_type:authorization_code
redirect_uri:https://www.getpostman.com/oauth2/callback
Authorization -
Basic Auth
username -
password -
Headers -
scope:https://www.googleapis.com/auth/cloud-platform
redirect_uri:https://www.google.com
And the response that I get is
400 bad request
{ "error": "invalid_request", "error_description": "Missing required parameter: code" }
2nd Try-
Also tried sending the in the request BODY, like below, but the result was same.
{
grant_type:'authorization_code',
redirect_uri:'https://www.getpostman.com/oauth2/callback'
}
Response
{
"error": "invalid_request",
"error_description": "Missing required parameter: code"
}
I saw another page, where 'code' is used in the call. Dont know what language the code on that page is for.
But I am unable to figure out the correct HTTP call to get the token from there as well.
Google OAuth2: Required parameter is missing: grant_type

Using the Logic App HTTP connector, I get "BadGateway. Http request failed as there is an error getting AD OAuth token", when trying to call Graph API

I am trying to make an API call to Microsoft Graph using the Microsoft Logic App HTTP connector. The call fails with the error:
"BadGateway. Http request failed as there is an error getting AD OAuth token: 'Failed to extract error details from response content ''.'.".
I have been trying many things including being able to run the call successfully via Postman. I have decrypted the Postman token with jwt.ms and verified certain values such as:
"aud": "https://graph.microsoft.com",
"iss": "https://sts.windows.net/{{tenantId}}/",
I went through stacks of Google searches, and as for Stack Exchange, these are the closest matching posts that I could find.
Http request failed as there is an error getting AD OAuth token: 'AADSTS50001: The application named https://management.azure.windows.net
In this case the audience paramater was wrong, and in my case I have tried many, and not really sure anymore which is the correct one, even though none of them worked for me when tested.
Azure Logic App HTTP action authorization fails
The post deals with a shared key use case. My current requirement for this project is to use OAuth.
Secure access and data in Azure Logic Apps
I have tried the following for "Authority":
"authority": "https://sts.windows.net/{{tenantId}}/"
"authority": "HTTPS://login.microsoftonline.com/{{tenantId}}/"
"authority": "HTTPS://login.microsoftonline.com/{{tenantId}}/oauth2/v2.0/authorize"
This is the screen that shows the HTTP connector inside the logic app.
This is the same connector at runtime.
This is the raw HTML that the HTTP connector generates.
Hoping someone can spot where I am going wrong.

HERE.com Places API, "ApiKey is missing" error message, but it isn't

I've tried the below request (with two different proper API keys), on the HERE Places API, but I get an auth error.
Request:
https://places.sit.ls.hereapi.com/places/v1/autosuggest
?at=40.74917,-73.98529
&q=chrysler
&apiKey=g51V9*****N4-_GTA
Response:
401
{
"error": "Unauthorized",
"error_description": "ApiKey is missing."
}
I've also tried OAuth, I can get the request token, but when I use this for the places request I get an HTML webpage (for HERE place API) as the response, rather than an expected JSON or XML reponse.
Is anyone able to get any of the example requests to work for Places API?
I had this issue before aswell. Trying the exact same request as you, in Postman with my own apiKey, made the request successfull.
Try making the URL a single line, there might be newline characters hidden somewhere.
This has solved this issue for me many times using this API.
Example:
https://places.sit.ls.hereapi.com/places/v1/autosuggest?at=40.74917,-73.98529&q=chrysler&apiKey=g51V9*****N4-_GTA
You need to check the key name it may wrong
you should check it out into the documentation of api. and see key name
try key name apikey or api_key or api-key instead of apiKey
https://places.sit.ls.hereapi.com/places/v1/autosuggest
?at=40.74917,-73.98529
&q=chrysler
&apikey=g51V9*****N4-_GTA
Please refer to this guide for the updated list of domains to use with apiKey.
For places, the domain is: places.ls.hereapi.com
Disclosure: I'm a product manager at HERE Technologies
In my case I was using : https://github.com/julianshen/gin-limiter with the provided example

WSO2 ESB - HTTP 401 Unauthorized Error

I have been creating a Proxy service using service chaining mechanism.
1. First I make a call to an endpoint, get the result and send the result to a sequence.
2. In the sequence, I have a data mapper and then a property to specify the username and password to a secure endpoint and then send mediator to call an endpoint.
However, I have been getting the following error:
HTTPSender Unable to sendViaPost to url[endpoint Url] org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized,
With the description as "This request requires HTTP authentication"
The solution I have tried:
1. Tried adding a property "FORCE_HTTP_1.0" to true before making a call to the endpoint.
But nothing seems to work. Any help would be appreciated.
Thanks in advance.
If your backend requires Basic authentication, set the following property before your backend call.
Mmh seems like it's not possible to paste Code from my iPhone. Hope the link works.
https://docs.wso2.com/display/ESB470/Enabling+HTTP+Basic+Authentication+through+a+Proxy+Server
Just set the property "Proxy-Authorization"

Resources