Chilkat Online Tools

C / Zoom API / Get a webinar

Back to Collection Items

#include <C_CkHttp.h>
#include <C_CkJsonObject.h>
#include <C_CkHttpResponse.h>
#include <C_CkStringBuilder.h>

void ChilkatSample(void)
    {
    HCkHttp http;
    BOOL success;
    HCkJsonObject queryParams;
    HCkHttpResponse resp;
    HCkStringBuilder sbResponseBody;
    HCkJsonObject jResp;
    int respStatusCode;
    const char *strVal;
    const char *city;
    const char *country;
    const char *country_name;
    const char *v_number;
    const char *v_type_str;
    const char *created_at;
    int duration;
    const char *host_id;
    int id;
    const char *join_url;
    BOOL Allow_multiple_devices;
    const char *Alternative_hosts;
    int Approval_type;
    const char *Audio;
    const char *Auto_recording;
    BOOL Close_registration;
    const char *Contact_email;
    const char *Contact_name;
    BOOL Enforce_login;
    const char *Enforce_login_domains;
    BOOL Hd_video;
    BOOL Hd_video_for_attendees;
    BOOL Send_1080p_video_to_attendees;
    BOOL Host_video;
    BOOL On_demand;
    BOOL Panelists_video;
    BOOL Practice_session;
    BOOL Question_answer;
    BOOL Registrants_confirmation_email;
    int Registrants_restrict_number;
    BOOL Show_share_button;
    BOOL Registrants_email_notification;
    const char *Email_language;
    BOOL Panelists_invitation_email_notification;
    BOOL Enable;
    int v_Type;
    BOOL Follow_up_attendees_email_notificationEnable;
    int Follow_up_attendees_email_notificationType;
    BOOL Follow_up_absentees_email_notificationEnable;
    int Follow_up_absentees_email_notificationType;
    const char *start_time;
    const char *start_url;
    const char *timezone;
    const char *topic;
    int v_type;
    const char *uuid;
    int i;
    int count_i;

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

    http = CkHttp_Create();

    queryParams = CkJsonObject_Create();
    CkJsonObject_UpdateString(queryParams,"occurrence_id","quis officia in reprehenderit");
    CkJsonObject_UpdateString(queryParams,"show_previous_occurrences","true");

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

    resp = CkHttp_QuickRequestParams(http,"GET","https://api.zoom.us/v2/webinars/:webinarId",queryParams);
    if (CkHttp_getLastMethodSuccess(http) == FALSE) {
        printf("%s\n",CkHttp_lastErrorText(http));
        CkHttp_Dispose(http);
        CkJsonObject_Dispose(queryParams);
        return;
    }

    sbResponseBody = CkStringBuilder_Create();
    CkHttpResponse_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObject_Create();
    CkJsonObject_LoadSb(jResp,sbResponseBody);
    CkJsonObject_putEmitCompact(jResp,FALSE);

    printf("Response Body:\n");
    printf("%s\n",CkJsonObject_emit(jResp));

    respStatusCode = CkHttpResponse_getStatusCode(resp);
    printf("Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        printf("Response Header:\n");
        printf("%s\n",CkHttpResponse_header(resp));
        printf("Failed.\n");
        CkHttpResponse_Dispose(resp);
        CkHttp_Dispose(http);
        CkJsonObject_Dispose(queryParams);
        CkStringBuilder_Dispose(sbResponseBody);
        CkJsonObject_Dispose(jResp);
        return;
    }

    CkHttpResponse_Dispose(resp);

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

    // {
    //   "created_at": "2019-09-13T15:35:00Z",
    //   "duration": 60,
    //   "host_id": "Labcjskdfsjgfg",
    //   "id": 12345678,
    //   "join_url": "https://zoom.us/j/12345678",
    //   "settings": {
    //     "allow_multiple_devices": true,
    //     "alternative_hosts": "",
    //     "approval_type": 2,
    //     "audio": "both",
    //     "auto_recording": "local",
    //     "close_registration": true,
    //     "contact_email": "example@example.com",
    //     "contact_name": "Amal",
    //     "enforce_login": false,
    //     "enforce_login_domains": "",
    //     "global_dial_in_countries": [
    //       "US"
    //     ],
    //     "global_dial_in_numbers": [
    //       {
    //         "city": "New York",
    //         "country": "US",
    //         "country_name": "US",
    //         "number": "+1 00000",
    //         "type": "toll"
    //       },
    //       {
    //         "city": "San Jose",
    //         "country": "US",
    //         "country_name": "US",
    //         "number": "+1 111111111",
    //         "type": "toll"
    //       },
    //       {
    //         "city": "San Jose",
    //         "country": "US",
    //         "country_name": "US",
    //         "number": "+1 11111110",
    //         "type": "toll"
    //       }
    //     ],
    //     "hd_video": false,
    //     "hd_video_for_attendees": false,
    //     "send_1080p_video_to_attendees": false,
    //     "host_video": false,
    //     "on_demand": false,
    //     "panelists_video": false,
    //     "practice_session": false,
    //     "question_answer": true,
    //     "registrants_confirmation_email": true,
    //     "registrants_restrict_number": 0,
    //     "show_share_button": true,
    //     "registrants_email_notification": true,
    //     "email_language": "en-US",
    //     "panelists_invitation_email_notification": true,
    //     "attendees_and_panelists_reminder_email_notification": {
    //       "enable": true,
    //       "type": 1
    //     },
    //     "follow_up_attendees_email_notification": {
    //       "enable": true,
    //       "type": 1
    //     },
    //     "follow_up_absentees_email_notification": {
    //       "enable": true,
    //       "type": 1
    //     }
    //   },
    //   "start_time": "2019-08-30T22:00:00Z",
    //   "start_url": "https://zoom.us/s/00000011110?zhghTlUT1Rjd2FXRgh0amxoejNQZ1EiLCJjaWQiOiIifQ.NJ0CXWQ-yhI8Xv01JvxityBtzp3Bt7odMOEG2L8DLmY",
    //   "timezone": "America/New_York",
    //   "topic": "Test Webinar",
    //   "type": 5,
    //   "uuid": "nWMHAAAAAAAAAAAAAUDP1A=="
    // }

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

    created_at = CkJsonObject_stringOf(jResp,"created_at");
    duration = CkJsonObject_IntOf(jResp,"duration");
    host_id = CkJsonObject_stringOf(jResp,"host_id");
    id = CkJsonObject_IntOf(jResp,"id");
    join_url = CkJsonObject_stringOf(jResp,"join_url");
    Allow_multiple_devices = CkJsonObject_BoolOf(jResp,"settings.allow_multiple_devices");
    Alternative_hosts = CkJsonObject_stringOf(jResp,"settings.alternative_hosts");
    Approval_type = CkJsonObject_IntOf(jResp,"settings.approval_type");
    Audio = CkJsonObject_stringOf(jResp,"settings.audio");
    Auto_recording = CkJsonObject_stringOf(jResp,"settings.auto_recording");
    Close_registration = CkJsonObject_BoolOf(jResp,"settings.close_registration");
    Contact_email = CkJsonObject_stringOf(jResp,"settings.contact_email");
    Contact_name = CkJsonObject_stringOf(jResp,"settings.contact_name");
    Enforce_login = CkJsonObject_BoolOf(jResp,"settings.enforce_login");
    Enforce_login_domains = CkJsonObject_stringOf(jResp,"settings.enforce_login_domains");
    Hd_video = CkJsonObject_BoolOf(jResp,"settings.hd_video");
    Hd_video_for_attendees = CkJsonObject_BoolOf(jResp,"settings.hd_video_for_attendees");
    Send_1080p_video_to_attendees = CkJsonObject_BoolOf(jResp,"settings.send_1080p_video_to_attendees");
    Host_video = CkJsonObject_BoolOf(jResp,"settings.host_video");
    On_demand = CkJsonObject_BoolOf(jResp,"settings.on_demand");
    Panelists_video = CkJsonObject_BoolOf(jResp,"settings.panelists_video");
    Practice_session = CkJsonObject_BoolOf(jResp,"settings.practice_session");
    Question_answer = CkJsonObject_BoolOf(jResp,"settings.question_answer");
    Registrants_confirmation_email = CkJsonObject_BoolOf(jResp,"settings.registrants_confirmation_email");
    Registrants_restrict_number = CkJsonObject_IntOf(jResp,"settings.registrants_restrict_number");
    Show_share_button = CkJsonObject_BoolOf(jResp,"settings.show_share_button");
    Registrants_email_notification = CkJsonObject_BoolOf(jResp,"settings.registrants_email_notification");
    Email_language = CkJsonObject_stringOf(jResp,"settings.email_language");
    Panelists_invitation_email_notification = CkJsonObject_BoolOf(jResp,"settings.panelists_invitation_email_notification");
    Enable = CkJsonObject_BoolOf(jResp,"settings.attendees_and_panelists_reminder_email_notification.enable");
    v_Type = CkJsonObject_IntOf(jResp,"settings.attendees_and_panelists_reminder_email_notification.type");
    Follow_up_attendees_email_notificationEnable = CkJsonObject_BoolOf(jResp,"settings.follow_up_attendees_email_notification.enable");
    Follow_up_attendees_email_notificationType = CkJsonObject_IntOf(jResp,"settings.follow_up_attendees_email_notification.type");
    Follow_up_absentees_email_notificationEnable = CkJsonObject_BoolOf(jResp,"settings.follow_up_absentees_email_notification.enable");
    Follow_up_absentees_email_notificationType = CkJsonObject_IntOf(jResp,"settings.follow_up_absentees_email_notification.type");
    start_time = CkJsonObject_stringOf(jResp,"start_time");
    start_url = CkJsonObject_stringOf(jResp,"start_url");
    timezone = CkJsonObject_stringOf(jResp,"timezone");
    topic = CkJsonObject_stringOf(jResp,"topic");
    v_type = CkJsonObject_IntOf(jResp,"type");
    uuid = CkJsonObject_stringOf(jResp,"uuid");
    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"settings.global_dial_in_countries");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        strVal = CkJsonObject_stringOf(jResp,"settings.global_dial_in_countries[i]");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"settings.global_dial_in_numbers");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        city = CkJsonObject_stringOf(jResp,"settings.global_dial_in_numbers[i].city");
        country = CkJsonObject_stringOf(jResp,"settings.global_dial_in_numbers[i].country");
        country_name = CkJsonObject_stringOf(jResp,"settings.global_dial_in_numbers[i].country_name");
        v_number = CkJsonObject_stringOf(jResp,"settings.global_dial_in_numbers[i].number");
        v_type_str = CkJsonObject_stringOf(jResp,"settings.global_dial_in_numbers[i].type");
        i = i + 1;
    }



    CkHttp_Dispose(http);
    CkJsonObject_Dispose(queryParams);
    CkStringBuilder_Dispose(sbResponseBody);
    CkJsonObject_Dispose(jResp);

    }

