Buying more quota in GCP for Google Apps Script quota - google-apps-script

I'm facing quota limits of sending mails via Google Apps Script. The limit is 100 a day. I called the support center, but they say the script is out of the scope of Google Apps Service.
They told me I could buy more quota at GCP (Google Cloud Platform), now my question: Do I have to code new scripts on the GCP, or can I somehow connect the Google Apps Script (which is part of Drive and Apps I guess) with GCP?

I'm not sure if you can link both projects, however, I think Apps script email service would still be limited by it's own quotas.
A possible workaround would be to call the Gmail API directly instead of using the Apps script Gmailapp service.
To call the API you can use the "UrlFetchApp.fetch()" to make the call to the Gmail send endpoint.
To be able to make the call to the Gmail API, you will have to enable it in the developer console, for this in your script go to "Resources -> Advanced Google Services". There you will enable the Gmail API, then you have to click on the link that says "These services must also be enabled in the Google Developers Console."
It will take you to the Developer Console of your Appscript project, there you also have to enable the Gmail API.
The quota for UrlFetch is 20k calls/day, so in this case you would be limited by this quota and the Gmail API quota.

Related

I want to complete the verification of the Google Apps Script

I am creating and hosting a web app with Google Apps Script(html). The screen of 'Unverified app screen' is displayed.
Google workspace is not used.
With over 100 users, access to the app is now blocked.
https://developers.google.com/apps-script/guides/client-verification?hl=en#applicability
I'm trying to request verification of the app by referring to the following article, but I'm stumbling on the confirmation of ownership of Apps Script in step 1.
※google cloud platform project has already been created, and is linked to the Apps script project.
Is there a way to check the ownership of a web page launched with Google Apps Script using the Google search console?
They need to click on the unsafe link and authorize the script.

Can anything done with google apps scripts be done with the google API?

I noticed that the Google Apps Script editor uses a Bearer token to make requests for a lot of things, that got me thinking: Is it possible to do all functions that are done with the google apps script with the google API on your own server? What is the essential difference? Just the fact that google apps script runs on google servers, while with the google API you would need to create your own servers?
For example many of the document functions, which I thought could only be done with the API, turns out can be found here https://developers.google.com/docs/api/reference/rest/v1/documents/request#InsertInlineImageRequest
so whats the essential difference?
Just the fact that google apps script runs on google servers, while with the google API you would need to create your own servers?
Yes. There are advantages to both methods:
API:
It's a rest API. You can use your own language(eg: Python) in your servers.
The api is more inclusive. There are stuff which can be done with the api, which cannot be accomplished with apps script.
User can set limited scopes for using API.
For example, at Drive API, https://www.googleapis.com/auth/drive.file can be used for Drive API. The same cannot be done with DriveApp of apps script.
Process cost of API is lower than that of the built-in methods for Google Apps Script1 2
Apps script:
No server on your side
Triggers. You can set up functions to run onEdit,onOpen or at a specific time.
Deep integration with Google apps: Sidebars/modal dialogs can only be done with apps script.
All methods of the api can be accessed indirectly through the bearer token.
Authorization/authentication is taken care of by apps script. You don't need to set up oauth.

Google Docs API as Google Apps Script "Advanced Google Service"

I know I can use the Google Docs API along with the UrlFetchApp service. But does anyone know if the Google Docs API will be available as an "Advanced Google Service" in Google Apps Script, if so, can you tell when this will happen?
I can't say for sure (I don't work at Google) but there are information channels you can monitor for news and product updates related to Google Apps Script and GSuite products:
Google Apps Script Release Notes
What's New in GSuite
GSuite Updates
Besides, "Advanced Services" are just wrappers for their respective APIs and their main purpose is to provide code completion. Under the hood, you consume the same resources as you would if you called the API directly via UrlFetch (this includes usage quotas).
If you're up to the task you can write your own implementation based on the discovery docs available for the Google Docs API.

How to capture/view Google App Script usage in Google API Console

How can usage of Google App Script libraries like GmailApp, CalendarApp, and PropertiesService be tracked through the Google API Console?
While Google App Script projects do show up inside the API console, none of them show any activity when selected. I understand that individual Google APIs need to be enabled for a project in order for their usage to be visible in the API console, but none of the App Script APIs seem to be available in the list Google APIs to choose from.
My only guess is that Google App Script usage cannot in fact be tracked through the Google API Console, which is a shame since many users seem to hit their app script quota limits and would benefit from the ability to track and visualize their script's resource usage.
Yes, it is true that you cannot track the usage of individual libraries of Google App Script in the Google Developer Console except for the MailApp. The MailApp has a method of getRemainingDailyQuota() that returns the number of remaining emails a user can send for the rest of the day. You can check in this documentation the different quotas and limitations that you can do with the Apps script. I also suggest you to make a feature request about this issue.

Where can I view Google Apps Script quota usage?

We make substantial use of Google Apps Script, and today I saw this error:
UrlFetch failed because too much upload bandwidth was used in Code (gci standalone script):219
I found lots of links to Google Apps Engine quotas, and how to check Apps Engine quota usage. However the Apps Engine quotas all showed as 0 in the Google Cloud developers console. This is not surprising since we don't use Apps Engine, but I was unable to find a similar breakdown for Google Apps Scripts.
Is there one?
On another note, this question: Are there quotas for incoming requests to a Web App?
has an answer:
urlFetch quotas do not apply unless you are making the call to the spreadsheets api v3 directly without spreadsheetApp.
We use UrlFetch to retrieve CouchDB data. I would like to monitor the amount of quota for this service that we use. Is there a way to do so?
You can call the quota for the send emails quota but don't think you can do it for urlfetch.