양식 작성자가 응답할 수 있는 사용자를 더 세부적으로 관리할 수 있도록 응답자에 대한 세부적인 관리 기능이 도입됩니다. 2026년 1월 31일 이후에 API로 만든 양식은 기본적으로 게시되지 않은 상태입니다. 자세한 내용은
Google Forms API 변경사항을 참고하세요.
양식 또는 퀴즈 만들기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 양식과 관련된 다음 작업을 수행하는 방법을 설명합니다.
- 새 양식 만들기
- 기존 양식 복제
- 양식을 퀴즈로 변환하기
시작하기 전에
이 페이지의 작업을 진행하기 전에 다음 작업을 수행하세요.
- 사전 체험판 프로그램 안내에서 승인 또는 인증 및 사용자 인증 정보 설정을 완료합니다.
- Forms API 개요를 읽어보세요.
양식을 처음 만들 때는 제목 필드만 필요합니다. 요청의 다른 필드는 무시됩니다. 양식의 콘텐츠와 메타데이터를 빌드하거나 업데이트하려면 batchUpdate()
메서드를 사용하세요. 자세한 내용은 양식 또는 퀴즈 업데이트를 참고하세요.
REST
제목만 사용하여 forms.create()
메서드를 호출합니다.
샘플 요청 본문
{
"info": {
"title": "My new form"
}
}
Google Drive API를 사용하여 기존 양식을 복제하면 콘텐츠를 더 쉽게 재사용할 수 있습니다. Google Forms URL에서 양식 ID를 확인할 수 있습니다.
https://docs.google.com/forms/d/FORM_ID/edit
REST
복사하려는 양식의 ID를 사용하여 Google Drive API의 files.copy()
메서드를 호출합니다.
퀴즈를 만들려면 먼저 새 양식 만들기에 설명된 대로 양식을 만든 다음 양식 설정을 업데이트합니다. 업데이트하려면 양식 ID가 필요합니다.
REST
기존 양식에서 batch.update()
메서드를 호출하여 isQuiz
설정을 true로 설정합니다.
샘플 요청 본문
{
"requests": [
{
"updateSettings": {
"settings": {
"quizSettings": {
"isQuiz": True
}
},
"updateMask": "quizSettings.isQuiz"
}
}
]
}
다음 단계
다음과 같은 몇 가지 단계를 수행할 수 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-06-27(UTC)
[null,null,["최종 업데이트: 2025-06-27(UTC)"],[],["This document details how to create, duplicate, and convert forms. To create a new form, use the `forms.create()` method with a title. To duplicate a form, employ the Drive API's `files.copy()` method, specifying the form's ID. To convert a form into a quiz, use the `batch.update()` method to change the `isQuiz` setting to true, also requires the form ID. Authorization and authentication setup as indicated in the instructions is required.\n"],null,["# Create a form or quiz\n\nThis page describes how to perform these tasks involving forms:\n\n- Create a new form\n- Duplicate an existing form\n- Convert a form to a quiz\n\nBefore you begin\n----------------\n\nDo the following tasks before proceeding with the tasks on this page:\n\n- Complete authorization or authentication and credentials setup in the Early Adopter Program instructions.\n- Read the [Forms API overview](/workspace/forms/api/guides).\n\nCreate a new form\n-----------------\n\nThe initial creation of a form only requires a title field---any other fields\nin the request will be ignored. To build out the content and metadata of a\nform or make updates, use the `batchUpdate()` method. See\n[Update a form or quiz](/workspace/forms/api/guides/update-form-quiz) for more\ninformation. \n\n### REST\n\nCall the [`forms.create()`](/workspace/forms/api/reference/rest/v1/forms/create)\nmethod with only a title.\n\n**Sample request body** \n\n {\n \"info\": {\n \"title\": \"My new form\"\n }\n }\n\n### Python\n\nforms/snippets/create_form.py \n[View on GitHub](https://github.com/googleworkspace/python-samples/blob/main/forms/snippets/create_form.py) \n\n```python\nfrom apiclient import discovery\nfrom httplib2 import Http\nfrom oauth2client import client, file, tools\n\nSCOPES = \"https://www.googleapis.com/auth/drive\"\nDISCOVERY_DOC = \"https://forms.googleapis.com/$discovery/rest?version=v1\"\n\nstore = file.Storage(\"token.json\")\ncreds = None\nif not creds or creds.invalid:\n flow = client.flow_from_clientsecrets(\"client_secrets.json\", SCOPES)\n creds = tools.run_flow(flow, store)\n\nform_service = discovery.build(\n \"forms\",\n \"v1\",\n http=creds.authorize(Http()),\n discoveryServiceUrl=DISCOVERY_DOC,\n static_discovery=False,\n)\n\nform = {\n \"info\": {\n \"title\": \"My new form\",\n },\n}\n# Prints the details of the sample form\nresult = form_service.forms().create(body=form).execute()\nprint(result)\n```\n\n### Node.js\n\nforms/snippets/create_form.js \n[View on GitHub](https://github.com/googleworkspace/node-samples/blob/main/forms/snippets/create_form.js) \n\n```javascript\n'use strict';\n\nconst path = require('path');\nconst google = require('@googleapis/forms');\nconst {authenticate} = require('@google-cloud/local-auth');\n\nasync function runSample(query) {\n const authClient = await authenticate({\n keyfilePath: path.join(__dirname, 'credentials.json'),\n scopes: 'https://www.googleapis.com/auth/drive',\n });\n const forms = google.forms({\n version: 'v1',\n auth: authClient,\n });\n const newForm = {\n info: {\n title: 'Creating a new form in Node',\n },\n };\n const res = await forms.forms.create({\n requestBody: newForm,\n });\n console.log(res.data);\n return res.data;\n}\n\nif (module === require.main) {\n runSample().catch(console.error);\n}\nmodule.exports = runSample;\n```\n\nDuplicate an existing form\n--------------------------\n\nYou can duplicate an existing form with the\n[Google Drive API](/workspace/drive/api/v3/about-sdk) to make content re-use\neasier. You can find the form ID in a Google Forms URL:\n\n`https://docs.google.com/forms/d/FORM_ID/edit` \n\n### REST\n\nCall the Google Drive API's\n[`files.copy()`](/workspace/drive/v3/reference/files/copy)\nmethod with the ID of the form you want to copy.\n\n### Python\n\nforms/snippets/duplicate_form.py \n[View on GitHub](https://github.com/googleworkspace/python-samples/blob/main/forms/snippets/duplicate_form.py) \n\n```python\nimport os.path\n\nfrom google.auth.transport.requests import Request\nfrom google.oauth2.credentials import Credentials\nfrom google_auth_oauthlib.flow import InstalledAppFlow\nfrom googleapiclient.discovery import build\n\n# If modifying these scopes, delete the file token.json.\nSCOPES = [\"https://www.googleapis.com/auth/drive\"]\n\n\ndef main():\n \"\"\"Shows copy file example in Drive v3 API.\n Prints the name, id and other data of the copied file.\n \"\"\"\n creds = None\n if os.path.exists(\"token.json\"):\n creds = Credentials.from_authorized_user_file(\"token.json\", SCOPES)\n # If there are no (valid) credentials available, let the user log in.\n if not creds or not creds.valid:\n if creds and creds.expired and creds.refresh_token:\n creds.refresh(Request())\n else:\n flow = InstalledAppFlow.from_client_secrets_file(\n \"client_secrets.json\", SCOPES\n )\n creds = flow.run_local_server(port=0)\n # Save the credentials for the next run\n with open(\"token.json\", \"w\") as token:\n token.write(creds.to_json())\n\n service = build(\"drive\", \"v3\", credentials=creds)\n\n # Call the Drive v3 API\n origin_file_id = \"1ox-6vHFeKpC6mon-tL5ygBC8zpbTnTp76JCZdIg80hA\" # example ID\n copied_file = {\"title\": \"my_copy\"}\n results = (\n service.files().copy(fileId=origin_file_id, body=copied_file).execute()\n )\n print(results)\n\n\nif __name__ == \"__main__\":\n main()\n```\n\nConvert a form to a quiz\n------------------------\n\nTo create a quiz, first create a form as described in [Create a new form](#create_a_new_form),\nthen update the form's settings. The update requires the form ID. \n\n### REST\n\nCall the\n[`batch.update()`](/workspace/forms/api/reference/rest/v1/forms/batchUpdate)\nmethod on an existing form to set the `isQuiz` setting to true.\n\n**Sample request body** \n\n {\n \"requests\": [\n {\n \"updateSettings\": {\n \"settings\": {\n \"quizSettings\": {\n \"isQuiz\": True\n }\n },\n \"updateMask\": \"quizSettings.isQuiz\"\n }\n }\n ]\n }\n\n### Python\n\nforms/snippets/convert_form.py \n[View on GitHub](https://github.com/googleworkspace/python-samples/blob/main/forms/snippets/convert_form.py) \n\n```python\nfrom apiclient import discovery\nfrom httplib2 import Http\nfrom oauth2client import client, file, tools\n\nSCOPES = \"https://www.googleapis.com/auth/forms.body\"\nDISCOVERY_DOC = \"https://forms.googleapis.com/$discovery/rest?version=v1\"\n\nstore = file.Storage(\"token.json\")\ncreds = None\nif not creds or creds.invalid:\n flow = client.flow_from_clientsecrets(\"client_secrets.json\", SCOPES)\n creds = tools.run_flow(flow, store)\n\nform_service = discovery.build(\n \"forms\",\n \"v1\",\n http=creds.authorize(Http()),\n discoveryServiceUrl=DISCOVERY_DOC,\n static_discovery=False,\n)\n\nform = {\n \"info\": {\n \"title\": \"My new quiz\",\n }\n}\n\n# Creates the initial form\nresult = form_service.forms().create(body=form).execute()\n\n# JSON to convert the form into a quiz\nupdate = {\n \"requests\": [\n {\n \"updateSettings\": {\n \"settings\": {\"quizSettings\": {\"isQuiz\": True}},\n \"updateMask\": \"quizSettings.isQuiz\",\n }\n }\n ]\n}\n\n# Converts the form into a quiz\nquestion_setting = (\n form_service.forms()\n .batchUpdate(formId=result[\"formId\"], body=update)\n .execute()\n)\n\n# Print the result to see it's now a quiz\ngetresult = form_service.forms().get(formId=result[\"formId\"]).execute()\nprint(getresult)\n```\n\n### Node.js\n\nforms/snippets/convert_form.js \n[View on GitHub](https://github.com/googleworkspace/node-samples/blob/main/forms/snippets/convert_form.js) \n\n```javascript\n'use strict';\n\nconst path = require('path');\nconst google = require('@googleapis/forms');\nconst {authenticate} = require('@google-cloud/local-auth');\n\nasync function runSample(query) {\n const authClient = await authenticate({\n keyfilePath: path.join(__dirname, 'credentials.json'),\n scopes: 'https://www.googleapis.com/auth/drive',\n });\n const forms = google.forms({\n version: 'v1',\n auth: authClient,\n });\n const newForm = {\n info: {\n title: 'Creating a new form for batchUpdate in Node',\n },\n };\n const createResponse = await forms.forms.create({\n requestBody: newForm,\n });\n console.log('New formId was: ' + createResponse.data.formId);\n\n // Request body to convert form to a quiz\n const updateRequest = {\n requests: [\n {\n updateSettings: {\n settings: {\n quizSettings: {\n isQuiz: true,\n },\n },\n updateMask: 'quizSettings.isQuiz',\n },\n },\n ],\n };\n const res = await forms.forms.batchUpdate({\n formId: createResponse.data.formId,\n requestBody: updateRequest,\n });\n console.log(res.data);\n return res.data;\n}\n\nif (module === require.main) {\n runSample().catch(console.error);\n}\nmodule.exports = runSample;\n```\n\nNext steps\n----------\n\nHere are a few next steps you might try:\n\n- To add or update form content, refer to [Update a form or quiz](/workspace/forms/api/guides/update-form-quiz).\n- To view form information or responses, refer to [Retrieve forms and responses](/workspace/forms/api/guides/retrieve-forms-responses).\n- To publish the form and manage responders, refer to [Publish and manage responders](/workspace/forms/api/guides/publish-form)."]]