Curl Command

curl -G -d "occurrence_id=quis%20officia%20in%20reprehenderit"
	-d "show_previous_occurrences=true"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/webinars/:webinarId

Postman Collection Item JSON

{
  "name": "Get a webinar",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/webinars/:webinarId?occurrence_id=quis officia in reprehenderit&show_previous_occurrences=true",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "webinars",
        ":webinarId"
      ],
      "query": [
        {
          "key": "occurrence_id",
          "value": "quis officia in reprehenderit",
          "description": "Unique Identifier that identifies an occurrence of a recurring webinar. [Recurring webinars](https://support.zoom.us/hc/en-us/articles/216354763-How-to-Schedule-A-Recurring-Webinar) can have a maximum of 50 occurrences. When you create a recurring Webinar using [Create a Webinar API](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarcreate), you can retrieve the Occurrence ID from the response of the API call."
        },
        {
          "key": "show_previous_occurrences",
          "value": "true",
          "description": "Set the value of this field to `true` if you would like to view Webinar details of all previous occurrences of a recurring Webinar."
        }
      ],
      "variable": [
        {
          "key": "webinarId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The webinar's ID or universally unique ID (UUID)."
        }
      ]
    },
    "description": "Zoom users with a [Webinar Plan](https://zoom.us/webinar) have access to creating and managing Webinars. Webinar allows a host to broadcast a Zoom meeting to up to 10,000 attendees.<br>Use this API to get details of a scheduled webinar.<br><br>\n**Scopes:** `webinar:read:admin` `webinar:read`<br> \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>**Prerequisites:**\n* Pro or higher plan with a Webinar Add-on."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nSuccess",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId?occurrence_id=quis officia in reprehenderit&show_previous_occurrences=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "show_previous_occurrences",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID)."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"created_at\": \"2019-09-13T15:35:00Z\",\n \"duration\": 60,\n \"host_id\": \"Labcjskdfsjgfg\",\n \"id\": 12345678,\n \"join_url\": \"https://zoom.us/j/12345678\",\n \"settings\": {\n  \"allow_multiple_devices\": true,\n  \"alternative_hosts\": \"\",\n  \"approval_type\": 2,\n  \"audio\": \"both\",\n  \"auto_recording\": \"local\",\n  \"close_registration\": true,\n  \"contact_email\": \"example@example.com\",\n  \"contact_name\": \"Amal\",\n  \"enforce_login\": false,\n  \"enforce_login_domains\": \"\",\n  \"global_dial_in_countries\": [\n   \"US\"\n  ],\n  \"global_dial_in_numbers\": [\n   {\n    \"city\": \"New York\",\n    \"country\": \"US\",\n    \"country_name\": \"US\",\n    \"number\": \"+1 00000\",\n    \"type\": \"toll\"\n   },\n   {\n    \"city\": \"San Jose\",\n    \"country\": \"US\",\n    \"country_name\": \"US\",\n    \"number\": \"+1 111111111\",\n    \"type\": \"toll\"\n   },\n   {\n    \"city\": \"San Jose\",\n    \"country\": \"US\",\n    \"country_name\": \"US\",\n    \"number\": \"+1 11111110\",\n    \"type\": \"toll\"\n   }\n  ],\n  \"hd_video\": false,\n  \"hd_video_for_attendees\": false,\n  \"send_1080p_video_to_attendees\": false,\n  \"host_video\": false,\n  \"on_demand\": false,\n  \"panelists_video\": false,\n  \"practice_session\": false,\n  \"question_answer\": true,\n  \"registrants_confirmation_email\": true,\n  \"registrants_restrict_number\": 0,\n  \"show_share_button\": true,\n  \"registrants_email_notification\": true,\n  \"email_language\": \"en-US\",\n  \"panelists_invitation_email_notification\": true,\n  \"attendees_and_panelists_reminder_email_notification\": {\n   \"enable\": true,\n   \"type\": 1\n  },\n  \"follow_up_attendees_email_notification\": {\n   \"enable\": true,\n   \"type\": 1\n  },\n  \"follow_up_absentees_email_notification\": {\n   \"enable\": true,\n   \"type\": 1\n  }\n },\n \"start_time\": \"2019-08-30T22:00:00Z\",\n \"start_url\": \"https://zoom.us/s/00000011110?zhghTlUT1Rjd2FXRgh0amxoejNQZ1EiLCJjaWQiOiIifQ.NJ0CXWQ-yhI8Xv01JvxityBtzp3Bt7odMOEG2L8DLmY\",\n \"timezone\": \"America/New_York\",\n \"topic\": \"Test Webinar\",\n \"type\": 5,\n \"uuid\": \"nWMHAAAAAAAAAAAAAUDP1A==\"\n}"
    },
    {
      "name": "**HTTP Status Code:** `300`<br>Invalid webinar ID.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId?occurrence_id=quis officia in reprehenderit&show_previous_occurrences=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "show_previous_occurrences",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID)."
            }
          ]
        }
      },
      "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?occurrence_id=quis officia in reprehenderit&show_previous_occurrences=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "show_previous_occurrences",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID)."
            }
          ]
        }
      },
      "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?occurrence_id=quis officia in reprehenderit&show_previous_occurrences=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "show_previous_occurrences",
              "value": "true"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The webinar's ID or universally unique ID (UUID)."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}