Error 403 with Google Translate v2 API access
Asked Answered
M

1

4

I am trying to access Google's Translate services from within an Android app. However, each time I try to access the service (using an HttpGet request), I encounter the following error:

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
   }
  ],
  "code": 403,
  "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
 }
}  

I am not able to resolve the above error. I have set up the project as follows:
1. On the Google Developer's Console, created a new project.
2. From the "APIs and Auth" section on the left, activated the Translate API v2.
3. Generated the SHA1 key with debug.keystore and on the Developer's Console, generated a new key with this information.
4. Added billing information. Credit card has been accepted.
5. Used the following link to access Translate API:
https://www.googleapis.com/language/translate/v2?key=myKey&source=en&target=hi&q=hell

Each time the app runs the above Get Request, the 403 error is returned. I have been through all the links that SO or Google can care to throw up on this issue and nothing seems to have affected it.

Any ideas where I might be going wrong?

Micrometeorite answered 12/1, 2014 at 14:11 Comment(4)
Not sure about that but debug.keystore might be wrong. You typically want to setup things with the release key since that's the key your released app uses to authenticate.Chancemedley
@Micrometeorite were you able to solve this?Set
@AhmedZ.: No. No luck.Micrometeorite
@Micrometeorite Ohhhh very big one...Set
B
0

Because you restricted your api key with your android app (package name and SHA certificate), you must include these information to the header of each request sending to google.

Read more here.

Bison answered 17/3, 2017 at 17:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.