Fill out google form using an api

by JBaczuk   Last Updated July 18, 2018 15:03 PM

I have a private google form I need to fill out every day, so I would like to write a script to authenticate me using my google credentials, and then fill out some of the form programatically, is there an API for that? What is a recommended approach for this, without having edit access to the form?

Tags : google-forms


Answers 1


Short answer

You have to use a tool or service that allow you to do a POST as there isn't an API that allow to fill out a form without having edit access to the form.

Extended answer

Google Forms API

In a strict sense, there isn't a API for Google Forms but there is a Google Apps Script service to create and modify forms. It's the Forms Service that has assigned the Class FormApp

The Form Service allow to create pre-filled form URL and submit responses form the server side but not to fill out a "live form".

But to use the Form Service to do the above you should have edit access to the form.

Getting the form elements

First you should have to identify the form elements then fill out them or assign the corresponding values to form elements and submit the form.

If you don't have edit access to the form you could inspect the live form source code. If the form has multiple pages perhaps you should get the source code of each page of the live form.

Doing a POST

Once you get the form elements and assign them the values you should do POST a JSON object having the form elements id's and their values.

Rubén
Rubén
July 18, 2018 14:31 PM

Related Questions





Setting maximum number of sign-ups in Google Forms

Updated March 27, 2015 05:01 AM