I thought this would be straight forward, but for some reason I'm getting hammered on this one.
I'm using PHP + CURL to try and retrieve a list of Web Fonts. The code is simple:
$url = "https://www.googleapis.com/webfonts/v1/webfonts?sort=popularity&key=MY_SERVER_APPS_KEY";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$google_response = curl_exec($ch);
curl_close($ch);
The code is hitting Google, but $google_response always returns:
"error": {
"code": 403,
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
],
"message": "Access Not Configured"
}
I've set up a server access key and put both of my web server's API keys on it. (To verify my IP, I did a WGET on curlmyip.com) I've also enabled the "Web Fonts Developer API" from the Services tab.
Is there anything I could be overlooking?
I found the solution. Apparently I needed to register my server's IPv6 address, not the IPv4's. Worked without any code changes after adding them.
In my case the needed API was not enabled.
To enable:
API Manager
from the menuremove all "allowed Ips", then Any IP allowed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With