Answer the question
In order to leave comments, you need to log in
Google forms POST or api?
Hello.
There is a task: every hour (at the beginning of the hour), disable access to the form.
I plan to do this not on a schedule, but at the same time before executing the python code, and open access at the end of the script.
The question is, what is the easiest way to implement this?
- I have already tried to use the plugins of the google forms itself, but as a rule, you can configure only one action there, and then it is rigidly tied to the date and time, in my case there will be situations when the script is turned off.
- The API, as I understand it, works on javascript, which, alas, I don’t know yet (but if you throw off code examples that implement access control, I will be extremely grateful)
So I have only hopes for the good old POST requests through, for example, request. But alas, I did not find any documentation on working with forms in this way. I myself tried to study browser requests, I only realized that in addition to cookies, there is also sid. Here is an example request body to enable and disable (permissions to use the form)
[{"commands":,"sid":"7ec066ecd2aebde8","reqId":0}]
[{"commands":,"sid":"7ec066ecd2aebde8","reqId":1}]
[{"commands":,"sid":"2f52607833384d49","reqId":0}]
Answer the question
In order to leave comments, you need to log in
The only "correct" way to manage Forms at the moment is using Google Apps Script . To implement the API, use the special `doGet` trigger.
You should end up with something like this
function doGet(e){
/* если `e` содержит параметр на отключение Формы */
form.setAcceptingResponses(false);
/* если `e` содержит параметр на разрешение Формы принимать ответы */
form.setAcceptingResponses(true);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question