File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Google Translator showing Google returned the following error: [403]

 
RatiKanta pal
Ranch Hand
Posts: 84
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heloo every one..



import com.google.api.translate.Language;
import com.google.api.translate.Translate;

public class TestGoogleTranslate {
public static void main(String[] args) {
Translate.setHttpReferrer("http://translate.google.com/");
try {
String translatedText = Translate.execute("Heloo Every One", Language.ENGLISH, Language.GERMAN);
System.out.println(translatedText);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}





In above code I am trying to translate my english text to german.But when I am running this I am getting exception like this


java.lang.Exception: Google returned the following error: [403] Please use Translate v2. See http://code.google.com/apis/language/translate/overview.html
at com.google.api.translate.Translate.getJSONResponse(Translate.java:182)
at com.google.api.translate.Translate.execute(Translate.java:71)
at TestGoogleTranslate.main(TestGoogleTranslate.java:9)



For this I am using google-api-translate-java-0.92.jar ..What may be the problem..I had already refered to http://code.google.com/apis/language/translate/overview.html.. But getting no input to my problem..

 
Paul Clapham
Sheriff
Pie
Posts: 20161
24
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, let's start with the very first sentence of the highlighted box on that page you linked to:
Google wrote:Important: Google Translate API v2 is now available as a paid service only


So you're saying you have already subscribed to this service and your account is paid up. Is that correct?
 
RatiKanta pal
Ranch Hand
Posts: 84
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No..I am just trying to use it for learning purpose only...Is there any other way to this.


Please help me out..


Thank you..
 
Rob Spoor
Sheriff
Pie
Posts: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Error 403 (Forbidden) means you're not allowed to use it with your current credentials. You will need an account to be able to use it. If you only want to try it out, check if there's a possibility to get a limited account (in time and/or functionality); if not then you have no choice but to pay for it.
 
Paul Clapham
Sheriff
Pie
Posts: 20161
24
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To me there doesn't seem to be much point in spending time learning something which you aren't going to use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic