2
votes

Following this tutorial http://www.androidhive.info/2012/01/android-json-parsing-tutorial I've adapted it to parse a public google calendar using this URL "https://www.googleapis.com/calendar/v3/calendars/[calendar_ID]/events?singleEvents=true&orderBy=startTime&key=[my_API_key]" instead of the URL in the example. This calendar is public.

When I execute the app,the response is this:

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration.",
    "extendedHelp": "https://console.developers.google.com"
   }
  ],
  "code": 403,
  "message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration."
 }
}

Where is the problem? What I am doing wrong?

1
Check whether the given api key is valid or not, if invalid means registered your api key in Google api service with your Gmail login.mja
Finally I found the problem, thank you. I explain it in the answer.Micalet M.

1 Answers

1
votes

Finally I found the solution.

In this URL https://www.googleapis.com/calendar/v3/calendars/[calendar_ID]/events?singleEvents=true&orderBy=startTime&key=[my_API_key] I was using the API key for Android app. When I change this key for the API key for browser, the problem disappeared.