You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pclass="firstline">Create a new form using the title given in the provided form message in the request. *Important:* Only the form.info.title and form.info.document_title fields are copied to the new form. All other fields including the form description, items and settings are disallowed. To create a new form and add items, you must first call forms.create to create an empty form with a title and (optional) document title, and then call forms.update to add the items.</p>
"linkedSheetId": "A String", # Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists).
1084
+
"publishSettings": { # The publishing settings of a form. # Output only. The publishing settings for a form. This field isn't set for legacy forms because they don't have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.
1085
+
"publishState": { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn't supported and returns an error.
1086
+
"isAcceptingResponses": True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
1087
+
"isPublished": True or False, # Required. Whether the form is published and visible to others.
1088
+
},
1089
+
},
1081
1090
"responderUri": "A String", # Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.
1082
1091
"revisionId": "A String", # Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes.
1083
1092
"settings": { # A form's settings. # The form's settings. This must be updated with UpdateSettingsRequest; it is ignored during `forms.create` and UpdateFormInfoRequest.
<pre>Create a new form using the title given in the provided form message in the request. *Important:* Only the form.info.title and form.info.document_title fields are copied to the new form. All other fields including the form description, items and settings are disallowed. To create a new form and add items, you must first call forms.create to create an empty form with a title and (optional) document title, and then call forms.update to add the items.
1115
1124
1116
1125
Args:
@@ -1427,6 +1436,12 @@ <h3>Method Details</h3>
1427
1436
},
1428
1437
],
1429
1438
"linkedSheetId": "A String", # Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists).
1439
+
"publishSettings": { # The publishing settings of a form. # Output only. The publishing settings for a form. This field isn't set for legacy forms because they don't have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.
1440
+
"publishState": { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn't supported and returns an error.
1441
+
"isAcceptingResponses": True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
1442
+
"isPublished": True or False, # Required. Whether the form is published and visible to others.
1443
+
},
1444
+
},
1430
1445
"responderUri": "A String", # Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.
1431
1446
"revisionId": "A String", # Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes.
1432
1447
"settings": { # A form's settings. # The form's settings. This must be updated with UpdateSettingsRequest; it is ignored during `forms.create` and UpdateFormInfoRequest.
@@ -1437,6 +1452,7 @@ <h3>Method Details</h3>
1437
1452
},
1438
1453
}
1439
1454
1455
+
unpublished: boolean, Optional. Whether the form is unpublished. If set to `true`, the form doesn't accept responses. If set to `false` or unset, the form is published and accepts responses.
1440
1456
x__xgafv: string, V1 error format.
1441
1457
Allowed values
1442
1458
1 - v1 error format
@@ -1755,6 +1771,12 @@ <h3>Method Details</h3>
1755
1771
},
1756
1772
],
1757
1773
"linkedSheetId": "A String", # Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists).
1774
+
"publishSettings": { # The publishing settings of a form. # Output only. The publishing settings for a form. This field isn't set for legacy forms because they don't have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.
1775
+
"publishState": { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn't supported and returns an error.
1776
+
"isAcceptingResponses": True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
1777
+
"isPublished": True or False, # Required. Whether the form is published and visible to others.
1778
+
},
1779
+
},
1758
1780
"responderUri": "A String", # Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.
1759
1781
"revisionId": "A String", # Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes.
1760
1782
"settings": { # A form's settings. # The form's settings. This must be updated with UpdateSettingsRequest; it is ignored during `forms.create` and UpdateFormInfoRequest.
@@ -2090,6 +2112,12 @@ <h3>Method Details</h3>
2090
2112
},
2091
2113
],
2092
2114
"linkedSheetId": "A String", # Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists).
2115
+
"publishSettings": { # The publishing settings of a form. # Output only. The publishing settings for a form. This field isn't set for legacy forms because they don't have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.
2116
+
"publishState": { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn't supported and returns an error.
2117
+
"isAcceptingResponses": True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
2118
+
"isPublished": True or False, # Required. Whether the form is published and visible to others.
2119
+
},
2120
+
},
2093
2121
"responderUri": "A String", # Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.
2094
2122
"revisionId": "A String", # Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes.
2095
2123
"settings": { # A form's settings. # The form's settings. This must be updated with UpdateSettingsRequest; it is ignored during `forms.create` and UpdateFormInfoRequest.
<pre>Updates the publish settings of a form. Legacy forms aren't supported because they don't have the `publish_settings` field.
2135
+
2136
+
Args:
2137
+
formId: string, Required. The ID of the form. You can get the id from `Form.form_id` field. (required)
2138
+
body: object, The request body.
2139
+
The object takes the form of:
2140
+
2141
+
{ # Updates the publish settings of a Form.
2142
+
"publishSettings": { # The publishing settings of a form. # Required. The desired publish settings to apply to the form.
2143
+
"publishState": { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn't supported and returns an error.
2144
+
"isAcceptingResponses": True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
2145
+
"isPublished": True or False, # Required. Whether the form is published and visible to others.
2146
+
},
2147
+
},
2148
+
"updateMask": "A String", # Optional. The `publish_settings` fields to update. This field mask accepts the following values: * `publish_state`: Updates or replaces all `publish_state` settings. * `"*"`: Updates or replaces all `publish_settings` fields.
2149
+
}
2150
+
2151
+
x__xgafv: string, V1 error format.
2152
+
Allowed values
2153
+
1 - v1 error format
2154
+
2 - v2 error format
2155
+
2156
+
Returns:
2157
+
An object of the form:
2158
+
2159
+
{ # The response of a `SetPublishSettings` request.
2160
+
"formId": "A String", # Required. The ID of the Form. This is same as the `Form.form_id` field.
2161
+
"publishSettings": { # The publishing settings of a form. # The publish settings of the form.
2162
+
"publishState": { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn't supported and returns an error.
2163
+
"isAcceptingResponses": True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
2164
+
"isPublished": True or False, # Required. Whether the form is published and visible to others.
Copy file name to clipboardexpand all lines: googleapiclient/discovery_cache/documents/forms.v1.json
+99-2
Original file line number
Diff line number
Diff line change
@@ -157,7 +157,13 @@
157
157
"httpMethod": "POST",
158
158
"id": "forms.forms.create",
159
159
"parameterOrder": [],
160
-
"parameters": {},
160
+
"parameters": {
161
+
"unpublished": {
162
+
"description": "Optional. Whether the form is unpublished. If set to `true`, the form doesn't accept responses. If set to `false` or unset, the form is published and accepts responses.",
"description": "Required. The ID of the form. You can get the id from `Form.form_id` field.",
219
+
"location": "path",
220
+
"required": true,
221
+
"type": "string"
222
+
}
223
+
},
224
+
"path": "v1/forms/{formId}:setPublishSettings",
225
+
"request": {
226
+
"$ref": "SetPublishSettingsRequest"
227
+
},
228
+
"response": {
229
+
"$ref": "SetPublishSettingsResponse"
230
+
},
231
+
"scopes": [
232
+
"https://www.googleapis.com/auth/drive",
233
+
"https://www.googleapis.com/auth/drive.file",
234
+
"https://www.googleapis.com/auth/forms.body"
235
+
]
201
236
}
202
237
},
203
238
"resources": {
@@ -423,7 +458,7 @@
423
458
}
424
459
}
425
460
},
426
-
"revision": "20250218",
461
+
"revision": "20250304",
427
462
"rootUrl": "https://forms.googleapis.com/",
428
463
"schemas": {
429
464
"Answer": {
@@ -794,6 +829,11 @@
794
829
"readOnly": true,
795
830
"type": "string"
796
831
},
832
+
"publishSettings": {
833
+
"$ref": "PublishSettings",
834
+
"description": "Output only. The publishing settings for a form. This field isn't set for legacy forms because they don't have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.",
835
+
"readOnly": true
836
+
},
797
837
"responderUri": {
798
838
"description": "Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.",
799
839
"readOnly": true,
@@ -1182,6 +1222,32 @@
1182
1222
"properties": {},
1183
1223
"type": "object"
1184
1224
},
1225
+
"PublishSettings": {
1226
+
"description": "The publishing settings of a form.",
1227
+
"id": "PublishSettings",
1228
+
"properties": {
1229
+
"publishState": {
1230
+
"$ref": "PublishState",
1231
+
"description": "Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn't supported and returns an error."
1232
+
}
1233
+
},
1234
+
"type": "object"
1235
+
},
1236
+
"PublishState": {
1237
+
"description": "The publishing state of a form.",
1238
+
"id": "PublishState",
1239
+
"properties": {
1240
+
"isAcceptingResponses": {
1241
+
"description": "Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.",
1242
+
"type": "boolean"
1243
+
},
1244
+
"isPublished": {
1245
+
"description": "Required. Whether the form is published and visible to others.",
1246
+
"type": "boolean"
1247
+
}
1248
+
},
1249
+
"type": "object"
1250
+
},
1185
1251
"Question": {
1186
1252
"description": "Any question. The specific type of question is known by its `kind`.",
1187
1253
"id": "Question",
@@ -1393,6 +1459,37 @@
1393
1459
},
1394
1460
"type": "object"
1395
1461
},
1462
+
"SetPublishSettingsRequest": {
1463
+
"description": "Updates the publish settings of a Form.",
1464
+
"id": "SetPublishSettingsRequest",
1465
+
"properties": {
1466
+
"publishSettings": {
1467
+
"$ref": "PublishSettings",
1468
+
"description": "Required. The desired publish settings to apply to the form."
1469
+
},
1470
+
"updateMask": {
1471
+
"description": "Optional. The `publish_settings` fields to update. This field mask accepts the following values: * `publish_state`: Updates or replaces all `publish_state` settings. * `\"*\"`: Updates or replaces all `publish_settings` fields.",
1472
+
"format": "google-fieldmask",
1473
+
"type": "string"
1474
+
}
1475
+
},
1476
+
"type": "object"
1477
+
},
1478
+
"SetPublishSettingsResponse": {
1479
+
"description": "The response of a `SetPublishSettings` request.",
1480
+
"id": "SetPublishSettingsResponse",
1481
+
"properties": {
1482
+
"formId": {
1483
+
"description": "Required. The ID of the Form. This is same as the `Form.form_id` field.",
1484
+
"type": "string"
1485
+
},
1486
+
"publishSettings": {
1487
+
"$ref": "PublishSettings",
1488
+
"description": "The publish settings of the form."
1489
+
}
1490
+
},
1491
+
"type": "object"
1492
+
},
1396
1493
"TextAnswer": {
1397
1494
"description": "An answer to a question represented as text.",
0 commit comments