Closed cvalcarcel closed 1 year ago
The error message there sort of gives you the solution. In order to make the API request you are making you need to enable the API for your GCP project, which you can do by following the link.
Apologies. I have been trying to get a simple API call to work for a few days now and just can’t seem to get it to work. I suspect my main assumption is wrong: I thought that it should be possible to make a GCP API call without having to create a project. The project number in the error message doesn't exist. I never filled in a project number when I created the Apps Script project since I hoped I wouldn’t need one to try out your NoLibrary example. Ultimately, all I’m looking for is a way to make API calls without the overhead of a GCP project. The OAuth consent screen seems to work just fine without a GCP project. It just seems odd to have to create a GCP project that will never be used for anything but its ability to contain the OAuth consent screen configuration (that can be easily duplicated using the appsscript.json file). Thanks for your patience and for your time on the project!
@cvalcarcel - That is likely the project number for the default project that came with the script. You can toggle on advanced services for your script, but if you need to use an API that doesn't have a corresponding advanced service then you'll need to swap in your own GCP project, where you can enable the API manually. You can read more about projects in scripts here:
https://developers.google.com/apps-script/guides/cloud-platform-projects
I finally figured that out on my own. For some reason GH did not send me a notification of your reply. Being a casual AS user I did not know that each project had its own secret GCP project. The error message only added to the confusion since I had no idea all AS projects are assigned a GCP project by default. Oh, well. Thanks for responding! :)
I am looking to make Form API calls from Google Sheets without having to create a GCP project.
After many failed attempts I decided to try the NoLibrary approach given that no API or project was needed to make it work. I copied the appscript.json and Code.gs to a fresh project and ran it. I have run this in Chrome, Firefox, and incognito windows of each.
What I get when I run Code.gs from the Apps Script editor (and I allow the script access to the GSheet which is telling me that OAuth is being satisfied) is:
"Google Search Console API has not been used in project 311386532115 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/searchconsole.googleapis.com/overvie…"
Any thoughts? Thanks!