Reputation: 41
I have a problem with Rest API request for Google Translation API
My POST method is https://translation.googleapis.com/language/translate/v2?key=MY_KEY
But I get an error
{
"error": {
"code": 400,
"message": "API Key not found. Please pass a valid API key.",
"errors": [
{
"message": "API Key not found. Please pass a valid API key.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
Please help me to understand where the problem comes from.
Upvotes: 4
Views: 20102
Reputation: 8681
You might want to try starting with one of the samples as opposed to trying to build your own client library or get/POST with REST. If you must use REST, the following example may be helpful:
https://translation.googleapis.com/language/translate/v2?key=your-key-here&q=cheese&target=es
Replace the API key with the one that you have enabled access to the translate API on.
Upvotes: 17