403 (Forbidden) using Google Translate API key

1,210 views
Skip to first unread message

Jeremy Perrin

unread,
Oct 25, 2012, 9:33:09 PM10/25/12
to zeta-resou...@googlegroups.com
For the past couple of days I've been getting 403 from the Google translate API. I did sign up for an API key and the service is activated under my domain and user. I'm using Key for server apps no IP locking.
My current zeta editor version is 2.2.0.27

Any ideas why this would be happening? The complete exception is below

Thanks in advance 

System.Net.WebException

-----------------

The remote server returned an error: (403) Forbidden.

-----------------

at System.Net.HttpWebRequest.GetResponse()
   at ZetaResourceEditor.RuntimeBusinessLogic.Translation.GoogleRestfulTranslationEngine.makeRestCallPost(String appID, String url, ICollection`1 parameters) in C:\P\Zeta Resource Editor\Source\RuntimeBusinessLogic\Translation\GoogleRestfulTranslationEngine.cs:line 124
   at ZetaResourceEditor.RuntimeBusinessLogic.Translation.GoogleRestfulTranslationEngine.TranslateArray(String appID, String appID2, String[] texts, String sourceLanguageCode, String destinationLanguageCode, String[] wordsToProtect, String[] wordsToRemove) in C:\P\Zeta Resource Editor\Source\RuntimeBusinessLogic\Translation\GoogleRestfulTranslationEngine.cs:line 229
   at ZetaResourceEditor.UI.Translation.AutoTranslateForm.translateArray(String appID, String appID2, ITranslationEngine ti, DataTable table, String refLanguageCode, DataColumn column, Int32 refValueIndex, String raw, BackgroundWorker bw, Int32 delayMilliseconds, String prefixSuccess, Int32 translationSuccessCount, Int32& translationErrorCount, Boolean continueOnErrors, String prefixError, Int32& translationCount) in C:\P\Zeta Resource Editor\Source\Main\UI\Translation\AutoTranslateForm.cs:line 910
   at ZetaResourceEditor.UI.Translation.AutoTranslateForm.<>c__DisplayClass9.<buttonTranslate_Click>b__5(Object s, DoWorkEventArgs a) in C:\P\Zeta Resource Editor\Source\Main\UI\Translation\AutoTranslateForm.cs:line 569
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

WebException
{
Status=ProtocolError,
Response=HttpWebResponse
{
IsMutuallyAuthenticated=False,
Cookies=CookieCollection
{
IsReadOnly=True,
Count=0,
IsSynchronized=False,

},
Headers=WebHeaderCollection
{
Count=9,
Keys=KeysCollection
{
Count=9
},
AllKeys=String[]
{
Length=9,
LongLength=9,
Rank=1,
,
IsReadOnly=False,
IsFixedSize=True,
IsSynchronized=False

"X-Content-Type-Options",
"X-Frame-Options",
"X-XSS-Protection",
"Transfer-Encoding",
"Cache-Control",
"Content-Type",
"Date",
"Expires",
"Server"
},
},
ContentLength=-1,
ContentEncoding="",
ContentType="application/json; charset=UTF-8",
CharacterSet="UTF-8",
Server="GSE",
LastModified=10/25/2012 8:25:02 PM,
StatusCode=Forbidden,
StatusDescription="Forbidden",
ProtocolVersion=Version
{
Major=1,
Minor=1,
Build=-1,
Revision=-1,
MajorRevision=-1,
MinorRevision=-1
},
ResponseUri=Uri
{
AbsolutePath="/language/translate/v2",
Authority="www.googleapis.com",
HostNameType=Dns,
IsDefaultPort=True,
IsFile=False,
IsLoopback=False,
IsUnc=False,
LocalPath="/language/translate/v2",
PathAndQuery="/language/translate/v2?",
Port=443,
Query="?",
Fragment="",
Scheme="https",
DnsSafeHost="www.googleapis.com",
IsAbsoluteUri=True,
Segments=String[]
{
Length=4,
LongLength=4,
Rank=1,
,
IsReadOnly=False,
IsFixedSize=True,
IsSynchronized=False

"/",
"language/",
"translate/",
"v2"
},
UserEscaped=False,
UserInfo=""
},
Method="POST",
IsFromCache=False
},
Message="The remote server returned an error: (403) Forbidden.",
Data=
[
]
,
InnerException=null,
TargetSite=RuntimeMethodInfo: GetResponse,
StackTrace="   at System.Net.HttpWebRequest.GetResponse()\\r\\n   at ZetaResourceEditor.RuntimeBusinessLogic.Translation.GoogleRestfulTranslationEngine.makeRestCallPost(String appID, String url, ICollection`1 parameters) in C:\\P\\Zeta Resource Editor\\Source\\RuntimeBusinessLogic\\Translation\\GoogleRestfulTranslationEngine.cs:line 124\\r\\n   at ZetaResourceEditor.RuntimeBusinessLogic.Translation.GoogleRestfulTranslationEngine.TranslateArray(String appID, String appID2, String[] texts, String sourceLanguageCode, String destinationLanguageCode, String[] wordsToProtect, String[] wordsToRemove) in C:\\P\\Zeta Resource Editor\\Source\\RuntimeBusinessLogic\\Translation\\GoogleRestfulTranslationEngine.cs:line 229\\r\\n   at ZetaResourceEditor.UI.Translation.AutoTranslateForm.translateArray(String appID, String appID2, ITranslationEngine ti, DataTable table, String refLanguageCode, DataColumn column, Int32 refValueIndex, String raw, BackgroundWorker bw, Int32 delayMilliseconds, String prefixSuccess, Int32 translationSuccessCount, Int32& translationErrorCount, Boolean continueOnErrors, String prefixError, Int32& translationCount) in C:\\P\\Zeta Resource Editor\\Source\\Main\\UI\\Translation\\AutoTranslateForm.cs:line 910\\r\\n   at ZetaResourceEditor.UI.Translation.AutoTranslateForm.<>c__DisplayClass9.<buttonTranslate_Click>b__5(Object s, DoWorkEventArgs a) in C:\\P\\Zeta Resource Editor\\Source\\Main\\UI\\Translation\\AutoTranslateForm.cs:line 569\\r\\n   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)\\r\\n   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)",
HelpLink=null,
Source="System"
}

Jeremy Perrin

unread,
Oct 29, 2012, 1:30:42 PM10/29/12
to zeta-resou...@googlegroups.com
403 error also occurs when the Per-User Limit is exceeded, the google api console default is 100 character/second. Increasing the Per-User Limit eliminated the 403 exception.
Reply all
Reply to author
Forward
0 new messages