2
votes

I am using Google Apps Scripts following this tutorial.

When I execute the code I get the following error:

Project 719340009941 is not found and cannot be used for API calls. If it is recently created, enable Calendar API

I went to Resources -> Advanced Google Services and I enabled Calendar. Then I clicked on the link of Cloud Platform project. I could not directly search for calendar API, I had to create a project first (which I called Calendar). I searched for Calendar API and enabled it.

When I am on the calendar API page it tells me: API enabled. I don“t understand why the script gives me the error.

If I visit the project link (which the error provides) I get the following error

The API "calendar.googleapis.com" doesn't exist or you don't have permission to access it

1
Google Apps Script has a built-in Calendar API, via CalendarApp developers.google.com/apps-script/reference/calendar This version of the Google Calendar API does not require the "Advanced Service" configuration, and does have some different syntax than the public REST API. - tehhowch
But shouldn't it just work like the quickstart tells me? - Sander Hansen
When you create an apps script project, it automatically creates a corresponding cloud console project. You should not have needed to create one for it. That said, if you are in a G Suite domain, this automatic project creation may have been disabled / disallowed. You would then need to associate your given apps script project with your cloud console project. This process is described at length in Apps Script documentation. - tehhowch
CalendarApp is limited in its functionality. While it's true you might be able to accomplish your task with CalendarApp, you might need extended functionality in some cases which you would enable as indicated in the question. Unfortunately, I'm getting the same error, and don't have a solution yet. - Josh

1 Answers

1
votes

I don't know anything about the different API versions or what a G suite domain is, but if it helps anyone else I resolved this by going to the URL below and hitting the enable button:

https://console.developers.google.com/apis/library/calendar-json.googleapis.com