Chilkat Online Tools

TCL / Zoom API / List webinar participant QoS

Back to Collection Items

load ./chilkat.dll

# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

set http [new_CkHttp]

set queryParams [new_CkJsonObject]

CkJsonObject_UpdateString $queryParams "type" "live"
CkJsonObject_UpdateInt $queryParams "page_size" 1
CkJsonObject_UpdateString $queryParams "next_page_token" "quis officia in reprehenderit"

# Adds the "Authorization: Bearer <access_token>" header.
CkHttp_put_AuthToken $http "<access_token>"

# resp is a CkHttpResponse
set resp [CkHttp_QuickRequestParams $http "GET" "https://api.zoom.us/v2/metrics/webinars/:webinarId/participants/qos" $queryParams]
if {[CkHttp_get_LastMethodSuccess $http] == 0} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttp $http
    delete_CkJsonObject $queryParams
    exit
}

set sbResponseBody [new_CkStringBuilder]

CkHttpResponse_GetBodySb $resp $sbResponseBody

set jResp [new_CkJsonObject]

CkJsonObject_LoadSb $jResp $sbResponseBody
CkJsonObject_put_EmitCompact $jResp 0

puts "Response Body:"
puts [CkJsonObject_emit $jResp]

set respStatusCode [CkHttpResponse_get_StatusCode $resp]
puts "Response Status Code = $respStatusCode"
if {$respStatusCode >= 400} then {
    puts "Response Header:"
    puts [CkHttpResponse_header $resp]
    puts "Failed."
    delete_CkHttpResponse $resp

    delete_CkHttp $http
    delete_CkJsonObject $queryParams
    delete_CkStringBuilder $sbResponseBody
    delete_CkJsonObject $jResp
    exit
}

delete_CkHttpResponse $resp

# Sample JSON response:
# (Sample code for parsing the JSON response is shown below)

# {
#   "page_count": "integer [int64]",
#   "page_size": "integer",
#   "total_records": "integer [int64]",
#   "next_page_token": "string",
#   "participants": [
#     {
#       "user_id": "1670000000",
#       "user_name": "User",
#       "device": "Android",
#       "ip_address": "192.0.2.0",
#       "location": "San Jose (US)",
#       "join_time": "2021-06-24T20:00:00Z",
#       "leave_time": "2021-06-24T20:00:00Z",
#       "pc_name": "User's Phone",
#       "domain": "user-android",
#       "mac_addr": "",
#       "harddisk_id": "",
#       "version": "4.4.55383.0726",
#       "user_qos": [
#         {
#           "date_time": "2021-06-24T20:00:00Z",
#           "audio_input": {
#             "bitrate": "23 kbps",
#             "latency": "126 ms",
#             "jitter": "6 ms",
#             "avg_loss": "0.3%",
#             "max_loss": "1.9%"
#           },
#           "audio_output": {
#             "bitrate": "63 kbps",
#             "latency": "134 ms",
#             "jitter": "6 ms",
#             "avg_loss": "0.0%",
#             "max_loss": "0.0%"
#           },
#           "video_input": {
#             "bitrate": "1055 kbps",
#             "latency": "129 ms",
#             "jitter": "11 ms",
#             "avg_loss": "0.0%",
#             "max_loss": "4.9%",
#             "resolution": "1280*720",
#             "frame_rate": "12 fps"
#           },
#           "video_output": {
#             "bitrate": "673 kbps",
#             "latency": "135 ms",
#             "jitter": "11 ms",
#             "avg_loss": "0.0%",
#             "max_loss": "0.0%",
#             "resolution": "640*360",
#             "frame_rate": "22 fps"
#           },
#           "as_input": {
#             "bitrate": "70 kbps",
#             "latency": "135 ms",
#             "jitter": "8 ms",
#             "avg_loss": "0.0%",
#             "max_loss": "0.0%",
#             "resolution": "0*0",
#             "frame_rate": ""
#           },
#           "as_output": {
#             "bitrate": "70 kbps",
#             "latency": "135 ms",
#             "jitter": "8 ms",
#             "avg_loss": "0.0%",
#             "max_loss": "0.0%",
#             "resolution": "0*0",
#             "frame_rate": ""
#           },
#           "cpu_usage": {
#             "zoom_min_cpu_usage": "8%",
#             "zoom_avg_cpu_usage": "12%",
#             "zoom_max_cpu_usage": "18%",
#             "system_max_cpu_usage": "40%"
#           }
#         }
#       ]
#     }
#   ]
# }

# Sample code for parsing the JSON response...
# Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

set date_time [new_CkDtObj]

