Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Still possible to use Google Calendar API with API Key?

It appears as though the current version of the Google Calendar API is v3, which in the past I believe has supported both OAuth and simple API Keys for a JavaScript/Browser implementation.

As of 2/2/17: is it possible to still use the Google Calendar API with an API Key, or is required that any access (even access to a public calendar) to the API go through OAuth2.0?

According to the Google Calendar API, "Your application must use OAuth 2.0 to authorize requests" (https://developers.google.com/google-apps/calendar/auth), but my API request is opening a public calendar and does not require a sign-in as none of the data is private.

like image 917
Jake Chasan Avatar asked Feb 03 '17 01:02

Jake Chasan


People also ask

Is the Google Calendar API free?

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

Is there an API for Google Calendar?

The Calendar API lets you integrate your app with Google Calendar, creating new ways for you to engage your users.

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.


1 Answers

Well, it seems that the Google Calendar now needs an authorized tokens to access its own API. It is stated in their documentation that every request your application sends to the Google Calendar API must include an authorization token. The token also identifies your application to Google.

I found here in this question that you cannot access your calendar information using API Key. API keys (or simple API access key) are not authorized tokens and can only be used for some API calls such as a Google search query etc; API keys will not let you access any user specific data, which I am assuming is your objective through this calendar application.

I tried to access a Google calendar request by using an API key, but I get an error 401 "Login Required"

https://www.googleapis.com/calendar/v3/users/me/calendarList/primary?key=YOUR_API_KEY

To verify that the API_KEY is the problem, I try to use it in a Google Maps request.

https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap

And I got here a successful response.

I hope this information helps you.

like image 155
KENdi Avatar answered Nov 27 '22 06:11

KENdi