This page describes how to perform these tasks involving forms:
- Create a new form
- Duplicate an existing form
- Convert a form to a quiz
Before you begin
Do the following tasks before proceeding with the tasks on this page:
- Complete authorization/authentication and credentials setup in the Early Adopter Program instructions.
- Read the Forms API overview.
Create a new form
The initial creation of a form only requires a title field—any other fields
in the request will be ignored. To build out the content and metadata of a
form or make updates, use the batchUpdate()
method. See
Update a form or quiz for more
information.
REST
Call the forms.create()
method with only a title.
Sample request body
{
"info": {
"title": "My new form"
}
}
Python
Node.js
Duplicate an existing form
You can duplicate an existing form with the Google Drive API to make content re-use easier. You can find the form ID in a Google Forms URL:
https://docs.google.com/forms/d/FORM_ID/edit
REST
Call the Google Drive API's files.copy()
method with the ID of the form you want to copy.
Python
Convert a form to a quiz
To create a quiz, first create a form as described above, then update the form's settings. The update requires the form ID.
REST
Call the batch.update()
method on an existing form to set the isQuiz
setting to true.
Sample request body
{
"requests": [
{
"updateSettings": {
"settings": {
"quizSettings": {
"isQuiz": True
}
},
"updateMask": "quizSettings.isQuiz"
}
}
]
}
Python
Node.js
Next steps
Here are a few next steps you might try:
- To add or update form content, refer to Update a form or quiz.
- To view form information or responses, refer to Retrieve forms and responses.