PowerBuilder / Zoom API / Perform batch registration
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Req
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Registrant_id
string ls_Email
string ls_Join_url
integer i
integer li_Count_i
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_Req = create oleobject
// Use "Chilkat_9_5_0.HttpRequest" for versions of Chilkat < 10.0.0
li_rc = loo_Req.ConnectToNewObject("Chilkat.HttpRequest")
loo_Req.HttpVerb = "POST"
loo_Req.Path = "/v2/webinars/:webinarId/batch_registrants"
loo_Req.ContentType = "multipart/form-data"
loo_Req.AddParam("auto_approve","true")
loo_Req.AddParam("registrants","true[{~"first_name~":~"dolore eu aute dolor~",~"email~":~"KEESPCs-T1pF@ljUbrzdNgzMc.xx~",~"last_name~":~"eu reprehenderit ea magna ex~"},{~"first_name~":~"aliquip deserunt~",~"email~":~"okZ9KNk@nZOovoEvyoTCgW.eftt~",~"last_name~":~"nostrud~"}]")
loo_Req.AddHeader("Authorization","Bearer <access_token>")
loo_Resp = loo_Http.SynchronousRequest("api.zoom.us",443,1,loo_Req)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_Req
return
end if
loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")
loo_Resp.GetBodySb(loo_SbResponseBody)
loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")
loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0
Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()
li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
Write-Debug "Response Header:"
Write-Debug loo_Resp.Header
Write-Debug "Failed."
destroy loo_Resp
destroy loo_Http
destroy loo_Req
destroy loo_SbResponseBody
destroy loo_JResp
return
end if
destroy loo_Resp
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "registrants": [
// {
// "registrant_id": "conseret14re",
// "email": "example@example.com",
// "join_url": " https://zoom.us/w/9999999?tk=oZuwHfdgAAAAAAAAAAAAAAAA&uuid=WN_XW4_SdxBBBBxLDQt"
// },
// {
// "registrant_id": "fdgsfh2ey82fuh",
// "email": "example-2@example.com",
// "join_url": " https://zoom.us/w/9999999?tk=oZu52542356AAAAAA&uuid=WN_XW4_SdxBBBBxLDQt"
// },
// {
// "registrant_id": "hdsfhjf3iwh",
// "email": "example-3@example.com",
// "join_url": " https://zoom.us/w/9999999?tk=ozghdfdsghf36AAA&uuid=WN_XW4_SdxBBBBxLDQt"
// }
// ]
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
i = 0
li_Count_i = loo_JResp.SizeOfArray("registrants")
do while i < li_Count_i
loo_JResp.I = i
ls_Registrant_id = loo_JResp.StringOf("registrants[i].registrant_id")
ls_Email = loo_JResp.StringOf("registrants[i].email")
ls_Join_url = loo_JResp.StringOf("registrants[i].join_url")
i = i + 1
loop
destroy loo_Http
destroy loo_Req
destroy loo_SbResponseBody
destroy loo_JResp
Curl Command
curl -X POST
-H "Authorization: Bearer <access_token>"
-H "Content-Type: multipart/form-data"
--form 'auto_approve=true'
--form 'registrants=true[{"first_name":"dolore eu aute dolor","email":"KEESPCs-T1pF@ljUbrzdNgzMc.xx","last_name":"eu reprehenderit ea magna ex"},{"first_name":"aliquip deserunt","email":"okZ9KNk@nZOovoEvyoTCgW.eftt","last_name":"nostrud"}]'
https://api.zoom.us/v2/webinars/:webinarId/batch_registrants
Postman Collection Item JSON
{
"name": "Perform batch registration",
"request": {
"auth": {
"type": "oauth2"
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "multipart/form-data"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "auto_approve",
"value": "true",
"description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting that was originally scheduled with approval_type `0` (automatic approval).",
"type": "text"
},
{
"key": "registrants",
"value": "[{\"first_name\":\"dolore eu aute dolor\",\"email\":\"KEESPCs-T1pF@ljUbrzdNgzMc.xx\",\"last_name\":\"eu reprehenderit ea magna ex\"},{\"first_name\":\"aliquip deserunt\",\"email\":\"okZ9KNk@nZOovoEvyoTCgW.eftt\",\"last_name\":\"nostrud\"}]",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
"host": [
"{{baseUrl}}"
],
"path": [
"webinars",
":webinarId",
"batch_registrants"
],
"variable": [
{
"key": "webinarId",
"value": "quis officia in reprehenderit",
"description": "(Required) Unique identifier of the webinar."
}
]
},
"description": "Use this API to register up to 30 registrants at once for a scheduled webinar that requires [registration](https://support.zoom.us/hc/en-us/articles/204619915-Scheduling-a-webinar-with-registration). <br>\n\n**Prerequisites:**<br>\n* The webinar host must be a Licensed user.\n* The webinar should be of type `5`, i.e., it should be a scheduled webinar. Other types of webinars are not supported by this API.<br><br>\n**Scope:** `webinar:write`, `webinar:write:admin`<br>\n**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>\n\n\n\n\n\n\n\n"
},
"response": [
{
"name": "**HTTP Status Code:** `200` **OK** <br>\nRegistrants added.",
"originalRequest": {
"method": "POST",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "auto_approve",
"value": "false",
"description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting that was originally scheduled with approval_type `0` (automatic approval).",
"type": "text"
},
{
"key": "registrants",
"value": "[{\"first_name\":\"dolore est dolore ex\",\"email\":\"QlxiFO3fdQ@rzgNRxcC.ijep\",\"last_name\":\"enim consequat veniam commodo\"},{\"first_name\":\"in ut proident adipisicing\",\"email\":\"Fk39rzyimgL2P@MAuNNuZMsxZfijeyYnVHAVxkQ.ipd\",\"last_name\":\"incididunt esse mollit ullamco est\"}]",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
"host": [
"{{baseUrl}}"
],
"path": [
"webinars",
":webinarId",
"batch_registrants"
],
"variable": [
{
"key": "webinarId",
"value": "quis officia in reprehenderit",
"description": "(Required) Unique identifier of the webinar."
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"registrants\": [\n {\n \"registrant_id\": \"conseret14re\",\n \"email\": \"example@example.com\",\n \"join_url\": \" https://zoom.us/w/9999999?tk=oZuwHfdgAAAAAAAAAAAAAAAA&uuid=WN_XW4_SdxBBBBxLDQt\"\n },\n {\n \"registrant_id\": \"fdgsfh2ey82fuh\",\n \"email\": \"example-2@example.com\",\n \"join_url\": \" https://zoom.us/w/9999999?tk=oZu52542356AAAAAA&uuid=WN_XW4_SdxBBBBxLDQt\"\n },\n {\n \"registrant_id\": \"hdsfhjf3iwh\",\n \"email\": \"example-3@example.com\",\n \"join_url\": \" https://zoom.us/w/9999999?tk=ozghdfdsghf36AAA&uuid=WN_XW4_SdxBBBBxLDQt\"\n }\n ]\n}"
},
{
"name": "**HTTP Status Code:** `400` **Bad Request** <br>\n**Error Code:** `200`<br> Webinar plan is missing. You must subscribe to the webinar plan and enable webinar for this user: {0} in order to perform this action.<br><br>\n**Error Code:** `300`<br> \nThis API c",
"originalRequest": {
"method": "POST",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "auto_approve",
"value": "false",
"description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting that was originally scheduled with approval_type `0` (automatic approval).",
"type": "text"
},
{
"key": "registrants",
"value": "[{\"first_name\":\"dolore est dolore ex\",\"email\":\"QlxiFO3fdQ@rzgNRxcC.ijep\",\"last_name\":\"enim consequat veniam commodo\"},{\"first_name\":\"in ut proident adipisicing\",\"email\":\"Fk39rzyimgL2P@MAuNNuZMsxZfijeyYnVHAVxkQ.ipd\",\"last_name\":\"incididunt esse mollit ullamco est\"}]",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
"host": [
"{{baseUrl}}"
],
"path": [
"webinars",
":webinarId",
"batch_registrants"
],
"variable": [
{
"key": "webinarId",
"value": "quis officia in reprehenderit",
"description": "(Required) Unique identifier of the webinar."
}
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "**HTTP Status Code:** `404` **Not Found** <br>\n**Error Code:** `3001`<br>\nWebinar does not exist: {0}.<br><br>\n**Error Code:** `3043`<br>\nWebinar has reached maximum attendee capacity.<br><br>\n**Error Code:** `404`<br>\nRegistration has not been enabled fo",
"originalRequest": {
"method": "POST",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "auto_approve",
"value": "false",
"description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting that was originally scheduled with approval_type `0` (automatic approval).",
"type": "text"
},
{
"key": "registrants",
"value": "[{\"first_name\":\"dolore est dolore ex\",\"email\":\"QlxiFO3fdQ@rzgNRxcC.ijep\",\"last_name\":\"enim consequat veniam commodo\"},{\"first_name\":\"in ut proident adipisicing\",\"email\":\"Fk39rzyimgL2P@MAuNNuZMsxZfijeyYnVHAVxkQ.ipd\",\"last_name\":\"incididunt esse mollit ullamco est\"}]",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
"host": [
"{{baseUrl}}"
],
"path": [
"webinars",
":webinarId",
"batch_registrants"
],
"variable": [
{
"key": "webinarId",
"value": "quis officia in reprehenderit",
"description": "(Required) Unique identifier of the webinar."
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "**HTTP Status Code:** `429` <br> You have exceeded the daily rate limit of \"{0}\" for webinar **Perform batch registration** API requests for the registrant \"{1}\". You can resume these API requests at GMT 00:00:00.",
"originalRequest": {
"method": "POST",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "auto_approve",
"value": "false",
"description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting that was originally scheduled with approval_type `0` (automatic approval).",
"type": "text"
},
{
"key": "registrants",
"value": "[{\"first_name\":\"dolore est dolore ex\",\"email\":\"QlxiFO3fdQ@rzgNRxcC.ijep\",\"last_name\":\"enim consequat veniam commodo\"},{\"first_name\":\"in ut proident adipisicing\",\"email\":\"Fk39rzyimgL2P@MAuNNuZMsxZfijeyYnVHAVxkQ.ipd\",\"last_name\":\"incididunt esse mollit ullamco est\"}]",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
"host": [
"{{baseUrl}}"
],
"path": [
"webinars",
":webinarId",
"batch_registrants"
],
"variable": [
{
"key": "webinarId",
"value": "quis officia in reprehenderit",
"description": "(Required) Unique identifier of the webinar."
}
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}