Chilkat Online Tools

unicodeC / Zoom API / List meeting participants

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>
#include <C_CkStringBuilderW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkJsonObjectW queryParams;
    HCkHttpResponseW resp;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    const wchar_t *id;
    const wchar_t *user_id;
    const wchar_t *user_name;
    const wchar_t *device;
    const wchar_t *ip_address;
    const wchar_t *location;
    const wchar_t *network_type;
    const wchar_t *microphone;
    const wchar_t *camera;
    const wchar_t *speaker;
    const wchar_t *data_center;
    const wchar_t *full_data_center;
    const wchar_t *connection_type;
    const wchar_t *join_time;
    const wchar_t *leave_time;
    BOOL share_application;
    BOOL share_desktop;
    BOOL share_whiteboard;
    BOOL recording;
    const wchar_t *status;
    const wchar_t *pc_name;
    const wchar_t *domain;
    const wchar_t *mac_addr;
    const wchar_t *harddisk_id;
    const wchar_t *version;
    const wchar_t *leave_reason;
    const wchar_t *role;
    const wchar_t *sip_uri;
    const wchar_t *from_sip_uri;
    int page_count;
    int page_size;
    int total_records;
    const wchar_t *next_page_token;
    int i;
    int count_i;

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

    http = CkHttpW_Create();

    queryParams = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateString(queryParams,L"type",L"live");
    CkJsonObjectW_UpdateInt(queryParams,L"page_size",30);
    CkJsonObjectW_UpdateString(queryParams,L"next_page_token",L"quis officia in reprehenderit");
    CkJsonObjectW_UpdateString(queryParams,L"include_fields",L"registrant_id");

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

    resp = CkHttpW_QuickRequestParams(http,L"GET",L"https://api.zoom.us/v2/metrics/meetings/:meetingId/participants",queryParams);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(queryParams);
        return;
    }

    sbResponseBody = CkStringBuilderW_Create();
    CkHttpResponseW_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",CkJsonObjectW_emit(jResp));

    respStatusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpResponseW_header(resp));
        wprintf(L"Failed.\n");
        CkHttpResponseW_Dispose(resp);
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(queryParams);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    CkHttpResponseW_Dispose(resp);

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

    // {
    //   "page_count": 1,
    //   "page_size": 30,
    //   "total_records": 2,
    //   "next_page_token": "",
    //   "participants": [
    //     {
    //       "id": "d52f19c548b88490b5d16fcbd38",
    //       "user_id": "32dsfsd4g5gd",
    //       "user_name": "dojo",
    //       "device": "WIN",
    //       "ip_address": "127.0.0.1",
    //       "location": "New York",
    //       "network_type": "Wired",
    //       "microphone": "Plantronics BT600",
    //       "camera": "FaceTime HD Camera",
    //       "speaker": "Plantronics BT600",
    //       "data_center": "SC",
    //       "full_data_center": "United States;United States (US03_SC CRC)",
    //       "connection_type": "P2P",
    //       "join_time": "2019-09-07T13:15:02.837Z",
    //       "leave_time": "2019-09-07T13:15:09.837Z",
    //       "share_application": false,
    //       "share_desktop": true,
    //       "share_whiteboard": true,
    //       "recording": false,
    //       "status": "in_waiting_room",
    //       "pc_name": "dojo's pc",
    //       "domain": "Dojo-workspace",
    //       "mac_addr": " 00:0a:95:9d:68:16",
    //       "harddisk_id": "sed proident in",
    //       "version": "4.4.55383.0716",
    //       "leave_reason": "Dojo left the meeting.<br>Reason: Host ended the meeting.",
    //       "role": "host"
    //     },
    //     {
    //       "id": "z8aaaaaaCfp8uQ",
    //       "user_id": "1670000000",
    //       "user_name": "Rea",
    //       "device": "Android",
    //       "ip_address": "120.000.000",
    //       "location": "San Jose (US)",
    //       "network_type": "Wifi",
    //       "data_center": "SC",
    //       "full_data_center": "United States;United States (US03_SC CRC)",
    //       "connection_type": "UDP",
    //       "join_time": "2019-08-02T15:31:48Z",
    //       "leave_time": "2019-08-02T16:04:12Z",
    //       "share_application": false,
    //       "share_desktop": false,
    //       "share_whiteboard": false,
    //       "recording": false,
    //       "pc_name": "Rea's PC",
    //       "domain": "Rea-workspace",
    //       "mac_addr": "",
    //       "harddisk_id": "",
    //       "version": "4.4.55383.0716",
    //       "leave_reason": "Rea left the meeting.<br>Reason: Host closed the meeting.",
    //       "sip_uri": "sip:sipp@10.100.112.140:11029",
    //       "from_sip_uri": "sip:sipp@10.100.112.140:11029",
    //       "role": "host"
    //     }
    //   ]
    // }

    // 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.

    page_count = CkJsonObjectW_IntOf(jResp,L"page_count");
    page_size = CkJsonObjectW_IntOf(jResp,L"page_size");
    total_records = CkJsonObjectW_IntOf(jResp,L"total_records");
    next_page_token = CkJsonObjectW_stringOf(jResp,L"next_page_token");
    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"participants");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        id = CkJsonObjectW_stringOf(jResp,L"participants[i].id");
        user_id = CkJsonObjectW_stringOf(jResp,L"participants[i].user_id");
        user_name = CkJsonObjectW_stringOf(jResp,L"participants[i].user_name");
        device = CkJsonObjectW_stringOf(jResp,L"participants[i].device");
        ip_address = CkJsonObjectW_stringOf(jResp,L"participants[i].ip_address");
        location = CkJsonObjectW_stringOf(jResp,L"participants[i].location");
        network_type = CkJsonObjectW_stringOf(jResp,L"participants[i].network_type");
        microphone = CkJsonObjectW_stringOf(jResp,L"participants[i].microphone");
        camera = CkJsonObjectW_stringOf(jResp,L"participants[i].camera");
        speaker = CkJsonObjectW_stringOf(jResp,L"participants[i].speaker");
        data_center = CkJsonObjectW_stringOf(jResp,L"participants[i].data_center");
        full_data_center = CkJsonObjectW_stringOf(jResp,L"participants[i].full_data_center");
        connection_type = CkJsonObjectW_stringOf(jResp,L"participants[i].connection_type");
        join_time = CkJsonObjectW_stringOf(jResp,L"participants[i].join_time");
        leave_time = CkJsonObjectW_stringOf(jResp,L"participants[i].leave_time");
        share_application = CkJsonObjectW_BoolOf(jResp,L"participants[i].share_application");
        share_desktop = CkJsonObjectW_BoolOf(jResp,L"participants[i].share_desktop");
        share_whiteboard = CkJsonObjectW_BoolOf(jResp,L"participants[i].share_whiteboard");
        recording = CkJsonObjectW_BoolOf(jResp,L"participants[i].recording");
        status = CkJsonObjectW_stringOf(jResp,L"participants[i].status");
        pc_name = CkJsonObjectW_stringOf(jResp,L"participants[i].pc_name");
        domain = CkJsonObjectW_stringOf(jResp,L"participants[i].domain");
        mac_addr = CkJsonObjectW_stringOf(jResp,L"participants[i].mac_addr");
        harddisk_id = CkJsonObjectW_stringOf(jResp,L"participants[i].harddisk_id");
        version = CkJsonObjectW_stringOf(jResp,L"participants[i].version");
        leave_reason = CkJsonObjectW_stringOf(jResp,L"participants[i].leave_reason");
        role = CkJsonObjectW_stringOf(jResp,L"participants[i].role");
        sip_uri = CkJsonObjectW_stringOf(jResp,L"participants[i].sip_uri");
        from_sip_uri = CkJsonObjectW_stringOf(jResp,L"participants[i].from_sip_uri");
        i = i + 1;
    }



    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(queryParams);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -G -d "type=live"
	-d "page_size=30"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-d "include_fields=registrant_id"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/metrics/meetings/:meetingId/participants

