Translate API V2 - Error 400 Bad Request

1,458 views
Skip to first unread message

Katrina

unread,
Dec 2, 2010, 9:46:32 AM12/2/10
to Google AJAX APIs
I am having trouble getting version 2 of the Translate API to work
with my Python application. I have been using version 1 with the
Python code suggested on the project site, and that has been working
fine for me. But when I substitute the v2 URL:

https://www.googleapis.com/language/translate/v2?parameters

for the v1 URL:

https://ajax.googleapis.com/ajax/services/language/translate?'
+'v=1.0&q=Hello,%20my%20friend!&langpair=en%7Ces&key=INSERT-YOUR-
KEY&userip=INSERT-USER-IP

I receive the error '400 - Bad Request', even for the 'Hello World'
example given in the v2 API documentation. I am still using the same
API key that I was using with version 1. What else do I need to
change to get v2 to work?

Jeremy Geerdes

unread,
Dec 2, 2010, 9:48:26 AM12/2/10
to google-ajax...@googlegroups.com
The problem is your API key. v2 uses a totally different key schema. You need to sign up for it on a per-application basis through the API Console, which you can check out at http://code.google.com/apis/console/

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
jrge...@gmail.com

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

> --
> You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
> To post to this group, send email to google-ajax...@googlegroups.com.
> To unsubscribe from this group, send email to google-ajax-searc...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en.
>

Reply all
Reply to author
Forward
0 new messages