Chilkat Online Tools

unicodeC / Zoom API / Update Zoom Room settings

Back to Collection Items

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

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkHttpRequestW req;
    HCkJsonObjectW jsonFormData1;
    HCkJsonObjectW jsonFormData2;
    HCkHttpResponseW resp;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;

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

    http = CkHttpW_Create();

    req = CkHttpRequestW_Create();
    CkHttpRequestW_putHttpVerb(req,L"PATCH");
    CkHttpRequestW_putPath(req,L"/");
    CkHttpRequestW_putContentType(req,L"multipart/form-data");

    jsonFormData1 = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateBool(jsonFormData1,L"upcoming_meeting_alert",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"show_alert_before_meeting",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"start_airplay_mirroring",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"start_airplay_manually",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"weekly_system_restart",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"display_meeting_list",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"display_top_banner",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"display_feedback_survey",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"auto_direct_sharing",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"transform_meeting_to_private",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"hide_id_for_private_meeting",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"auto_start_scheduled_meeting",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"auto_stop_scheduled_meeting",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"hide_share_instruction",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"audio_device_daily_auto_test",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"support_join_3rd_party_meeting",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"encrypt_shared_screen_content",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"allow_multiple_content_sharing",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"show_non_video_participants",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"show_call_history_in_room",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"show_contact_list_on_controller",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"count_attendees_number_in_room",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData1,L"send_whiteboard_to_internal_contact_only",FALSE);
    CkHttpRequestW_AddStringForUpload2(req,L"zoom_rooms",L"",jsonFormData1,L"utf-8",L"application/json");

    jsonFormData2 = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateBool(jsonFormData2,L"upcoming_meeting_alert",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"show_alert_before_meeting",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"start_airplay_mirroring",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"start_airplay_manually",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"weekly_system_restart",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"display_meeting_list",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"display_top_banner",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"display_feedback_survey",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"auto_direct_sharing",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"transform_meeting_to_private",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"hide_id_for_private_meeting",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"auto_start_scheduled_meeting",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"auto_stop_scheduled_meeting",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"hide_share_instruction",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"audio_device_daily_auto_test",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"support_join_3rd_party_meeting",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"encrypt_shared_screen_content",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"allow_multiple_content_sharing",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"show_non_video_participants",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"show_call_history_in_room",FALSE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"show_contact_list_on_controller",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"count_attendees_number_in_room",TRUE);
    CkJsonObjectW_UpdateBool(jsonFormData2,L"send_whiteboard_to_internal_contact_only",FALSE);
    CkHttpRequestW_AddStringForUpload2(req,L"meeting_security",L"",jsonFormData2,L"utf-8",L"application/json");

    CkHttpRequestW_AddHeader(req,L"Authorization",L"Bearer <access_token>");

    resp = CkHttpW_SynchronousRequest(http,L"reprehenderit",80,FALSE,req);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkHttpRequestW_Dispose(req);
        CkJsonObjectW_Dispose(jsonFormData1);
        CkJsonObjectW_Dispose(jsonFormData2);
        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);
        CkHttpRequestW_Dispose(req);
        CkJsonObjectW_Dispose(jsonFormData1);
        CkJsonObjectW_Dispose(jsonFormData2);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    CkHttpResponseW_Dispose(resp);


    CkHttpW_Dispose(http);
    CkHttpRequestW_Dispose(req);
    CkJsonObjectW_Dispose(jsonFormData1);
    CkJsonObjectW_Dispose(jsonFormData2);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -X PATCH
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'zoom_rooms={"upcoming_meeting_alert":true,"show_alert_before_meeting":true,"start_airplay_mirroring":true,"start_airplay_manually":true,"weekly_system_restart":false,"display_meeting_list":false,"display_top_banner":true,"display_feedback_survey":true,"auto_direct_sharing":true,"transform_meeting_to_private":true,"hide_id_for_private_meeting":false,"auto_start_scheduled_meeting":true,"auto_stop_scheduled_meeting":false,"hide_share_instruction":false,"audio_device_daily_auto_test":false,"support_join_3rd_party_meeting":false,"encrypt_shared_screen_content":false,"allow_multiple_content_sharing":true,"show_non_video_participants":true,"show_call_history_in_room":false,"show_contact_list_on_controller":true,"count_attendees_number_in_room":true,"send_whiteboard_to_internal_contact_only":false}'
	--form 'meeting_security={"upcoming_meeting_alert":true,"show_alert_before_meeting":true,"start_airplay_mirroring":true,"start_airplay_manually":true,"weekly_system_restart":false,"display_meeting_list":false,"display_top_banner":true,"display_feedback_survey":true,"auto_direct_sharing":true,"transform_meeting_to_private":true,"hide_id_for_private_meeting":false,"auto_start_scheduled_meeting":true,"auto_stop_scheduled_meeting":false,"hide_share_instruction":false,"audio_device_daily_auto_test":false,"support_join_3rd_party_meeting":false,"encrypt_shared_screen_content":false,"allow_multiple_content_sharing":true,"show_non_video_participants":true,"show_call_history_in_room":false,"show_contact_list_on_controller":true,"count_attendees_number_in_room":true,"send_whiteboard_to_internal_contact_only":false}{"end_to_end_encrypted_meetings":true,"encryption_type":"enhanced_encryption"}'
https://api.zoom.us/v2/rooms/:roomId/settings?setting_type=quis officia in reprehenderit

Postman Collection Item JSON

