Chilkat Online Tools

C++ / Zoom API / Get meeting participant QoS

Back to Collection Items

#include <CkHttp.h>
#include <CkJsonObject.h>
#include <CkHttpResponse.h>
#include <CkStringBuilder.h>
#include <CkDtObj.h>

void ChilkatSample(void)
    {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttp http;
    bool success;

    CkJsonObject queryParams;
    queryParams.UpdateString("type","live");

    // Adds the "Authorization: Bearer <access_token>" header.
    http.put_AuthToken("<access_token>");

    CkHttpResponse *resp = http.QuickRequestParams("GET","https://api.zoom.us/v2/metrics/meetings/:meetingId/participants/:participantId/qos",queryParams);
    if (http.get_LastMethodSuccess() == false) {
        std::cout << http.lastErrorText() << "\r\n";
        return;
    }

    CkStringBuilder sbResponseBody;
    resp->GetBodySb(sbResponseBody);

    CkJsonObject jResp;
    jResp.LoadSb(sbResponseBody);
    jResp.put_EmitCompact(false);

    std::cout << "Response Body:" << "\r\n";
    std::cout << jResp.emit() << "\r\n";

    int respStatusCode = resp->get_StatusCode();
    std::cout << "Response Status Code = " << respStatusCode << "\r\n";
    if (respStatusCode >= 400) {
        std::cout << "Response Header:" << "\r\n";
        std::cout << resp->header() << "\r\n";
        std::cout << "Failed." << "\r\n";
        delete resp;
        return;
    }

    delete resp;

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

    // {
    //   "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

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.

    CkDtObj date_time;
    const char *Bitrate = 0;
    const char *Latency = 0;
    const char *Jitter = 0;
    const char *Avg_loss = 0;
    const char *Max_loss = 0;
    const char *audio_outputBitrate = 0;
    const char *audio_outputLatency = 0;
    const char *audio_outputJitter = 0;
    const char *audio_outputAvg_loss = 0;
    const char *audio_outputMax_loss = 0;
    const char *video_inputBitrate = 0;
    const char *video_inputLatency = 0;
    const char *video_inputJitter = 0;
    const char *video_inputAvg_loss = 0;
    const char *video_inputMax_loss = 0;
    const char *Resolution = 0;
    const char *Frame_rate = 0;
    const char *video_outputBitrate = 0;
    const char *video_outputLatency = 0;
    const char *video_outputJitter = 0;
    const char *video_outputAvg_loss = 0;
    const char *video_outputMax_loss = 0;
    const char *video_outputResolution = 0;
    const char *video_outputFrame_rate = 0;
    const char *as_inputBitrate = 0;
    const char *as_inputLatency = 0;
    const char *as_inputJitter = 0;
    const char *as_inputAvg_loss = 0;
    const char *as_inputMax_loss = 0;
    const char *as_inputResolution = 0;
    const char *as_inputFrame_rate = 0;
    const char *as_outputBitrate = 0;
    const char *as_outputLatency = 0;
    const char *as_outputJitter = 0;
    const char *as_outputAvg_loss = 0;
    const char *as_outputMax_loss = 0;
    const char *as_outputResolution = 0;
    const char *as_outputFrame_rate = 0;
    const char *Zoom_min_cpu_usage = 0;
    const char *Zoom_avg_cpu_usage = 0;
    const char *Zoom_max_cpu_usage = 0;
    const char *System_max_cpu_usage = 0;

    const char *user_id = jResp.stringOf("user_id");
    const char *user_name = jResp.stringOf("user_name");
    const char *device = jResp.stringOf("device");
    const char *ip_address = jResp.stringOf("ip_address");
    const char *location = jResp.stringOf("location");
    const char *join_time = jResp.stringOf("join_time");
    const char *leave_time = jResp.stringOf("leave_time");
    const char *pc_name = jResp.stringOf("pc_name");
    const char *domain = jResp.stringOf("domain");
    const char *mac_addr = jResp.stringOf("mac_addr");
    const char *harddisk_id = jResp.stringOf("harddisk_id");
    const char *version = jResp.stringOf("version");
    int i = 0;
    int count_i = jResp.SizeOfArray("user_qos");
    while (i < count_i) {
        jResp.put_I(i);
        jResp.DtOf("user_qos[i].date_time",false,date_time);
        Bitrate = jResp.stringOf("user_qos[i].audio_input.bitrate");
        Latency = jResp.stringOf("user_qos[i].audio_input.latency");
        Jitter = jResp.stringOf("user_qos[i].audio_input.jitter");
        Avg_loss = jResp.stringOf("user_qos[i].audio_input.avg_loss");
        Max_loss = jResp.stringOf("user_qos[i].audio_input.max_loss");
        audio_outputBitrate = jResp.stringOf("user_qos[i].audio_output.bitrate");
        audio_outputLatency = jResp.stringOf("user_qos[i].audio_output.latency");
        audio_outputJitter = jResp.stringOf("user_qos[i].audio_output.jitter");
        audio_outputAvg_loss = jResp.stringOf("user_qos[i].audio_output.avg_loss");
        audio_outputMax_loss = jResp.stringOf("user_qos[i].audio_output.max_loss");
        video_inputBitrate = jResp.stringOf("user_qos[i].video_input.bitrate");
        video_inputLatency = jResp.stringOf("user_qos[i].video_input.latency");
        video_inputJitter = jResp.stringOf("user_qos[i].video_input.jitter");
        video_inputAvg_loss = jResp.stringOf("user_qos[i].video_input.avg_loss");
        video_inputMax_loss = jResp.stringOf("user_qos[i].video_input.max_loss");
        Resolution = jResp.stringOf("user_qos[i].video_input.resolution");
        Frame_rate = jResp.stringOf("user_qos[i].video_input.frame_rate");
        video_outputBitrate = jResp.stringOf("user_qos[i].video_output.bitrate");
        video_outputLatency = jResp.stringOf("user_qos[i].video_output.latency");
        video_outputJitter = jResp.stringOf("user_qos[i].video_output.jitter");
        video_outputAvg_loss = jResp.stringOf("user_qos[i].video_output.avg_loss");
        video_outputMax_loss = jResp.stringOf("user_qos[i].video_output.max_loss");
        video_outputResolution = jResp.stringOf("user_qos[i].video_output.resolution");
        video_outputFrame_rate = jResp.stringOf("user_qos[i].video_output.frame_rate");
        as_inputBitrate = jResp.stringOf("user_qos[i].as_input.bitrate");
        as_inputLatency = jResp.stringOf("user_qos[i].as_input.latency");
        as_inputJitter = jResp.stringOf("user_qos[i].as_input.jitter");
        as_inputAvg_loss = jResp.stringOf("user_qos[i].as_input.avg_loss");
        as_inputMax_loss = jResp.stringOf("user_qos[i].as_input.max_loss");
        as_inputResolution = jResp.stringOf("user_qos[i].as_input.resolution");
        as_inputFrame_rate = jResp.stringOf("user_qos[i].as_input.frame_rate");
        as_outputBitrate = jResp.stringOf("user_qos[i].as_output.bitrate");
        as_outputLatency = jResp.stringOf("user_qos[i].as_output.latency");
        as_outputJitter = jResp.stringOf("user_qos[i].as_output.jitter");
        as_outputAvg_loss = jResp.stringOf("user_qos[i].as_output.avg_loss");
        as_outputMax_loss = jResp.stringOf("user_qos[i].as_output.max_loss");
        as_outputResolution = jResp.stringOf("user_qos[i].as_output.resolution");
        as_outputFrame_rate = jResp.stringOf("user_qos[i].as_output.frame_rate");
        Zoom_min_cpu_usage = jResp.stringOf("user_qos[i].cpu_usage.zoom_min_cpu_usage");
        Zoom_avg_cpu_usage = jResp.stringOf("user_qos[i].cpu_usage.zoom_avg_cpu_usage");
        Zoom_max_cpu_usage = jResp.stringOf("user_qos[i].cpu_usage.zoom_max_cpu_usage");
        System_max_cpu_usage = jResp.stringOf("user_qos[i].cpu_usage.system_max_cpu_usage");
        i = i + 1;
    }
    }

