Hangouts Chat Bot: Use Google Apps Script, but execute as me - google-apps-script

I am creating a GAS Hangouts Chat bot for use within my G Suite domain. I have opted for the Apps Script architecture, as I want to use Google Sheets as a data store.
Since I use Google Sheets in the script, the bot prompts every new user to authorize it to use Google Sheets. If you publish a Google Apps Script as a web app, you have the option to say "Execute the app as me" instead of "Execute the app as user accessing the web app". Can I do this with my chat bot?
I want the bot to come pre-authorized to write to my google sheet (because it's executing as me) without asking new users for authorization.

Related

"Something went wrong" while running the App Script from Google sheets

I have a google sheet and created an app script by clicking on the extensions -> "Apps Script".
I imported the App Script in the Google sheets using Macro -> "Import Macro" and thus triggered it with the click of a button.
Everything works ok but when I share this sheet with editor access to a Microsoft account, the Microsoft account indeed can edit the content of the sheet but is not able to run the app script by clicking on the button.
First of all, sheet requests the permission to run the app script].
After clicking "Continue" it results in the error "Something went wrong".
Does Google not allow the running of scripts by a non-Google account user?
Is there any way to allow non-Google / workspace users to run the script?
Does Google not allow the running of scripts by a non-Google account user? Is there any way to allow non-Google / workspace users to run the script?
Short answer is no.
Longer answer is that in order to run a script the script needs to be authorised to run as somebody. If the person doesn't have a Google account then there is no account to authorise the script and so it can't be run.

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.

Deploy Appscript as Webapp from Google sheet Add-on

I want to create a Google sheet add-on where the user can create an HTTPS endpoint in his sheet, that can act as a webhook for an external service. I can see it is possible to do this manually by launching app script code using the 'Deploy a script as a web app' option from the Script Editor
https://developers.google.com/apps-script/guides/web#deploy_a_script_as_a_web_app
Is it possible to automate this in app-script so that the user can configure this in the add-on UI only and in the background, app-script launches the endpoint and can return the endpoint URL to the user?
A Google sheets add-on is a single project shared across all users of the add-on. So, even if any user was allowed to use "Deploy as webapp" feature, Deploying it will create a single endpoint for all users of the addon and NOT a unique url endpoint for each user.
It might be possible but you'll likely need the user to grant your app access to restricted scopes, in which case your add-on will need to undergo a security assessment which will run you anywhere from $15,000.00 to $75,000.00.
You can try leveraging the Apps Script API to create a script project specific to the user and use that project to deploy a web app on their behalf. Not sure if it will work, but you can try playing with the following API endpoints:
https://developers.google.com/apps-script/api/reference/rest/v1/projects/create
https://developers.google.com/apps-script/api/reference/rest/v1/projects.deployments/create
https://developers.google.com/apps-script/api/reference/rest/v1/projects.deployments/update

How to publish google apps script website

I wrote a simple Google Apps Script to launch google website. Its integrated with google sheet to get data from it. If I press publish button on the menu it works well. However, I pasted the url into another browser which has not same session with google apps script editor it is not working while attempts login to google.
The google account is not for google play developer. Should I register my google account as google play developer?
You have to set your Web App "Who has access to the app:" property to "Anyone, even anonymous".

Publishing Google Sheets Addon - site verification

I've built a Google Sheets script that queries my company's API and outputs the data from my platform into a spreadsheet. It takes the username and password using a form and then runs an API call to output the results to Google Sheets.
When I tried to publish the addon, I received feedback that I needed to comply with Google OAuth verification. To get this verification, I need to prove that the domain is mine; although I have access to GA for our site (which isn't working for the verification), I am not the domain owner. So, I was wondering, is there a way to publish this Google addon for my company account and what are the next steps to complying with Google OAuth?