{
  "name": "Update Zoom Room settings",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "PATCH",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "zoom_rooms",
          "value": "{\"upcoming_meeting_alert\":true,\"show_alert_before_meeting\":true,\"start_airplay_mirroring\":true,\"start_airplay_manually\":true,\"weekly_system_restart\":false,\"display_meeting_list\":false,\"display_top_banner\":true,\"display_feedback_survey\":true,\"auto_direct_sharing\":true,\"transform_meeting_to_private\":true,\"hide_id_for_private_meeting\":false,\"auto_start_scheduled_meeting\":true,\"auto_stop_scheduled_meeting\":false,\"hide_share_instruction\":false,\"audio_device_daily_auto_test\":false,\"support_join_3rd_party_meeting\":false,\"encrypt_shared_screen_content\":false,\"allow_multiple_content_sharing\":true,\"show_non_video_participants\":true,\"show_call_history_in_room\":false,\"show_contact_list_on_controller\":true,\"count_attendees_number_in_room\":true,\"send_whiteboard_to_internal_contact_only\":false}",
          "type": "text"
        },
        {
          "key": "meeting_security",
          "value": "{\"end_to_end_encrypted_meetings\":true,\"encryption_type\":\"enhanced_encryption\"}",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/rooms/:roomId/settings?setting_type=quis officia in reprehenderit",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "rooms",
        ":roomId",
        "settings"
      ],
      "query": [
        {
          "key": "setting_type",
          "value": "quis officia in reprehenderit",
          "description": "The type of setting that you would like to update.<br> `alert`: Alert Settings applied on the Zoom Room.<br>\n`meeting`: Meeting settings of the Zoom Room.<br>\n`signage`: Digital signage settings applied on the Zoom Room."
        }
      ],
      "variable": [
        {
          "key": "roomId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) Unique Identifier of the Zoom Room."
        }
      ]
    },
    "description": "Update either meeting or alert settings applied to a specific Zoom Room. To update **Alert Settings**, specify `alert` as the value of the `setting_type` query parameter. To update **Meeting Settings**, specify `meeting` as the value of the `setting_type` query parameter.<br>\n**Prerequisites:**<br>\n* Zoom Room licenses\n* Owner or Admin privileges on the Zoom Account.<br>\n**Scopes:** `room:write:admin`<br> \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `204` **No Content**<br>\nSettings updated successfully. ",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "zoom_rooms",
              "value": "{\"upcoming_meeting_alert\":true,\"show_alert_before_meeting\":true,\"start_airplay_mirroring\":true,\"start_airplay_manually\":true,\"weekly_system_restart\":false,\"display_meeting_list\":false,\"display_top_banner\":true,\"display_feedback_survey\":true,\"auto_direct_sharing\":true,\"transform_meeting_to_private\":true,\"hide_id_for_private_meeting\":false,\"auto_start_scheduled_meeting\":true,\"auto_stop_scheduled_meeting\":false,\"hide_share_instruction\":false,\"audio_device_daily_auto_test\":false,\"support_join_3rd_party_meeting\":false,\"encrypt_shared_screen_content\":false,\"allow_multiple_content_sharing\":true,\"show_non_video_participants\":true,\"show_call_history_in_room\":false,\"show_contact_list_on_controller\":true,\"count_attendees_number_in_room\":true,\"send_whiteboard_to_internal_contact_only\":false}",
              "type": "text"
            },
            {
              "key": "meeting_security",
              "value": "{\"end_to_end_encrypted_meetings\":true,\"encryption_type\":\"enhanced_encryption\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/:roomId/settings?setting_type=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            ":roomId",
            "settings"
          ],
          "query": [
            {
              "key": "setting_type",
              "value": "quis officia in reprehenderit"
            }
          ],
          "variable": [
            {
              "key": "roomId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique Identifier of the Zoom Room."
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{}"
    },
    {
      "name": "**HTTP Status Code:** `400` **Bad Request**<br><br>\n**Error Code:** `200`<br>\nZoom Room subscription not found. Try again after purchasing a Zoom Room subscription.<br>\nAccess restricted.",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "zoom_rooms",
              "value": "{\"upcoming_meeting_alert\":true,\"show_alert_before_meeting\":true,\"start_airplay_mirroring\":true,\"start_airplay_manually\":true,\"weekly_system_restart\":false,\"display_meeting_list\":false,\"display_top_banner\":true,\"display_feedback_survey\":true,\"auto_direct_sharing\":true,\"transform_meeting_to_private\":true,\"hide_id_for_private_meeting\":false,\"auto_start_scheduled_meeting\":true,\"auto_stop_scheduled_meeting\":false,\"hide_share_instruction\":false,\"audio_device_daily_auto_test\":false,\"support_join_3rd_party_meeting\":false,\"encrypt_shared_screen_content\":false,\"allow_multiple_content_sharing\":true,\"show_non_video_participants\":true,\"show_call_history_in_room\":false,\"show_contact_list_on_controller\":true,\"count_attendees_number_in_room\":true,\"send_whiteboard_to_internal_contact_only\":false}",
              "type": "text"
            },
            {
              "key": "meeting_security",
              "value": "{\"end_to_end_encrypted_meetings\":true,\"encryption_type\":\"enhanced_encryption\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/:roomId/settings?setting_type=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            ":roomId",
            "settings"
          ],
          "query": [
            {
              "key": "setting_type",
              "value": "quis officia in reprehenderit"
            }
          ],
          "variable": [
            {
              "key": "roomId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique Identifier of the Zoom Room."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}