Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Google Cloud Translate API - Your client does not have permission to get URL /language/translate/v2

I'm trying to make a request to google cloud translate:

 

$res = $this->request(
            'POST',
            'https://www.googleapis.com/language/translate/v2?'.$queryUrl,
            $params,
            array("X-HTTP-Method-Override: GET")
        );

 

However, I'm getting a response that:

 

That’s an error. 
Your client does not have permission to get URL /language/translate/v2 from this server.
 That’s all we know.

 


The same code on a different server works without problems. I didn't setup any restrictions for api key:

Zenonas_0-1679047659151.png

What could be the possible causes for this ? Can the request be blocked by the server and how should I check it ? 

0 4 1,206
4 REPLIES 4