set page_count [CkJsonObject_stringOf $jResp "page_count"]
set page_size [CkJsonObject_stringOf $jResp "page_size"]
set total_records [CkJsonObject_stringOf $jResp "total_records"]
set next_page_token [CkJsonObject_stringOf $jResp "next_page_token"]
set i 0
set count_i [CkJsonObject_SizeOfArray $jResp "participants"]
while {$i < $count_i} {
    CkJsonObject_put_I $jResp $i
    set user_id [CkJsonObject_stringOf $jResp "participants[i].user_id"]
    set user_name [CkJsonObject_stringOf $jResp "participants[i].user_name"]
    set device [CkJsonObject_stringOf $jResp "participants[i].device"]
    set ip_address [CkJsonObject_stringOf $jResp "participants[i].ip_address"]
    set location [CkJsonObject_stringOf $jResp "participants[i].location"]
    set join_time [CkJsonObject_stringOf $jResp "participants[i].join_time"]
    set leave_time [CkJsonObject_stringOf $jResp "participants[i].leave_time"]
    set pc_name [CkJsonObject_stringOf $jResp "participants[i].pc_name"]
    set domain [CkJsonObject_stringOf $jResp "participants[i].domain"]
    set mac_addr [CkJsonObject_stringOf $jResp "participants[i].mac_addr"]
    set harddisk_id [CkJsonObject_stringOf $jResp "participants[i].harddisk_id"]
    set version [CkJsonObject_stringOf $jResp "participants[i].version"]
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "participants[i].user_qos"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        CkJsonObject_DtOf $jResp "participants[i].user_qos[j].date_time" 0 $date_time
        set Bitrate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_input.bitrate"]
        set Latency [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_input.latency"]
        set Jitter [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_input.jitter"]
        set Avg_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_input.avg_loss"]
        set Max_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_input.max_loss"]
        set audio_outputBitrate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_output.bitrate"]
        set audio_outputLatency [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_output.latency"]
        set audio_outputJitter [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_output.jitter"]
        set audio_outputAvg_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_output.avg_loss"]
        set audio_outputMax_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].audio_output.max_loss"]
        set video_inputBitrate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_input.bitrate"]
        set video_inputLatency [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_input.latency"]
        set video_inputJitter [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_input.jitter"]
        set video_inputAvg_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_input.avg_loss"]
        set video_inputMax_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_input.max_loss"]
        set Resolution [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_input.resolution"]
        set Frame_rate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_input.frame_rate"]
        set video_outputBitrate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_output.bitrate"]
        set video_outputLatency [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_output.latency"]
        set video_outputJitter [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_output.jitter"]
        set video_outputAvg_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_output.avg_loss"]
        set video_outputMax_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_output.max_loss"]
        set video_outputResolution [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_output.resolution"]
        set video_outputFrame_rate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].video_output.frame_rate"]
        set as_inputBitrate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_input.bitrate"]
        set as_inputLatency [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_input.latency"]
        set as_inputJitter [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_input.jitter"]
        set as_inputAvg_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_input.avg_loss"]
        set as_inputMax_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_input.max_loss"]
        set as_inputResolution [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_input.resolution"]
        set as_inputFrame_rate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_input.frame_rate"]
        set as_outputBitrate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_output.bitrate"]
        set as_outputLatency [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_output.latency"]
        set as_outputJitter [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_output.jitter"]
        set as_outputAvg_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_output.avg_loss"]
        set as_outputMax_loss [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_output.max_loss"]
        set as_outputResolution [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_output.resolution"]
        set as_outputFrame_rate [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].as_output.frame_rate"]
        set Zoom_min_cpu_usage [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].cpu_usage.zoom_min_cpu_usage"]
        set Zoom_avg_cpu_usage [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].cpu_usage.zoom_avg_cpu_usage"]
        set Zoom_max_cpu_usage [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].cpu_usage.zoom_max_cpu_usage"]
        set System_max_cpu_usage [CkJsonObject_stringOf $jResp "participants[i].user_qos[j].cpu_usage.system_max_cpu_usage"]
        set j [expr $j + 1]
    }
    set i [expr $i + 1]
}

delete_CkHttp $http
delete_CkJsonObject $queryParams
delete_CkStringBuilder $sbResponseBody
delete_CkJsonObject $jResp
delete_CkDtObj $date_time

Curl Command

curl -G -d "type=live"
	-d "page_size=1"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/metrics/webinars/:webinarId/participants/qos

Postman Collection Item JSON

{
  "name": "List webinar participant QoS",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/metrics/webinars/:webinarId/participants/qos?type=live&page_size=1&next_page_token=quis officia in reprehenderit",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "metrics",
        "webinars",
        ":webinarId",
        "participants",
        "qos"
      ],
      "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": "page_size",
          "value": "1",
          "description": "The number of items returned per page."
        },
        {
          "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."
        }
      ],
      "variable": [
        {
          "key": "webinarId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The webinar's ID or universally unique ID (UUID). \n* If you provide a webinar ID, the API will return a response for the latest webinar instance. \n* If you provide a webinar UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the webinar UUID before making an API request."
        }
      ]
    },
    "description": "Use this API to return a list of webinar participants from live or past webinars and the quality of service they received during the webinar. The data returned indicates the connection quality for sending/receiving video, audio, and shared content. \n\n**Note:** \n\nThis API may return empty values for participants' `user_name`, `ip_address`, `location`, and `email` responses when the account calling this API: \n* Does **not** have a signed HIPAA business associate agreement (BAA). \n* Is a [**legacy** HIPAA BAA account](https://marketplace.zoom.us/docs/api-reference/other-references/legacy-business-associate-agreements). \n\n**Scopes:** `dashboard_webinars:read:admin` <br> **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy` \n\n**Prerequisites:** \n* A Business, Education, or API Plan with Webinar add-on."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nWebinar participants 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/:webinarId/participants/qos?type=live&page_size=1&next_page_token=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "webinars",
            ":webinarId",
            "participants",
            "qos"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            },
            {
              "key": "page_size",
              "value": "1"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID). \n* If you provide a webinar ID, the API will return a response for the latest webinar instance. \n* If you provide a webinar UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the webinar UUID before making an API request."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"page_count\": \"integer [int64]\",\n \"page_size\": \"integer\",\n \"total_records\": \"integer [int64]\",\n \"next_page_token\": \"string\",\n \"participants\": [\n  {\n   \"user_id\": \"1670000000\",\n   \"user_name\": \"User\",\n   \"device\": \"Android\",\n   \"ip_address\": \"192.0.2.0\",\n   \"location\": \"San Jose (US)\",\n   \"join_time\": \"2021-06-24T20:00:00Z\",\n   \"leave_time\": \"2021-06-24T20:00:00Z\",\n   \"pc_name\": \"User's Phone\",\n   \"domain\": \"user-android\",\n   \"mac_addr\": \"\",\n   \"harddisk_id\": \"\",\n   \"version\": \"4.4.55383.0726\",\n   \"user_qos\": [\n    {\n     \"date_time\": \"2021-06-24T20:00:00Z\",\n     \"audio_input\": {\n      \"bitrate\": \"23 kbps\",\n      \"latency\": \"126 ms\",\n      \"jitter\": \"6 ms\",\n      \"avg_loss\": \"0.3%\",\n      \"max_loss\": \"1.9%\"\n     },\n     \"audio_output\": {\n      \"bitrate\": \"63 kbps\",\n      \"latency\": \"134 ms\",\n      \"jitter\": \"6 ms\",\n      \"avg_loss\": \"0.0%\",\n      \"max_loss\": \"0.0%\"\n     },\n     \"video_input\": {\n      \"bitrate\": \"1055 kbps\",\n      \"latency\": \"129 ms\",\n      \"jitter\": \"11 ms\",\n      \"avg_loss\": \"0.0%\",\n      \"max_loss\": \"4.9%\",\n      \"resolution\": \"1280*720\",\n      \"frame_rate\": \"12 fps\"\n     },\n     \"video_output\": {\n      \"bitrate\": \"673 kbps\",\n      \"latency\": \"135 ms\",\n      \"jitter\": \"11 ms\",\n      \"avg_loss\": \"0.0%\",\n      \"max_loss\": \"0.0%\",\n      \"resolution\": \"640*360\",\n      \"frame_rate\": \"22 fps\"\n     },\n     \"as_input\": {\n      \"bitrate\": \"70 kbps\",\n      \"latency\": \"135 ms\",\n      \"jitter\": \"8 ms\",\n      \"avg_loss\": \"0.0%\",\n      \"max_loss\": \"0.0%\",\n      \"resolution\": \"0*0\",\n      \"frame_rate\": \"\"\n     },\n     \"as_output\": {\n      \"bitrate\": \"70 kbps\",\n      \"latency\": \"135 ms\",\n      \"jitter\": \"8 ms\",\n      \"avg_loss\": \"0.0%\",\n      \"max_loss\": \"0.0%\",\n      \"resolution\": \"0*0\",\n      \"frame_rate\": \"\"\n     },\n     \"cpu_usage\": {\n      \"zoom_min_cpu_usage\": \"8%\",\n      \"zoom_avg_cpu_usage\": \"12%\",\n      \"zoom_max_cpu_usage\": \"18%\",\n      \"system_max_cpu_usage\": \"40%\"\n     }\n    }\n   ]\n  }\n ]\n}"
    },
    {
      "name": "**Error Code:** `300`<br>\nCan not access webinar info, {webinarId}.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/webinars/:webinarId/participants/qos?type=live&page_size=1&next_page_token=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "webinars",
            ":webinarId",
            "participants",
            "qos"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            },
            {
              "key": "page_size",
              "value": "1"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID). \n* If you provide a webinar ID, the API will return a response for the latest webinar instance. \n* If you provide a webinar UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the webinar UUID before making an API request."
            }
          ]
        }
      },
      "status": "Multiple Choices",
      "code": 300,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404`<br>\n**Error Code:** `3001`<br>\nThis webinar's detail is not available or the Webinar ID is not valid.<br>\nThis webinar has not ended yet.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/webinars/:webinarId/participants/qos?type=live&page_size=1&next_page_token=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "webinars",
            ":webinarId",
            "participants",
            "qos"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            },
            {
              "key": "page_size",
              "value": "1"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID). \n* If you provide a webinar ID, the API will return a response for the latest webinar instance. \n* If you provide a webinar UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the webinar UUID before making an API request."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}