You need to first execute it from the script editor to process the authentication process then it will work.
Have you done this step?
You need to first execute it from the script editor to process the authentication process then it will work.
Have you done this step?
Yes I did, I had to do it twice like the one before.
Getting this error when I try, makes sense though bc I havenāt really defined it in the script.
Google want to confuse the rest of us by having both parameter
and parameters
. Check with one works for you
I now have the following (parameter) but no success yet
function doPost(event) {
return CalendarApp.getDefaultCalendar().createEventFromDescription(event.parameter.eventDesc);
}
I tested the same code and this is the result
This is the code I deployed
function doGet(event) {
CalendarApp.getDefaultCalendar().createEventFromDescription(event.parameter.eventDesc);
}
Note:
I use doGet because I can execute it directly from the web browser.
I see youāre using a doGet but I tried that as well using both parameter and parameters with no success.
Made sure to save the updates as I did them as well
Hereās the response Iām getting from the API.
I donāt think thereās any sensitive info here.
The status is 401 and the error returns blank.
I also tried changing the end of the script to manually entering test event today at 9AM and ran the script from Google scripts and it was successful in my calendar.
This means either not able to reach the server or authentication issue.
How would I troubleshoot either one of those?
I donāt see how it could be either one
To troubleshoot you need to understand the following:
eventDesc
.Once you pass this stage you can try it in Thunkable.
How do I make sure the app has authorization?
Or does anyone w the url have the ability to make changes?
I didnāt have the access set to anyone, so now Iām getting 200. But for some reason the error at the bottom is saying function not found: doPost, but my function isnāt doPost, itās doGet and Iāve saved it but itās still saying that.
Can you use the URL you obtained and test it directly in the browser. At the end of the URL add
?eventDesc=test+meeting+9AM
Good. So it is a doGet as it says. We know it returns nothing so this is OK. Or you may need to redeploy.
Verify that an event was added to your calendar which should make it a success.
Even though it says not found?
I tried running it via the web and it did not add an event to my calendar.
I modified it to have ātest event, today 9AMā and it does add the event if I run it from the scripts editor.
Attempting to execute it via URL does not add ātest event, today 9AMā to my calendar
Changing it all back to event.parameters.eventDesc and running via URL does not add to the calendar, nor does trying to run it through the Thunkable app.
Thunkable still says 200 but script function not found: doPost
Was referring that it says doGet not doPost. But it seems that something is wrong in deploying the function. Maybe it was not the selected function in the editor when you click Deploy.
I didnāt realize you have to redeploy if you change something, I thought save was sufficient.
I get this now when using the URL
And it adds the event but it adds it to tomorrow instead of today, perhaps because 9AM has already passed?
Congrats.
It doesnāt add it from the app though, only the URL and adds it tomorrow.
Iām still getting the āscript function not found: doPostā error