Closed irealva closed 2 months ago
Same issue with the .NET Client. I did not find any way to set the EmailCollectionType
@irealva I found out that when you change the updateMask
value from *
to specific fields, it does not return an error.
For example, change the updateMask
value to "quizSettings"
Thanks @cb-eli, when I try updateMask: "quizSettings
I get another error:
await fetch(
`https://forms.googleapis.com/v1/forms/${formId}:batchUpdate`,
{
method: "POST",
headers: headers,
body: JSON.stringify({
includeFormInResponse: false,
requests: [
{
updateSettings: {
settings: {
quizSettings: {
isQuiz: true,
},
},
updateMask: "quizSettings",
},
},
],
}),
}
);
{
"success": false,
"response": {
"error": {
"code": 400,
"message": "BatchUpdateFormRequest must contain at least one Request",
"status": "INVALID_ARGUMENT"
}
}
}
updateMask: "quizSettings"
--> "BatchUpdateFormRequest must contain at least one Request"updateMask: "settings"
--> "Invalid field: settings"updateMask
--> "Update mask required"In any case this seems like a regression in the API as the updateMask field can clearly take in a "*".
Required. Only values named in this mask are changed. At least one field must be specified. The root info is implied and should not be specified. A single "*" can be used as short-hand for updating every field.
What else could I try for now to keep my prod app working?
Update this seems to work...
await fetch(
`https://forms.googleapis.com/v1/forms/${formId}:batchUpdate`,
{
method: "POST",
headers: headers,
body: JSON.stringify({
includeFormInResponse: false,
requests: [
{
updateSettings: {
settings: {
quizSettings: {
isQuiz: true,
},
},
updateMask: "quizSettings.isQuiz",
},
},
],
}),
}
);
I was also using an asterisk in production, seems like Google changed something in the API without saying anything.
On the .NET client it was enough to specify quizSettings
.
Anyway, happy that it works for now :)
Hi, we've been using the Google Forms API for quite some time and about 2 weeks ago it just broke with an error:
We've figured out that the value
emailCollectionType
should be under settings but for the life of me can't figure out what the enum value should be. This seems nowhere to be found in the node API library, in the documentation, or anywhere else. What's going on?This is what I'm trying: