getting REQUEST_DENIED ("This service requires an API key.") but no error in the API console - google-places-api

I just added Google Places API Web Service to my project, added an API key (unrestricted, for testing) and I am copy pasting requests from the docs to try things out, for example:
curl https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=my_new_key
I only get Request Denied ("This service requires an API key."), but in the API console I do not see any errors. The key is really in the curl command line in my sample, the API is enabled in the console, the key is valid and not restricted. I cannot find a reason why this should not work?

Here are few things you could try...
API key is for the application but you should authorize that application in google before using it.
Check your API key again and see if theres any encoding required before using it.
Enable API from your google account.
See if theres any restriction on your API key for example :
Under Accept requests from these server IP addresses, enter the IP
addresses from which your key is to be accepted, one per line. You
may also enter a subnet using CIDR notation (e.g. 192.168.0.0/22).
Hope this helps..
Try this link.... very helpful
REQUEST DENIED with Google Places API KEY for Server Web used in an Android application

Related

OAuth Google API Google Classroom

Hi I am trying to run the sample Quickstart code inorder to use the google classroom API. It seems the HTTP batch in the code is starting a server on a random port. When I tried to run the code, it opens my browser for authentication. But there is a 404 message saying that the redirect URI is not that of authorised client. If the port number keeps changing, how can I add a particular authorised client in my Developer Console for the credentials?

YouTube v3 API error: ipRefererBlocked

I am attempting to add a YouTube video feed to a website.
I have created the Project and turned on the YouTube data API in the developers console.
I have created a browser key and added the domain to the list of referrers as *.domain.com/ as per their example. I've also tried http://domain.com & domain.com as variations
If I remove the referrer, it works. Otherwise, I get this error message:
There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.
What am I doing wrong?

Issues registering my application API on google OAuth 2.0

I am trying to add an google drive account using google api's to Owncloud, but following the instructions in http://doc.owncloud.org/server/5.0/admin_manual/configuration/custom_mount_config_gui.html
always fails
I have tried
https://bytenix.net/owncloud/index.php/settings/personal or the same on http
as the Web Origin but i always get "Error
Invalid web origin." on the Google cloud console page. The same applies for the destination, if i try using bytenix.net with https or http as Origin and works fine, but that is not what i want obviously. So what could be going wrong?
It could be because there are two options, 'Web Origins' and 'Authorised Redirect URLs'.
The 'Web Origins' is for the domain name e.g google.com.
The 'Authorised Redirect URLs' are the completed path (domain name
included) e.g. google.com/redirect/to/this/path
Sorry for replying to an old post, but you can try solution (for localhost) described here:
https://developers.google.com/+/quickstart/javascript
It should works fine, at least in my case did.

Google places API - 'REQUEST_DENIED' when using server-side proxy on EC2

I'm stuck trying to get an API call to Google Places working. I'm using a server-side PHP proxy for the request - not because I want to, but because it's part of JQuery-POI-Mapper.
The server I'm using is an Amazon EC2 server without a static IP address. I'm out of stactic IP addresses at the moment, but I'll take the time to request more if people think that's the problem. I identified the current public IP address of my EC2 server by running this command on the server:
curl http://169.254.169.254/latest/meta-data/public-ipv4
Next, I went to https://code.google.com/apis/console and created a new API key. I selected a server-side API key and used my EC2 server's public IP address.
Under the services tab, I enabled every related API I could think of, including:
Google Maps API v2
Google Maps API v3
Google Maps Gelolocation API
Places API
Static Maps API
Here's a screen capture of my Services:
The proxy code running on the EC2 server is part of a commercial package, so I shouldn't post the entire code, but it's very short, and the important part is:
$json = file_get_contents($url);
The $url variable in my case was:
https://maps.googleapis.com/maps/api/place/search/json?location=-37.7133771,145.14891620000003&radius=2000&types=bakery&sensor=false&key=AIzaSyCCUV...
The response I get is:
{
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
I checked to see if I had gone over my quota already, but everything looks OK. What's interesting is that Google is showing that I had made requests to the Places API today, so Google definitely knows that the requests are coming from me.
Here's a screen capture of my API Traffic Report, which is all from testing:
Any advice would be much appreciated.
Thanks,
Bret
You need a Static IP address to successfully use IP Locking with a Server API Key.

Using Ruby to authenticate to Azure (HTTP Header authentication)?

Since the Google Search API has been deprecated, I'd like to use the Bing Search API (now a Windows Azure API) in my Ruby apps.
However, Azure has a strange authentication pattern where you build a query URI, paste it into a browser, pass the key into the password box of the standard HTTP authentication box, and make POST to see the results. I assume this generates a signature and passes it in the header somehow. I'd like to do the complete process in Ruby and skip the browser portion if possible.
I found one example in the source of an obscure Windows Azure storage gem, but I can't figure out how tthey're building the signature and make the call. Is there a simple way to do basic HTTP auth in Ruby?
I went ahead and used Faraday's built in basic authentication scheme like so:
connection = Faraday.new "http://api.something.com/1/dudez"
connection.basic_auth "username" "password"
connection.get
I want to recommend the RestClient gem for this. I've used it with great success for GET'ing and POST'ing across domains. If you really have to act like a browser to implement the API, you can always use Capybara.
I'm sorry I haven't tried the Azure API myself, or I would give an example. :)
I recall doing this previously with another Azure API but am unable to find the code.
Look here for the details of the signature process:
http://msdn.microsoft.com/en-us/library/windowsazure/ee395415.aspx
I'm unable to find immediately if the Azure API uses the SharedSignature method
The way to sign a request to Windows Azure blob storage thru the REST API is described here: http://msdn.microsoft.com/en-us/library/dd179428.aspx.
Basically, you don't authenticate by simply adding some credentials in a HTTP header, you have to sign your request with the secret key that is associated to your storage account.

Resources