Postman Collection Item JSON

{
  "name": "List meeting participants",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants?type=live&page_size=30&next_page_token=quis officia in reprehenderit&include_fields=registrant_id",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "metrics",
        "meetings",
        ":meetingId",
        "participants"
      ],
      "query": [
        {
          "key": "type",
          "value": "live",
          "description": "The type of meeting to query: \n* `past` — All past meetings. \n* `pastOne` — All past one-user meetings. \n* `live` - All live meetings. \n\nThis value defaults to `live`."
        },
        {
          "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."
        },
        {
          "key": "include_fields",
          "value": "registrant_id",
          "description": "Provide `registrant_id` as the value for this field if you would like to see the registrant ID attribute in the response of this API call. A registrant ID is a unique identifier of a [meeting registrant](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants). This is not supported for `live` meeting types."
        }
      ],
      "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."
        }
      ]
    },
    "description": "Use this API to return a list of participants from live or past meetings. \n\n If you do not provide the `type` query parameter, the default value will be set to the `live` value. This API will only return metrics for participants in a live meeting, if any exist. You can specify a monthly date range for the dashboard data using the `from` and `to` query parameters. The month should fall within the last six months. \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` \n\n**Prerequisites:** \n* A Business or higher plan."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nMeeting 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/meetings/:meetingId/participants?type=live&page_size=30&next_page_token=quis officia in reprehenderit&include_fields=registrant_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "meetings",
            ":meetingId",
            "participants"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "include_fields",
              "value": "registrant_id"
            }
          ],
          "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."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"page_count\": 1,\n \"page_size\": 30,\n \"total_records\": 2,\n \"next_page_token\": \"\",\n \"participants\": [\n  {\n   \"id\": \"d52f19c548b88490b5d16fcbd38\",\n   \"user_id\": \"32dsfsd4g5gd\",\n   \"user_name\": \"dojo\",\n   \"device\": \"WIN\",\n   \"ip_address\": \"127.0.0.1\",\n   \"location\": \"New York\",\n   \"network_type\": \"Wired\",\n   \"microphone\": \"Plantronics BT600\",\n   \"camera\": \"FaceTime HD Camera\",\n   \"speaker\": \"Plantronics BT600\",\n   \"data_center\": \"SC\",\n   \"full_data_center\": \"United States;United States (US03_SC CRC)\",\n   \"connection_type\": \"P2P\",\n   \"join_time\": \"2019-09-07T13:15:02.837Z\",\n   \"leave_time\": \"2019-09-07T13:15:09.837Z\",\n   \"share_application\": false,\n   \"share_desktop\": true,\n   \"share_whiteboard\": true,\n   \"recording\": false,\n   \"status\": \"in_waiting_room\",\n   \"pc_name\": \"dojo's pc\",\n   \"domain\": \"Dojo-workspace\",\n   \"mac_addr\": \" 00:0a:95:9d:68:16\",\n   \"harddisk_id\": \"sed proident in\",\n   \"version\": \"4.4.55383.0716\",\n   \"leave_reason\": \"Dojo left the meeting.<br>Reason: Host ended the meeting.\",\n   \"role\": \"host\"\n  },\n  {\n   \"id\": \"z8aaaaaaCfp8uQ\",\n   \"user_id\": \"1670000000\",\n   \"user_name\": \"Rea\",\n   \"device\": \"Android\",\n   \"ip_address\": \"120.000.000\",\n   \"location\": \"San Jose (US)\",\n   \"network_type\": \"Wifi\",\n   \"data_center\": \"SC\",\n   \"full_data_center\": \"United States;United States (US03_SC CRC)\",\n   \"connection_type\": \"UDP\",\n   \"join_time\": \"2019-08-02T15:31:48Z\",\n   \"leave_time\": \"2019-08-02T16:04:12Z\",\n   \"share_application\": false,\n   \"share_desktop\": false,\n   \"share_whiteboard\": false,\n   \"recording\": false,\n   \"pc_name\": \"Rea's PC\",\n   \"domain\": \"Rea-workspace\",\n   \"mac_addr\": \"\",\n   \"harddisk_id\": \"\",\n   \"version\": \"4.4.55383.0716\",\n   \"leave_reason\": \"Rea left the meeting.<br>Reason: Host closed the meeting.\",\n   \"sip_uri\": \"sip:sipp@10.100.112.140:11029\",\n   \"from_sip_uri\": \"sip:sipp@10.100.112.140:11029\",\n   \"role\": \"host\"\n  }\n ]\n}"
    },
    {
      "name": "**Error Code:** `300`<br>\nCan not access webinar info.<br>\n{meetingId} or the next page token is either invalid or expired.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants?type=live&page_size=30&next_page_token=quis officia in reprehenderit&include_fields=registrant_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "meetings",
            ":meetingId",
            "participants"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "include_fields",
              "value": "registrant_id"
            }
          ],
          "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."
            }
          ]
        }
      },
      "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>\nMeeting ID is invalid or has not ended.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/meetings/:meetingId/participants?type=live&page_size=30&next_page_token=quis officia in reprehenderit&include_fields=registrant_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "meetings",
            ":meetingId",
            "participants"
          ],
          "query": [
            {
              "key": "type",
              "value": "live"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "include_fields",
              "value": "registrant_id"
            }
          ],
          "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."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}