I'm developing an application in JAX-RS on a Heroku server but I've run into issues making calls to the Google Books API from the server. I've been using the Java libraries provided by Google to make these calls and on some occasions it works but for the most part it returns this error
403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Cannot determine user location for geographically restricted operation.",
"reason" : "unknownLocation"
} ],
"message" : "Cannot determine user location for geographically restricted operation."
}
I suspect that this issue is related to the dynamically generated IP address system Heroku uses for routing since the Google server is having issues detecting the origin of the API calls. How would I approach working around this? Is there any way for Heroku to use static IP addresses or could I use a proxy to act as the sole access point for the API?
Just realized that this can be resolved with adding a country code to the Google Books query (&country=US) or adding a x-forwarded-for header from the original HTTP request.
http://productforums.google.com/forum/#!topic/books-api/7FQ-622q-jI
Thanks a lot for the question ... and the answer :)
Just to add that it seems there is a way for Heroku to use static IP address with Proximo
Related
I try to follow this :
https://developers.google.com/sheets/api/quickstart/js
to learn how to use the Google Spreadsheets API.
I have been careful to follow the directions but I must have missed something, since I get the following result :
"error": "idpiframe_initialization_failed",
"details": "Not a valid origin for the client: http://localhost:8000 has not been registered for client ID <YOUR_CLIENT_ID>. Please go to https://console.developers.google.com/ and register this origin for your project's client ID."
I declared http://localhost to be authorised origin for my client_id ...
I tried in vain all the suggestions given here :
Google Tag Manager API error "Not a valid origin for the client: http://localhost has not been whitelisted for client ID
Can someone tell me where this error might come from ?
I'm encountering this error after hooking up SparkPost and Laravel. I only want to deploy this application locally for development purposes (localhost). And I don't have any domain at the moment. Does this error have to do with domain setup? Thanks and guide me please.
The error I'm seeing is this:
Client error: POST https://api.sparkpost.com/api/v1/transmissions
resulted in a 400 Bad Request response: { "errors": [ { "message":
"Invalid domain", "description": "Unconfigured Sending Domain
", "code": "7001" (truncated...)
Refer to the image to find how to add a sending domain. After adding, please verify it.
As you said you only want to send email for development, you can use a simple smtp or even the native php mail driver provided by laravel. With Parkpost API, you definitely need a working domain name.
If you don't want to use built in Laravel mail facade then you can use beautymail package.
Here is the link for all supported email packages - http://packalyst.com/packages/tag/email
Go for the maximum downloaded package ex - beautymail package
How to use Google API Explorer?
https://developers.google.com/apis-explorer/#p/plusDomains/v1/plusDomains.people.get
I would like test Google+ Domains API and even via API Explorer I receive 403 error:
{
"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."
}
}
This is an app settings issue in the Google Developers Console. On the credentials screen it lists the IPs that are allowed to use the API Key. It's a security precaution to help protect the key if it leaks.
As the picture
You need to edit allowed IPs to either be empty (less secure) or update it to include the actual IP of your server.
As the picture
The google verification api is giving me a 503 error "An unexpected error occurred. Please try your request again." whenever I try to verify a domain using the TAG_MANAGER method.
This occurs when I try to use the API via the PHP client library and also when I use Google's API explorer. However, if I log in to Google Webmaster Tools and add the site, using Tag Manager as the verification method, I am able to successfully verify myself.
I've attached debugging information from the API explorer below, but it's very light on detail. My support request in the webmaster central forum has been met with deafening silence, but I'm not sure where else to ask.
Request
POST https://www.googleapis.com/siteVerification/v1/webResource?verificationMethod=TAG_MANAGER&key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.iAC-QBa-7nzvS2lpFFmfcej2Y0suhiWHgS8SivKN9jpYWffljsRV7rbL
X-JavaScript-User-Agent: Google APIs Explorer
{
"site": {
"identifier": "http://unit1-28leanyerdriveleanyer.com",
"type": "SITE"
},
"owners": [
"loboyle#raywhite.com"
]
}
Response
503 Service Unavailable
- Show headers -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "An unexpected error occurred. Please try your request again."
}
],
"code": 503,
"message": "An unexpected error occurred. Please try your request again."
}
}
https://www.googleapis.com/siteVerification/v1/webResource?verificationMethod=TAG_MANAGER&key={YOUR_API_KEY}
may need to be
https://www.googleapis.com/siteverification/v1/webResource?verificationMethod=TAG_MANAGER&key={YOUR_API_KEY}
also, a few additional notes
For Google to use your Google Tag Manager container snippet code for Webmaster Tools verification, the code must be placed immediately after the opening tag of your page.
The method you provided is used for verifying a site or domain, be sure you intend to verify a site, because this is what your request currently contains.
This method requires you to be authenticated (OAuth 2.0)
http://code.google.com/apis/accounts/docs/OAuth2.html
Ensure you have visited the following link
http://www.google.com/tagmanager/features.html
I finally stumbled across the fix for this today. The problem was that the service account running the requests needs to have "View and Manage" permissions on the applicable Tag Manager account, not just on the container that is actually being used. Only view access is required to the actual container.
While this isn't exactly desirable (we have 20+ containers for different sites/applications within the one account), it does resolve the problem and allow the Tag Manager site verification to work as intended.
I'm not sure whether the documentation has been changed since I originally had this problem or whether I just missed it. The required permissions are unexpected and the response code is misleading (a 403 would make more sense).
Check if you've enabled "Maintenance Mode" on your domain you're trying to verify using Google. Disable it and you're done.
There seems to be some confusion as to what is causing an error with Google Places API and using JSON as the output.
For example, the output (when pasting the URL into the address abr of your browser returns this:
{
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
At first, I thought this may have something to do with my API Access Status set to 'Inactive' but after reading several posts here on SO...
REQUEST_DENIED Google Maps API v3 Places Error
Google Places API - REQUEST_DENIED
REQUEST_DENIED when using the Google Places API
...I am none the wiser. The aim of this post/thread is to try establish exactly the capabilities of Google Places API, whether or not the API Key is required, and why REQUEST_DENIED occurs so often for many users.
"status" : "REQUEST_DENIED" is returned when:
The sensor parameter is missing
The key parameter is missing
The sensor parameter is not set to true or false
There is a problem with the key parameter e.g.
You have not activated the Places API Service in your APIs Console Services Tab
Your API Key does not match the key in your APIs Console API Access Tab
Your API key has been compromised and blocked; you can generate a new API key in your APIs Console API Access Tab
The request is not sent as a HTTPS GET request
HTTPS is required for all Places API Web Service request
POST requests will only work for Places API Place Actions e.g Check-In and Event requests