I'm getting this message when using Google custom search API. I got both API key(server and browser) and search ID.
Why it says usageLimits? The constraints is 100 queries per day, but i ran the program way less than 100 times....
Where is going wrong... please help!!
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "ipRefererBlocked",
"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.",
"extendedHelp": "https://console.developers.google.com"
}
],
"code": 403,
"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."
}
I think your API key or CX parameter could be wrong.
Go to the custom search engine editor and recopy the values.
Make sure you have added some sites to search.
Try the link on the right hand pane to test your custom search engine works.
Related
I am simply trying out curl examples from the GDrive API Explorer, specifically this call:
https://developers.google.com/drive/api/v3/reference/files/list
However when I copy the example and execute it with my API key, I get this error:
curl https://www.googleapis.com/drive/v3/files?key=AIzaSyCQfFNMxHVJRaTvXXXXXXXXXX
{
"error": {
"errors": [
{
"domain": "global",
"reason": "insufficientFilePermissions",
"message": "The user does not have sufficient permissions for this file."
}
],
"code": 403,
"message": "The user does not have sufficient permissions for this file."
}
}
When I try to get a single file using files/{fileId} with the same API key, it works fine and the file metadata is returned.
What is the deal here? Does listing require special permissions, or does API keys have limitations, or..?
Just a hunch, you are trying a file that is not public, that is why you are receiving 403:insufficientFilePermissions. To access this you must authenticate your request using OAuth 2.0.
You can check the documentation About Authorization:
Your application must use OAuth 2.0 to authorize requests. No other
authorization protocols are supported. If your application uses Google
Sign-In, some aspects of authorization are handled for you.
I am trying to use Google Custom Search API
I followed Custom Search doc, i am done with the Control panel stuff and got the Search Engine ID as well, IMplemented API and got the API key from the developer console
Public API Access Key - AIzaSyC0m8w-NEP3yrKolboNbPLbhlhmHJc_cB0
Search Engine ID - 005717290701474541337:1mc_u_r_i94
https://www.googleapis.com/customsearch/v1?&key=AIzaSyC0m8w-NEP3yrKolboNbPLbhlhmHJc_cB0&cx=005717290701474541337:1mc_u_r_i94&q=paris
and after making the above request , i got this result
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. The API is not enabled for your project, or 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 configuration.",
"extendedHelp": "https://console.developers.google.com"
}
],
"code": 403,
"message": "Access Not Configured. The API is not enabled for your project, or 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 configuration."
}
}
I am not getting the expected results, so please help..
Thanks
Everything seems to be ok, it might be an API key Issue.
Try to create an API key for browser it might work
I am using Google Maps APIs for business to get location against Cell IDs and MAC addresses of WiFi access point.
That code was working fine on beta server. Now as I moved to production server, I am getting following response
{ "error": { "errors": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." } ], "code": 403, "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." } }
In console, Beta server IP was added in allowed IPs. I have added production server IP as well. Still getting above response.
Do I need to generate new key after change in allowed IPs or any other change?
The message is self-explaining activate the API for your project
Go to the console, select the desired project(when you have multiple projects), go to APIs & auth ->API's and activate the service Google Maps Geolocation API
I am working with a Ruby project to use Google's geolocation API. When I try to use an API key I receive the following error:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceeded",
"message": "Daily Limit Exceeded"
}
],
"code": 403,
"message": "Daily Limit Exceeded"
}
}
I have used the same Google project and API with success a couple of months ago but cannot seem to get it working now.
Relevant details and troubleshooting efforts:
The quotas page currently shows only 25 out of 100 requests used.
I have validated that billing is enabled.
I have validated that the 'Google Maps Geolocation API' is enabled in Services.
I have validated that the Referer on the Browser key is set to 'Any referer allowed'
I have issued a new Browser key, no change.
I have tried converted to a Server API key, no change.
I have destroyed the project, created a new one, enabled the Geolocation API in service, enabled billing, and issued a new key, no change.
I have used invalid keys, no keys, and invalid JSON and verified that the resulting error messages are appropriate.
I have attempted requests from a different machine with a different public IP.
I have used the CURL testing example at https://developers.google.com/maps/documentation/business/geolocation/#sample-requests to remove my application as the source of the issue.
curl -d #test.txt -H "Content-Type: application/json" -i
"https://www.googleapis.com/geolocation/v1/geolocate?key=MYAPIKEYHERE"
Any feedback on this would be appreciated.
Suddenly today requests from my service attempting to insert a file into Google drive via the Drive API started to receive a 400 error. The error indicates that a registered app is required, full error below. An application was already registered in my Google Cloud console, however the applications name did not match the application name that was used by my service. I renamed the services application name, however the error continues.
400 Bad Request
{
"code": 400,
"errors": [
{
"domain": "global",
"message": "Registered app required, either through authentication token or key param.",
"reason": "required"
}
],
"message": "Registered app required, either through authentication token or key param."
}
Is there something else that needs to be setup, or could this be a delay in the renaming of the service?
EDIT: I'm able to list, update and download files however I cannot insert.
This same issue just started to happen to us today - and we made no changes. I (think I) submitted a bug report to Google about this. Will keep digging..
UPDATE: I created a new project with private key and client ID/email and I get the same error with this new project as well. This appears to be some bug with Google Drive API service.
It happens today on my app too. I guess their service is having problem today