autoit / Zoom API / Update registration questions
Back to Collection Items
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
Local $bSuccess
$oReq = ObjCreate("Chilkat.HttpRequest")
$oReq.HttpVerb = "PATCH"
$oReq.Path = "/v2/meetings/:meetingId/registrants/questions"
$oReq.ContentType = "multipart/form-data"
$oJsonFormData1 = ObjCreate("Chilkat.JsonArray")
$oJsonFormData1.AddObjectAt(-1)
Local $oJsonObj_1 = $oJsonFormData1.ObjectAt($oJsonFormData1.Size - 1)
$oJsonObj_1.UpdateString("field_name","address")
$oJsonObj_1.UpdateBool("required",False)
$oJsonFormData1.AddObjectAt(-1)
$oJsonObj_1 = $oJsonFormData1.ObjectAt($oJsonFormData1.Size - 1)
$oJsonObj_1.UpdateString("field_name","phone")
$oJsonObj_1.UpdateBool("required",False)
$oReq.AddStringForUpload2("questions","",$oJsonFormData1,"utf-8","application/json")
$oJsonFormData2 = ObjCreate("Chilkat.JsonArray")
$oJsonFormData2.AddObjectAt(-1)
Local $oJsonObj_1 = $oJsonFormData2.ObjectAt($oJsonFormData2.Size - 1)
$oJsonObj_1.UpdateString("field_name","address")
$oJsonObj_1.UpdateBool("required",False)
$oJsonFormData2.AddObjectAt(-1)
$oJsonObj_1 = $oJsonFormData2.ObjectAt($oJsonFormData2.Size - 1)
$oJsonObj_1.UpdateString("field_name","phone")
$oJsonObj_1.UpdateBool("required",False)
$oReq.AddStringForUpload2("custom_questions","",$oJsonFormData2,"utf-8","application/json")
$oReq.AddHeader "Authorization","Bearer <access_token>"
Local $oResp = $oHttp.SynchronousRequest("api.zoom.us",443,True,$oReq)
If ($oHttp.LastMethodSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
Local $iRespStatusCode = $oResp.StatusCode
ConsoleWrite("Response Status Code = " & $iRespStatusCode & @CRLF)
If ($iRespStatusCode <> 204) Then
ConsoleWrite("Response Header:" & @CRLF)
ConsoleWrite($oResp.Header & @CRLF)
ConsoleWrite("Response Body:" & @CRLF)
ConsoleWrite($oResp.BodyStr & @CRLF)
ConsoleWrite("Failed." & @CRLF)
Exit
EndIf
ConsoleWrite("Success." & @CRLF)
Curl Command
curl -X PATCH
-H "Authorization: Bearer <access_token>"
-H "Content-Type: multipart/form-data"
--form 'questions=[{"field_name":"address","required":false},{"field_name":"phone","required":false}]'
--form 'custom_questions=[{"field_name":"address","required":false},{"field_name":"phone","required":false}][{"title":"commodo","type":"single","required":true,"answers":["magna aute nostrud id proident","pariatur aliquip"]},{"title":"id nisi reprehenderit esse","type":"short","required":false,"answers":["amet pariatur Lorem ullamco","Ut cillum"]}]'
https://api.zoom.us/v2/meetings/:meetingId/registrants/questions
Postman Collection Item JSON
{
"name": "Update registration questions",
"request": {
"auth": {
"type": "oauth2"
},
"method": "PATCH",
"header": [
{
"key": "Content-Type",
"value": "multipart/form-data"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "questions",
"value": "[{\"field_name\":\"address\",\"required\":false},{\"field_name\":\"phone\",\"required\":false}]",
"description": "undefined",
"type": "text"
},
{
"key": "custom_questions",
"value": "[{\"title\":\"commodo\",\"type\":\"single\",\"required\":true,\"answers\":[\"magna aute nostrud id proident\",\"pariatur aliquip\"]},{\"title\":\"id nisi reprehenderit esse\",\"type\":\"short\",\"required\":false,\"answers\":[\"amet pariatur Lorem ullamco\",\"Ut cillum\"]}]",
"description": "undefined",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/meetings/:meetingId/registrants/questions",
"host": [
"{{baseUrl}}"
],
"path": [
"meetings",
":meetingId",
"registrants",
"questions"
],
"variable": [
{
"key": "meetingId",
"value": "68423085",
"description": "(Required) The meeting's ID. \n\n When storing this value in your database, you must store it as a **long** format integer and **not** an integer. Meeting IDs can exceed 10 digits."
}
]
},
"description": "Update registration questions that will be displayed to users while [registering for a meeting](https://support.zoom.us/hc/en-us/articles/211579443-Registration-for-Meetings).<br><br>\n**Scopes:** `meeting:write`, `meeting:write:admin`<br>\n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`\n \n\n"
},
"response": [
{
"name": "**HTTP Status Code:** `204`<br>\nMeeting Registrant Questions Updated",
"originalRequest": {
"method": "PATCH",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "questions",
"value": "[{\"field_name\":\"comments\",\"required\":true},{\"field_name\":\"phone\",\"required\":false}]",
"description": "undefined",
"type": "text"
},
{
"key": "custom_questions",
"value": "[{\"title\":\"incididunt in\",\"type\":\"single\",\"required\":true,\"answers\":[\"voluptate labore\",\"deserunt \"]},{\"title\":\"fugia\",\"type\":\"short\",\"required\":false,\"answers\":[\"min\",\"dolore in sint \"]}]",
"description": "undefined",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/meetings/:meetingId/registrants/questions",
"host": [
"{{baseUrl}}"
],
"path": [
"meetings",
":meetingId",
"registrants",
"questions"
],
"variable": [
{
"key": "meetingId",
"value": "68423085",
"description": "(Required) The meeting's ID. \n\n When storing this value in your database, you must store it as a **long** format integer and **not** an integer. Meeting IDs can exceed 10 digits."
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "**HTTP Status Code:** `404`<br>\nMeeting not found.",
"originalRequest": {
"method": "PATCH",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "questions",
"value": "[{\"field_name\":\"comments\",\"required\":true},{\"field_name\":\"phone\",\"required\":false}]",
"description": "undefined",
"type": "text"
},
{
"key": "custom_questions",
"value": "[{\"title\":\"incididunt in\",\"type\":\"single\",\"required\":true,\"answers\":[\"voluptate labore\",\"deserunt \"]},{\"title\":\"fugia\",\"type\":\"short\",\"required\":false,\"answers\":[\"min\",\"dolore in sint \"]}]",
"description": "undefined",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/meetings/:meetingId/registrants/questions",
"host": [
"{{baseUrl}}"
],
"path": [
"meetings",
":meetingId",
"registrants",
"questions"
],
"variable": [
{
"key": "meetingId",
"value": "68423085",
"description": "(Required) The meeting's ID. \n\n When storing this value in your database, you must store it as a **long** format integer and **not** an integer. Meeting IDs can exceed 10 digits."
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}