When using the Google translation API, I get the following error:
{"error": {"errors": [{"domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured"}], "code": 403, "message": "Access not configured"}}
I turned on billing, activated the service, registered my API key and resolved the URL. After a short search, no one gave a definitive answer.
A Google request is invoked 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 added "{key}" to hide my key.
Does anyone know how to solve this problem?
Thanks in advance!
Dan source share