Google-api-javascript-client: https://content-translation.googleapis.com/static/proxy.html returns 404 when doing gapi.client.language.translations.list

Created on 28 Aug 2020  路  9Comments  路  Source: google/google-api-javascript-client

Here is the issue we have when we are using google translate API, we have a key we bought, but when we accomplish the translation feature using the same code as the sample in this repo shows, we got https://content-translation.googleapis.com/static/proxy.html returns 404. This request is sent when we call gapi.client.language.translations.list
The error shows in browser's console is:
image

We tried REST API using our key, it worked well. So the problem we had here might not be the key?
So why we had the issue using this google-api-javascript-client? We got stuck here .
Any help please? Thanks in advance!

`` <html> <head> <script src="https://apis.google.com/js/api.js"></script> <script> function start() { // Initializes the client with the API key and the Translate API. gapi.client.init({ 'apiKey': 'my key', 'discoveryDocs': ['https://www.googleapis.com/discovery/v1/apis/translate/v2/rest'], }).then(function() { // Executes an API request, and returns a Promise. // The method namelanguage.translations.list` comes from the API discovery.
return gapi.client.language.translations.list({
q: 'hello world',
source: 'en',
target: 'de',
});
}).then(function(response) {
console.log(response.result.data.translations[0].translatedText);
}, function(reason) {
console.log('Error: ' + reason.result.error.message);
});
};

  // Loads the JavaScript client library and invokes `start` afterwards.
  gapi.load('client', start);
</script>






```

Most helpful comment

Thank you for the issue report. We looked into it and it should be resolved in about 2 weeks. Your code sample is correct and should start working at that point.

All 9 comments

Thank you for the issue report. We looked into it and it should be resolved in about 2 weeks. Your code sample is correct and should start working at that point.

@dvanderb Thanks a lot! Really appreciate it. I will check it later then. ;)

Hi @dvanderb I just checked it on our website, it works well now! Thanks for this quick fix! Just want to confirm if this is a formal fix or just a test version? So I can inform our stakeholders formally. Thanks again! ;)

@OhMG2020 The fix will be fully rolled out by Friday. Until then you might see inconsistent results.

Hello, just wondering if this was released? I didn't see a corresponding commit on master.

This has been released. It was a fix on the service side and not in the javascript client.

@AlexanderKozhevin that is a separate issue and a fix is in pogress.

@dvanderb I got same 404 error when calling gapi.client.games.scores.submit

<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That鈥檚 an error.</ins>
  <p>The requested URL <code>/static/proxy.html</code> was not found on this server.  <ins>That鈥檚 all we know.</ins>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Price775 picture Price775  路  3Comments

lucasriondel picture lucasriondel  路  3Comments

phyllisstein picture phyllisstein  路  3Comments

blmiles picture blmiles  路  5Comments

Nilesh-P picture Nilesh-P  路  4Comments