Pergunta

I am needing to use the Google Calendar API to retrieve even data from my calendar.

I created my application and created my server API Key. I entered in my IP address (Since i am running on my test server).

After that, i created my simple PHP file that uses Curl to request data from Google's Servers. The File looks like this:

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_URL,"https://www.googleapis.com/calendar/v3/calendars/myCalendarEmail@gmail.com/events?maxResults=15&key={My Key}");
$result=curl_exec($ch);
echo $result; 

However, when this is executed, i recieve this JSON (Error):

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
   }
  ],
  "code": 403,
  "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
 }
}

I even entered the URL in my browser and got Data. After a couple hours of messing around with it, my browser returns the same error message? Did i miss something, or is this just a bug?

Here is what the API Console gives me (This proves when i said it worked in my browser and not via Curl)

enter image description here

Foi útil?

Solução 2

After waiting two days the API responses started to work. This confuses me very much, and i really expected a more professional API from Google. I will continue to watch this question until someone posts a real fix to this issue. Thanks.

Outras dicas

1) Go to the Google Developers Console.
2) Select a project.
3) In the sidebar on the left, select APIs & auth. In the list of APIs, make sure the status is ON for the Google Calendar API.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top