PowerBuilder / Zoom API / List webinars
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Uuid
string ls_Id
string ls_Topic
string ls_Host
string ls_Email
string ls_User_type
string ls_Start_time
string ls_End_time
string ls_Duration
string ls_Participants
string ls_Has_pstn
string ls_Has_voip
string ls_Has_3rd_party_audio
string ls_Has_video
string ls_Has_screen_share
string ls_Has_recording
string ls_Has_sip
string ls_Has_archiving
string ls_From
string ls_V_to
string ls_Page_count
string ls_Page_size
string ls_Total_records
string ls_Next_page_token
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_QueryParams = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat.JsonObject")
loo_QueryParams.UpdateString("type","live")
loo_QueryParams.UpdateString("from","1989-05-07")
loo_QueryParams.UpdateString("to","1989-05-07")
loo_QueryParams.UpdateInt("page_size",30)
loo_QueryParams.UpdateString("next_page_token","quis officia in reprehenderit")
// Adds the "Authorization: Bearer <access_token>" header.
loo_Http.AuthToken = "<access_token>"
loo_Resp = loo_Http.QuickRequestParams("GET","https://api.zoom.us/v2/metrics/webinars",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_QueryParams
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_QueryParams
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)
// {
// "from": "string [date]",
// "to": "string [date]",
// "page_count": "integer",
// "page_size": "integer",
// "total_records": "integer",
// "next_page_token": "string",
// "webinars": [
// {
// "uuid": "string [uuid]",
// "id": "integer",
// "topic": "string",
// "host": "string",
// "email": "string",
// "user_type": "string",
// "start_time": "string [date-time]",
// "end_time": "string [date-time]",
// "duration": "string",
// "participants": "integer",
// "has_pstn": "boolean",
// "has_voip": "boolean",
// "has_3rd_party_audio": "boolean",
// "has_video": "boolean",
// "has_screen_share": "boolean",
// "has_recording": "boolean",
// "has_sip": "boolean",
// "has_archiving": "boolean"
// }
// ]
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
ls_From = loo_JResp.StringOf("from")
ls_V_to = loo_JResp.StringOf("to")
ls_Page_count = loo_JResp.StringOf("page_count")
ls_Page_size = loo_JResp.StringOf("page_size")
ls_Total_records = loo_JResp.StringOf("total_records")
ls_Next_page_token = loo_JResp.StringOf("next_page_token")
i = 0
li_Count_i = loo_JResp.SizeOfArray("webinars")
do while i < li_Count_i
loo_JResp.I = i
ls_Uuid = loo_JResp.StringOf("webinars[i].uuid")
ls_Id = loo_JResp.StringOf("webinars[i].id")
ls_Topic = loo_JResp.StringOf("webinars[i].topic")
ls_Host = loo_JResp.StringOf("webinars[i].host")
ls_Email = loo_JResp.StringOf("webinars[i].email")
ls_User_type = loo_JResp.StringOf("webinars[i].user_type")
ls_Start_time = loo_JResp.StringOf("webinars[i].start_time")
ls_End_time = loo_JResp.StringOf("webinars[i].end_time")
ls_Duration = loo_JResp.StringOf("webinars[i].duration")
ls_Participants = loo_JResp.StringOf("webinars[i].participants")
ls_Has_pstn = loo_JResp.StringOf("webinars[i].has_pstn")
ls_Has_voip = loo_JResp.StringOf("webinars[i].has_voip")
ls_Has_3rd_party_audio = loo_JResp.StringOf("webinars[i].has_3rd_party_audio")
ls_Has_video = loo_JResp.StringOf("webinars[i].has_video")
ls_Has_screen_share = loo_JResp.StringOf("webinars[i].has_screen_share")
ls_Has_recording = loo_JResp.StringOf("webinars[i].has_recording")
ls_Has_sip = loo_JResp.StringOf("webinars[i].has_sip")
ls_Has_archiving = loo_JResp.StringOf("webinars[i].has_archiving")
i = i + 1
loop
destroy loo_Http
destroy loo_QueryParams
destroy loo_SbResponseBody
destroy loo_JResp
Curl Command
curl -G -d "type=live"
-d "from=1989-05-07"
-d "to=1989-05-07"
-d "page_size=30"
-d "next_page_token=quis%20officia%20in%20reprehenderit"
-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/metrics/webinars
Postman Collection Item JSON
{
"name": "List webinars",
"request": {
"auth": {
"type": "oauth2"
},
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/metrics/webinars?type=live&from=1989-05-07&to=1989-05-07&page_size=30&next_page_token=quis officia in reprehenderit",
"host": [
"{{baseUrl}}"
],
"path": [
"metrics",
"webinars"
],
"query": [
{
"key": "type",
"value": "live",
"description": "The type of webinar to query: \n* `past` — All past webinars. \n* `live` - All live webinars. \n\nThis value defaults to `live`."
},
{
"key": "from",
"value": "1989-05-07",
"description": "(Required) Start date in 'yyyy-mm-dd' format. The date range defined by the \"from\" and \"to\" parameters should only be one month as the report includes only one month worth of data at once."
},
{
"key": "to",
"value": "1989-05-07",
"description": "(Required) End date."
},
{
"key": "page_size",
"value": "30",
"description": "The number of records returned within a single API call."
},
{
"key": "next_page_token",
"value": "quis officia in reprehenderit",
"description": "The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes."
}
]
},
"description": "List all the live or past webinars from a specified period of time. <br><br>\n**Scopes:** `dashboard_webinars:read:admin`<br>\n**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Resource-intensive`<br>\n**Prerequisites:**<br>\n* Business, Education or API Plan with Webinar add-on.\n\n\n"
},
"response": [
{
"name": "**HTTP Status Code:** `200`<br>\nMeetings returned.<br>\nOnly available for paid accounts that have enabled the Dashboard feature.",
"originalRequest": {
"method": "GET",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"url": {
"raw": "{{baseUrl}}/metrics/webinars?type=live&from=1989-05-07&to=1989-05-07&page_size=30&next_page_token=quis officia in reprehenderit",
"host": [
"{{baseUrl}}"
],
"path": [
"metrics",
"webinars"
],
"query": [
{
"key": "type",
"value": "live"
},
{
"key": "from",
"value": "1989-05-07"
},
{
"key": "to",
"value": "1989-05-07"
},
{
"key": "page_size",
"value": "30"
},
{
"key": "next_page_token",
"value": "quis officia in reprehenderit"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"from\": \"string [date]\",\n \"to\": \"string [date]\",\n \"page_count\": \"integer\",\n \"page_size\": \"integer\",\n \"total_records\": \"integer\",\n \"next_page_token\": \"string\",\n \"webinars\": [\n {\n \"uuid\": \"string [uuid]\",\n \"id\": \"integer\",\n \"topic\": \"string\",\n \"host\": \"string\",\n \"email\": \"string\",\n \"user_type\": \"string\",\n \"start_time\": \"string [date-time]\",\n \"end_time\": \"string [date-time]\",\n \"duration\": \"string\",\n \"participants\": \"integer\",\n \"has_pstn\": \"boolean\",\n \"has_voip\": \"boolean\",\n \"has_3rd_party_audio\": \"boolean\",\n \"has_video\": \"boolean\",\n \"has_screen_share\": \"boolean\",\n \"has_recording\": \"boolean\",\n \"has_sip\": \"boolean\",\n \"has_archiving\": \"boolean\"\n }\n ]\n}"
},
{
"name": "**Error Code:** `200`<br>\nThe next page token is invalid or has expired.",
"originalRequest": {
"method": "GET",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"url": {
"raw": "{{baseUrl}}/metrics/webinars?type=live&from=1989-05-07&to=1989-05-07&page_size=30&next_page_token=quis officia in reprehenderit",
"host": [
"{{baseUrl}}"
],
"path": [
"metrics",
"webinars"
],
"query": [
{
"key": "type",
"value": "live"
},
{
"key": "from",
"value": "1989-05-07"
},
{
"key": "to",
"value": "1989-05-07"
},
{
"key": "page_size",
"value": "30"
},
{
"key": "next_page_token",
"value": "quis officia in reprehenderit"
}
]
}
},
"status": "Multiple Choices",
"code": 300,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}