I’m getting the following error while using the Google translate API:
{ “error”: { “errors”: [ { “domain”: “usageLimits”, “reason”:
“accessNotConfigured”, “message”: “Access Not Configured” } ], “code”:
403, “message”: “Access Not Configured” } }
I have enabled billing, activated the service, registered my API key and allowed the URL. After a bit of searching, no one has offered a conclusive answer.
The request to Google is called using CURL below:
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL,'https://www.googleapis.com/language/translate/v2?userIp=' . $_SERVER['REMOTE_ADDR'] . '&key={MYKEY}&source=en&target=fr&q=hello%20there');
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
$query = curl_exec($curl_handle);
$info = curl_getInfo($curl_handle);
$error = curl_error($curl_handle);
Please note: I’ve put “{key}” to hide my key.
Does anyone know how to resolve this issue?
Thanks in advance!
I had the same problem and in my case I solved it by adding this line before Curl exec: