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

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

Related

Bearer token invalid on here fuel prices API even though apikey is included as parameter

I am new to Here and am trying to make my first API call but I keep getting back this error:
{"Type":"Unauthorized","Message":["Bearer token invalid. Bearer missing or bearer value missing."]}
Here's the URL that I'm using to call the API:
https://fuel-v2.cc.api.here.com/fuel/stations.json?apiKey=${hereApiKey}&prox=${lat},${lng},1600
I have also tried including the api key in an authorization header and get the exact same thing. I've tried with apikey= and apiKey= and the results are the same. I've also tried moving the apikey param to after the prox param (though I know that shouldn't matter). I feel like I'm following the documentation when it says that I can use api key authentication for this call and that app code authentication is deprecated, so I'm not sure what I'm doing wrong.
I am currently on a Here Freemium plan and making this call from a Node JS server application.
The token expires in 24 hours, you need to generate a new token and test again
In order to use OAuth token authentication please use the below request
https://fuel-v2.cc.ls.api.here.com/fuel/stations.xml?prox=52.516667,13.383333,5000
And in header please include
Authorization = Bearer "Oauth token"
other way to include the token is -
https://developer.here.com/documentation/fuel-prices/dev_guide/topics/request-here-environments.html

APIKey Authentification missing for /transit/Departures v8

I am having trouble using the "Next Departures" call as described here:
https://developer.here.com/documentation/public-transit/api-reference-swagger.html
I clearly states that an authentification via APIKey should be possible, however I always get an
"Bearer token invalid. Bearer missing or bearer value missing."
All other calls to the api work fine with my APIKey methode, also if I generate a Bearer Token and use this, it works. However generating a Token that expires for just this call, is not my preferred method.
As the documentation also includes the APIKey method, I guess this is a bug, or I am doing something wrong?
Thanks
You need to enter “&apikey” (all small letters) and it will work.

Retrieve UGC Posts through LinkedIn V2 API got ClassCastException error

I'm trying to retrieve a list of UGC posts by calling the following API
https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List%28urn%3Ali%3Aorganization%3A[ORG_ID]%29
[ORG_ID] is id of my organization. Then I got this error
{
"serviceErrorCode": 0,
"message": "java.lang.ClassCastException: java.lang.String cannot be cast to com.linkedin.data.DataComplex",
"status": 500
}
I've already authorized to use API V2 and include X-Restli-Protocol-Version:2.0.0 in the header.
I was having issues with this too, the parens on the authors query param shouldn't be encoded.
I.e., try:
https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn%3Ali%3Aorganization%3A[ORG_ID])
I tested it with the URL mentioned https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn%3Ali%3Aorganization%3A[ORGANISATION ID]) and it works but make sure you set the header.
X-Restli-Protocol-Version: 2.0.0
I had to do this manually however since postman apparently doesn't work and perhaps other http tools are having similar issues.
https://github.com/postmanlabs/postman-app-support/issues/5752
The error returned by postman is the following or if you forget to include the header above: {"serviceErrorCode":0,"message":"java.lang.ClassCastException","status":500}

Withings API No Response on request_token

I have setup everything as described in the steps in answer to the post withings api authentication.
However, when i copy and paste the final URL generated in Step 2 (Send request to the URL:), I get no response on my browser and the screen remains empty.
Is there any reason for why it might be happening ?
OAUTH TOKEN and OAUTH SECRET - will I get two of them appended to callback url ?
Each paramter string was supposed to be URL encoded in signature i.e URLEncoder.encode("key=value","UTF-8")
I have used temboo API to get the user tokens.
They have two steps Initial oauth and final oauth.

400 bad request when requesting Facebook access token

I'm getting a 400 bad request error from Facebook when requesting an access token. My return_uri includes a query string parameter which is causing the problem. I've encoded the return_uri but I stil get the error. Can anyone help me with this?
Here is the request I'm sending to Facebook:
"https://graph.facebook.com/oauth/access_token?client_id=IDb&client_secret=SECRET&redirect_uri=http%3a%2f%2fexample.com%2fOAuthHttpHandler.ashx%3fReturnUrl%3d%2fpage.aspx&code=CODE"
I'm getting an "Error validating verification code." error message.
I've done a little more digging and found that the redirect_uri below works fine:
"http://example.com/OAuthHttpHandler.ashx?ReturnUrl=page.aspx"
But if I pass across a return url of "/secure/page.aspx" validation fails. I've tried encoding the forward slashes but no luck.
Unfortunately, the Facebook Oauth implementation doesn't handle url parameters in the return_uri querystring well, even when they are correctly encoded. There are several threads in the fb developer forums discussing this issue:
http://forum.developers.facebook.net/viewtopic.php?pid=237845
http://forum.developers.facebook.net/viewtopic.php?pid=239866
http://forum.developers.facebook.net/viewtopic.php?pid=255231
Until its fixed on their end, you'll have to use an alternative method of passing state: session, cookie, or building a simple page-specific identifier into the url.
After hours of searching around I finally found a good solution to the facebook access_token request returning "Bad Request 400".
The return_uri param sent to "https://graph.facebook.com/oauth/access_token" must be exactly the same uri as the one sent "to https://graph.facebook.com/oauth/authorize"
What I did was just replace the slashes with dashes when I send 'em to facebook. Then on the callback, replace the dashes with slashes again!

Resources