Foxpro / Zoom API / Update registration questions
Back to Collection Items
LOCAL loHttp
LOCAL lnSuccess
LOCAL loReq
LOCAL loJsonFormData1
LOCAL loJsonObj_1
LOCAL loJsonFormData2
LOCAL loJsonObj_1
LOCAL loResp
LOCAL lnRespStatusCode
* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.HttpRequest')
loReq = CreateObject('Chilkat.HttpRequest')
loReq.HttpVerb = "PATCH"
loReq.Path = "/v2/meetings/:meetingId/registrants/questions"
loReq.ContentType = "multipart/form-data"
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonArray')
loJsonFormData1 = CreateObject('Chilkat.JsonArray')
loJsonFormData1.AddObjectAt(-1)
loJsonObj_1 = loJsonFormData1.ObjectAt(loJsonFormData1.Size - 1)
loJsonObj_1.UpdateString("field_name","address")
loJsonObj_1.UpdateBool("required",0)
RELEASE loJsonObj_1
loJsonFormData1.AddObjectAt(-1)
loJsonObj_1 = loJsonFormData1.ObjectAt(loJsonFormData1.Size - 1)
loJsonObj_1.UpdateString("field_name","phone")
loJsonObj_1.UpdateBool("required",0)
RELEASE loJsonObj_1
loReq.AddStringForUpload2("questions","",loJsonFormData1,"utf-8","application/json")
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonArray')
loJsonFormData2 = CreateObject('Chilkat.JsonArray')
loJsonFormData2.AddObjectAt(-1)
loJsonObj_1 = loJsonFormData2.ObjectAt(loJsonFormData2.Size - 1)
loJsonObj_1.UpdateString("field_name","address")
loJsonObj_1.UpdateBool("required",0)
RELEASE loJsonObj_1
loJsonFormData2.AddObjectAt(-1)
loJsonObj_1 = loJsonFormData2.ObjectAt(loJsonFormData2.Size - 1)
loJsonObj_1.UpdateString("field_name","phone")
loJsonObj_1.UpdateBool("required",0)
RELEASE loJsonObj_1
loReq.AddStringForUpload2("custom_questions","",loJsonFormData2,"utf-8","application/json")
loReq.AddHeader("Authorization","Bearer <access_token>")
loResp = loHttp.SynchronousRequest("api.zoom.us",443,1,loReq)
IF (loHttp.LastMethodSuccess = 0) THEN
? loHttp.LastErrorText
RELEASE loHttp
RELEASE loReq
RELEASE loJsonFormData1
RELEASE loJsonFormData2
CANCEL
ENDIF
lnRespStatusCode = loResp.StatusCode
? "Response Status Code = " + STR(lnRespStatusCode)
IF (lnRespStatusCode <> 204) THEN
? "Response Header:"
? loResp.Header
? "Response Body:"
? loResp.BodyStr
? "Failed."
RELEASE loResp
RELEASE loHttp
RELEASE loReq
RELEASE loJsonFormData1
RELEASE loJsonFormData2
CANCEL
ENDIF
RELEASE loResp
? "Success."
RELEASE loHttp
RELEASE loReq
RELEASE loJsonFormData1
RELEASE loJsonFormData2
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": ""
}
]
}