1

I did everything following the example, but I get an error.

Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
                  {
                    "code" : 403,
                    "errors" : [ {
                      "domain" : "global",
                      "message" : "The request is missing a valid API key.",
                      "reason" : "forbidden"
                    } ],
                    "message" : "The request is missing a valid API key.",
                    "status" : "PERMISSION_DENIED"
                  }

Through the command line everything works, but does not work in the application.

Gourav
  • 2,746
  • 5
  • 28
  • 45
Dmitrij
  • 13
  • 4

2 Answers2

0

You tagged this question with "android". It is worthwhile mentioning that Cloud Java client libraries do not currently support Android. This is documented on the "Translation API Client Libraries" page you linked to.

George
  • 1,488
  • 1
  • 10
  • 13
0

Fortunatelly now it's possible to use Translation API with Android, see https://medium.com/@yeksancansu/how-to-use-google-translate-api-in-android-studio-projects-7f09cae320c7