@Rodrigo_Brancaglion
I couldnât be able to understand why do you need to generate an API key? You just need to enclose your script function with a doPost(e) as you have already published your code as a webapp. Have you published the webapp with an accessibility option of anyone even anonymous?
@Rodrigo_Brancaglion
The video that you are referring to is completely a different thing. The script approach demonstrated on the video is using Directory API and that API needs a key for access. Thatâs the reason heâs passing an API key as a URL parameter.
May I ask whatâs your script is doing? Whatâs the purpose of it and how do you want to use that script?
My script is very simple.
After the AppSheet inserts the data in the spreadsheet, the script should take the cell phone of the âID CLIENTâ look for this id in the Client tab and insert the name of this client in the cell corresponding to the Name.
The script works correctly if you run it individually.
However, I have already done the tests without the âapiKeyâ parameter in the URL.
The error that returned is the same - 401
You donât need to use a script for that actually. There are 2-3 different ways to accomplish the same result with using actions, DataChange Workflow or preset AppSheet API Edit Row mechanisms. Provided you insistingly want to use scripting, then you donât need to use the webapp, but onChange(e) trigger instead. Check this post:
[How to Integrate Google Apps Script & Trigger with an AppSheet App](https://community.appsheet.com/t/how-to-integrate-google-apps-script-trigger-with-an-appsheet-app/11805) Tips & Tricks ?
1 - INTRODUCTION Dear valuable members of the community, This post is my personal long-time promise to @praveen that Iâll write about nearly a year ago but couldnât be able to keep my promise and spare some time because of our work load as an AppSheet Partner and Developer. Now I have found some time, I decided to write it down. Hope you can find a benefit of this post for your apps and/or projects. Before starting and diving any deeper, I should admit that this requires at least a beginnerâŠ
sorry i canÂŽt see all the deatils and maybe this answer could be useless but i think that the problem may prove to be the access permits on the script when you deployed it, maybe if you execute the script as yourself and give permits to all then the script will function.