403 Error Usage Limits

235 views
Skip to first unread message

Sharpie pg

unread,
Dec 3, 2015, 7:06:46 PM12/3/15
to Google Translate API Developer Forum
Hi there, 

I'm trying to incorporate the Google Translate API into an Android app for release. 

I have followed the guide (https://cloud.google.com/translate/v2/using_rest#auth) to create an API key and an SHA1 fingerprint. In addition, I have created an OAuth 2.0 client ID for production and enabled billing. However, I keep getting the following error when I make a request: 

Translate Exception: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
  {
  "code" : 403,
  "errors" : [ {
    "domain" : "usageLimits",
    "message" : "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.",
     "reason" : "ipRefererBlocked",
     "extendedHelp" : "https://console.developers.google.com"
    } ],
   "message" : "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed."
}

If I use a server API key for debugging, everything works great! But I can't release an android app with a server API key. 

Any help would be amazing!

RT

unread,
Dec 4, 2015, 10:11:09 AM12/4/15
to Google Translate API Developer Forum

Nick

unread,
Dec 9, 2015, 3:33:54 PM12/9/15
to Google Translate API Developer Forum
Hey RT,

Due to the specific-issue technical nature of this post, we would normally redirect you to stackoverflow, where the whole site is designed for such questions and the user-base is much larger. We also monitor there, so there should be no need to continue to post in this thread. Best of luck in debugging your issue!

Sharpie pg

unread,
Dec 10, 2015, 11:14:14 AM12/10/15
to Google Translate API Developer Forum
Hi Nick

Thanks! I actually got it working in the release version of my Android app if I remove the Google Translate Java library and the SHA1 fingerprint in the developers console. However, it would be great to have it working with the SHA1 fingerprint in place. Also, I have posted a similar question to Stack overflow (http://stackoverflow.com/questions/34076107/google-translate-403-error?noredirect=1#comment56110677_34076107). 

Nick

unread,
Dec 11, 2015, 1:53:33 PM12/11/15
to Google Translate API Developer Forum
Hey Sharpie,

You can also post to the Public Issue Tracker for App Engine or the Cloud Platform if you find that something isn't working as documented, or if you're reasonably sure the error isn't in your code. If you followed all the necessary steps, I don't see why the error should occur when using the fingerprint/SHA1 method of auth.

At any rate, I'm glad to hear that you got it working. Best of luck on StackOverflow!
Reply all
Reply to author
Forward
0 new messages