Curl Command

curl -G -d "type=live"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/metrics/meetings/:meetingId/participants/:participantId/qos

Postman Collection Item JSON

{
  "name": "Get meeting participant QoS",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants/:participantId/qos?type=live",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "metrics",
        "meetings",
        ":meetingId",
        "participants",
        ":participantId",
        "qos"
      ],
      "query": [
        {
          "key": "type",
          "value": "live",
          "description": "The type of meeting to query: \n* `past` — All past meetings. \n* `live` - All live meetings. \n\nThis value defaults to `live`."
        }
      ],
      "variable": [
        {
          "key": "meetingId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The meeting's ID or universally unique ID (UUID). \n* If you provide a meeting ID, the API will return a response for the latest meeting instance. \n* If you provide a meeting UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the meeting UUID before making an API request."
        },
        {
          "key": "participantId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The participant's ID."
        }
      ]
    },
    "description": "Use this API to return the quality of service (QoS) report for participants from live or past meetings. The data returned indicates the connection quality for sending/receiving video, audio, and shared content. The API returns this data for either the API request or when the API request was last received. \n\nWhen the sender sends data, a timestamp is attached to the sender’s data packet. The receiver then returns this timestamp to the sender. This helps determine the upstream and downstream latency, which includes the application processing time. The latency data returned is the five second average and five second maximum. \n\n This API will **not** return data if there is no data being sent or received at the time of request. \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_meetings:read:admin` <br> **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nMeeting participant QOS returned.<br>\nOnly available for paid account 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/meetings/:meetingId/participants/:participantId/qos?type=live",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "meetings",
            ":meetingId",
            "participants",
            ":participantId",
            "qos"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            }
          ],
          "variable": [
            {
              "key": "meetingId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The meeting's ID or universally unique ID (UUID). \n* If you provide a meeting ID, the API will return a response for the latest meeting instance. \n* If you provide a meeting UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the meeting UUID before making an API request."
            },
            {
              "key": "participantId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The participant's ID."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\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}"
    },
    {
      "name": "**Error Code:** `300`<br>\nCan not access webinar info, {meetingId}.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants/:participantId/qos?type=live",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "meetings",
            ":meetingId",
            "participants",
            ":participantId",
            "qos"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            }
          ],
          "variable": [
            {
              "key": "meetingId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The meeting's ID or universally unique ID (UUID). \n* If you provide a meeting ID, the API will return a response for the latest meeting instance. \n* If you provide a meeting UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the meeting UUID before making an API request."
            },
            {
              "key": "participantId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The participant's ID."
            }
          ]
        }
      },
      "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 meeting's detail info is not available.<br>\nThis meeting has not ended yet or the Meeting ID is invalid.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants/:participantId/qos?type=live",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "meetings",
            ":meetingId",
            "participants",
            ":participantId",
            "qos"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            }
          ],
          "variable": [
            {
              "key": "meetingId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The meeting's ID or universally unique ID (UUID). \n* If you provide a meeting ID, the API will return a response for the latest meeting instance. \n* If you provide a meeting UUID that begins with a `/` character or contains the `//` characters, you **must** double-encode the meeting UUID before making an API request."
            },
            {
              "key": "participantId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The participant's ID."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}