Chilkat Online Tools

unicodeCpp / Zoom API / List panelists

Back to Collection Items

#include <CkHttpW.h>
#include <CkStringBuilderW.h>
#include <CkJsonObjectW.h>

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

    CkHttpW http;
    bool success;

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

    CkStringBuilderW sbResponseBody;
    success = http.QuickGetSb(L"https://api.zoom.us/v2/webinars/:webinarId/panelists",sbResponseBody);
    if (success == false) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

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

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

    int respStatusCode = http.get_LastStatus();
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",http.lastHeader());
        wprintf(L"Failed.\n");
        return;
    }

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

    // {
    //   "total_records": "2",
    //   "panelists": [
    //     {
    //       "name": "Mary",
    //       "email": "example@example.com"
    //     },
    //     {
    //       "name": "Mike",
    //       "email": "example-2@example.com"
    //     }
    //   ]
    // }

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

    const wchar_t *name = 0;
    const wchar_t *email = 0;

    const wchar_t *total_records = jResp.stringOf(L"total_records");
    int i = 0;
    int count_i = jResp.SizeOfArray(L"panelists");
    while (i < count_i) {
        jResp.put_I(i);
        name = jResp.stringOf(L"panelists[i].name");
        email = jResp.stringOf(L"panelists[i].email");
        i = i + 1;
    }
    }

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/webinars/:webinarId/panelists

Postman Collection Item JSON

{
  "name": "List panelists",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/webinars/:webinarId/panelists",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "webinars",
        ":webinarId",
        "panelists"
      ],
      "variable": [
        {
          "key": "webinarId",
          "value": "68423085",
          "description": "(Required) The webinar's ID."
        }
      ]
    },
    "description": "Panelists in a Webinar can view and send video, screen share, annotate, etc and do much more compared to attendees in a Webinar. \n\nUse this API to list all the panelists of a Webinar.<br><br>\n**Scopes:** `webinar:read:admin` `webinar:read`<br>\n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`<br>\n**Prerequisites:**<br>\n* Pro or a higher plan with [Webinar Add-on](https://zoom.us/webinar).<br> "
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nWebinar plan subscription missing. Enable webinar for this user once the subscription is added.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/panelists",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "panelists"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"total_records\": \"2\",\n \"panelists\": [\n  {\n   \"name\": \"Mary\",\n   \"email\": \"example@example.com\"\n  },\n  {\n   \"name\": \"Mike\",\n   \"email\": \"example-2@example.com\"\n  }\n ]\n}"
    },
    {
      "name": "**HTTP Status Code:** `300`<br>",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/panelists",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "panelists"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "Multiple Choices",
      "code": 300,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `400`<br>\nBad request<br>\n**Error Code:** `1010`<br>\nUser does not belong to this account:{accountId}.<br>",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/panelists",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "panelists"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404`<br>\nWebinar not found.<br>\n**Error Code:** `1001`<br>\nUser {userId} does not exist or does not belong to this account.<br>\n**Error Code:** `3001`<br>\nWebinar {webinarId} not found or has expired.<br>",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/panelists",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "panelists"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}