Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Calendar API - no longer authorized for reads? [closed]

So, using the Calendar API to pull all events from a publicly available Google Calendar.

This were working fine until this morning.

As I'm not updating or doing any data alteration, we've implemented an API key to access read only data as follows:

https://www.googleapis.com/calendar/v3/calendars/[calendar ID]/events?timeZone=EDT&timeMin=2020-06-30T04:00:00.000Z&maxResults=6&singleEvents=true&orderBy=startTime&key=[API key]

Yesterday, pulled fine, today returns:

code: 401 message: invalid credentials

Any thoughts on this? It's affecting several implementations of this calendar code (different keys, domains, etc) but with the same basic methodology.

I have not implemented the gapi client javascript library, may begin looking into that now.

like image 436
joeignition Avatar asked Jun 30 '20 14:06

joeignition


People also ask

How do I enable Google Calendar API?

Enable API access In the API Manager pane, click Library to see the list of available APIs. In the Google Apps APIs list, scroll down to click or search for Calendar API, then on the API page, click Enable.

Is Google Calendar API free?

All use of the Google Calendar API is available at no additional cost.

Is Google Calendar API a REST API?

The Google Calendar API is a RESTful API that can be accessed through explicit HTTP calls or via the Google Client Libraries.

How do I change Google Calendar permissions?

You can't share calendars from the Google Calendar app. Settings and sharing. Under “Access permissions,” select Make available to public. Next to “Make available to public,” choose the level of access you want to give in the drop-down menu.


2 Answers

I don't like adding +1 type responses, but I also suddenly got errors using API keys for the Google Calendar API.

Looking in the Google Console you can see that "API keys" is no longer an enabled credential for the Google Calendar API.

I'm pretty sure it's a mistake as Google should notify everyone before such a huge change. I'm hopeful they find reports of this and it's a mistake that will correct itself soon.

Btw, for anyone else, this is the error returned by Googles API:

{
    "error": {
    "errors": [
    {
    "domain": "global",
    "reason": "authError",
    "message": "Invalid Credentials",
    "locationType": "header",
    "location": "Authorization"
    }
    ],
    "code": 401,
    "message": "Invalid Credentials"
    }
    }
like image 173
Johnny Avatar answered Oct 08 '22 14:10

Johnny


This is now fixed by Google. All API key usage should be working as normal.

Looks like they had some issues on their end: enter image description here

like image 21
Nick S. Avatar answered Oct 08 '22 14:10

Nick S.