Chilkat Online Tools

PowerBuilder / Zoom API / Update location settings

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Req
oleobject loo_JsonFormData1
oleobject loo_JsonFormData2
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode

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

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_Req = create oleobject
// Use "Chilkat_9_5_0.HttpRequest" for versions of Chilkat < 10.0.0
li_rc = loo_Req.ConnectToNewObject("Chilkat.HttpRequest")

loo_Req.HttpVerb = "PATCH"
loo_Req.Path = "/v2/rooms/locations/:locationId/settings?setting_type=meeting"
loo_Req.ContentType = "multipart/form-data"

loo_JsonFormData1 = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JsonFormData1.ConnectToNewObject("Chilkat.JsonObject")

loo_JsonFormData1.UpdateBool("upcoming_meeting_alert",0)
loo_JsonFormData1.UpdateBool("show_alert_before_meeting",1)
loo_JsonFormData1.UpdateBool("start_airplay_mirroring",1)
loo_JsonFormData1.UpdateBool("start_airplay_manually",1)
loo_JsonFormData1.UpdateBool("weekly_system_restart",1)
loo_JsonFormData1.UpdateBool("display_meeting_list",0)
loo_JsonFormData1.UpdateBool("display_top_banner",0)
loo_JsonFormData1.UpdateBool("display_feedback_survey",0)
loo_JsonFormData1.UpdateBool("auto_accept_incoming_call_and_fecc",1)
loo_JsonFormData1.UpdateBool("hide_self_view",1)
loo_JsonFormData1.UpdateBool("lock_speaker_volume_control",1)
loo_JsonFormData1.UpdateBool("start_hdmi_content_share_manualy",1)
loo_JsonFormData1.UpdateBool("auto_direct_sharing",0)
loo_JsonFormData1.UpdateBool("voice_commands",1)
loo_JsonFormData1.UpdateBool("transform_meeting_to_private",0)
loo_JsonFormData1.UpdateBool("hide_id_for_private_meeting",0)
loo_JsonFormData1.UpdateBool("auto_start_scheduled_meeting",0)
loo_JsonFormData1.UpdateBool("auto_stop_scheduled_meeting",1)
loo_JsonFormData1.UpdateBool("audio_device_daily_auto_test",1)
loo_JsonFormData1.UpdateBool("support_join_3rd_party_meeting",1)
loo_JsonFormData1.UpdateBool("encrypt_shared_screen_content",0)
loo_JsonFormData1.UpdateBool("allow_multiple_content_sharing",0)
loo_JsonFormData1.UpdateBool("show_non_video_participants",0)
loo_JsonFormData1.UpdateBool("show_call_history_in_room",0)
loo_JsonFormData1.UpdateBool("show_contact_list_on_controller",1)
loo_JsonFormData1.UpdateBool("count_attendees_number_in_room",0)
loo_JsonFormData1.UpdateBool("send_whiteboard_to_internal_contact_only",1)
loo_Req.AddStringForUpload2("zoom_rooms","",loo_JsonFormData1,"utf-8","application/json")

loo_JsonFormData2 = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JsonFormData2.ConnectToNewObject("Chilkat.JsonObject")

loo_JsonFormData2.UpdateBool("upcoming_meeting_alert",0)
loo_JsonFormData2.UpdateBool("show_alert_before_meeting",1)
loo_JsonFormData2.UpdateBool("start_airplay_mirroring",1)
loo_JsonFormData2.UpdateBool("start_airplay_manually",1)
loo_JsonFormData2.UpdateBool("weekly_system_restart",1)
loo_JsonFormData2.UpdateBool("display_meeting_list",0)
loo_JsonFormData2.UpdateBool("display_top_banner",0)
loo_JsonFormData2.UpdateBool("display_feedback_survey",0)
loo_JsonFormData2.UpdateBool("auto_accept_incoming_call_and_fecc",1)
loo_JsonFormData2.UpdateBool("hide_self_view",1)
loo_JsonFormData2.UpdateBool("lock_speaker_volume_control",1)
loo_JsonFormData2.UpdateBool("start_hdmi_content_share_manualy",1)
loo_JsonFormData2.UpdateBool("auto_direct_sharing",0)
loo_JsonFormData2.UpdateBool("voice_commands",1)
loo_JsonFormData2.UpdateBool("transform_meeting_to_private",0)
loo_JsonFormData2.UpdateBool("hide_id_for_private_meeting",0)
loo_JsonFormData2.UpdateBool("auto_start_scheduled_meeting",0)
loo_JsonFormData2.UpdateBool("auto_stop_scheduled_meeting",1)
loo_JsonFormData2.UpdateBool("audio_device_daily_auto_test",1)
loo_JsonFormData2.UpdateBool("support_join_3rd_party_meeting",1)
loo_JsonFormData2.UpdateBool("encrypt_shared_screen_content",0)
loo_JsonFormData2.UpdateBool("allow_multiple_content_sharing",0)
loo_JsonFormData2.UpdateBool("show_non_video_participants",0)
loo_JsonFormData2.UpdateBool("show_call_history_in_room",0)
loo_JsonFormData2.UpdateBool("show_contact_list_on_controller",1)
loo_JsonFormData2.UpdateBool("count_attendees_number_in_room",0)
loo_JsonFormData2.UpdateBool("send_whiteboard_to_internal_contact_only",1)
loo_Req.AddStringForUpload2("meeting_security","",loo_JsonFormData2,"utf-8","application/json")

loo_Req.AddHeader("Authorization","Bearer <access_token>")

loo_Resp = loo_Http.SynchronousRequest("api.zoom.us",443,1,loo_Req)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Req
    destroy loo_JsonFormData1
    destroy loo_JsonFormData2
    return
end if

loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

loo_Resp.GetBodySb(loo_SbResponseBody)

loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")

loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0

Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()

li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    Write-Debug "Failed."
    destroy loo_Resp
    destroy loo_Http
    destroy loo_Req
    destroy loo_JsonFormData1
    destroy loo_JsonFormData2
    destroy loo_SbResponseBody
    destroy loo_JResp
    return
end if

destroy loo_Resp


destroy loo_Http
destroy loo_Req
destroy loo_JsonFormData1
destroy loo_JsonFormData2
destroy loo_SbResponseBody
destroy loo_JResp

Curl Command

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

Postman Collection Item JSON

{
  "name": "Update location 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\":false,\"show_alert_before_meeting\":true,\"start_airplay_mirroring\":true,\"start_airplay_manually\":true,\"weekly_system_restart\":true,\"display_meeting_list\":false,\"display_top_banner\":false,\"display_feedback_survey\":false,\"auto_accept_incoming_call_and_fecc\":true,\"hide_self_view\":true,\"lock_speaker_volume_control\":true,\"start_hdmi_content_share_manualy\":true,\"auto_direct_sharing\":false,\"voice_commands\":true,\"transform_meeting_to_private\":false,\"hide_id_for_private_meeting\":false,\"auto_start_scheduled_meeting\":false,\"auto_stop_scheduled_meeting\":true,\"audio_device_daily_auto_test\":true,\"support_join_3rd_party_meeting\":true,\"encrypt_shared_screen_content\":false,\"allow_multiple_content_sharing\":false,\"show_non_video_participants\":false,\"show_call_history_in_room\":false,\"show_contact_list_on_controller\":true,\"count_attendees_number_in_room\":false,\"send_whiteboard_to_internal_contact_only\":true}",
          "type": "text"
        },
        {
          "key": "meeting_security",
          "value": "{\"end_to_end_encrypted_meetings\":true,\"encryption_type\":\"enhanced_encryption\"}",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/rooms/locations/:locationId/settings?setting_type=meeting",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "rooms",
        "locations",
        ":locationId",
        "settings"
      ],
      "query": [
        {
          "key": "setting_type",
          "value": "meeting",
          "description": "(Required) The type of setting that you would like to update.<br> `alert`: Alert Settings applied on the Zoom Rooms Account.<br>\n`meeting`: Meeting settings of the Zoom Rooms Account.<br>\n`signage`: Digital signage settings."
        }
      ],
      "variable": [
        {
          "key": "locationId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) Unique identifier of the location type. This can be retrieved using the [List Zoom Room Location API](https://marketplace.zoom.us/docs/api-reference/zoom-api/rooms-location/listzrlocations) (Id property in the response)."
        }
      ]
    },
    "description": "Update information on either meeting or alert settings applied to Zoom Rooms located in a specific location. To update **Alert Settings**, specify `alert` as the value of the `setting_type` query parameter. Similarly, to update **Meeting Settings**, specify `meeting` as the value of the `setting_type` query parameter.<br><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>\nLocation settings 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\":false,\"show_alert_before_meeting\":true,\"start_airplay_mirroring\":true,\"start_airplay_manually\":true,\"weekly_system_restart\":true,\"display_meeting_list\":false,\"display_top_banner\":false,\"display_feedback_survey\":false,\"auto_accept_incoming_call_and_fecc\":true,\"hide_self_view\":true,\"lock_speaker_volume_control\":true,\"start_hdmi_content_share_manualy\":true,\"auto_direct_sharing\":false,\"voice_commands\":true,\"transform_meeting_to_private\":false,\"hide_id_for_private_meeting\":false,\"auto_start_scheduled_meeting\":false,\"auto_stop_scheduled_meeting\":true,\"audio_device_daily_auto_test\":true,\"support_join_3rd_party_meeting\":true,\"encrypt_shared_screen_content\":false,\"allow_multiple_content_sharing\":false,\"show_non_video_participants\":false,\"show_call_history_in_room\":false,\"show_contact_list_on_controller\":true,\"count_attendees_number_in_room\":false,\"send_whiteboard_to_internal_contact_only\":true}",
              "type": "text"
            },
            {
              "key": "meeting_security",
              "value": "{\"end_to_end_encrypted_meetings\":true,\"encryption_type\":\"enhanced_encryption\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/locations/:locationId/settings?setting_type=meeting",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            "locations",
            ":locationId",
            "settings"
          ],
          "query": [
            {
              "key": "setting_type",
              "value": "meeting"
            }
          ],
          "variable": [
            {
              "key": "locationId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique identifier of the location type. This can be retrieved using the [List Zoom Room Location API](https://marketplace.zoom.us/docs/api-reference/zoom-api/rooms-location/listzrlocations) (Id property in the response)."
            }
          ]
        }
      },
      "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\":false,\"show_alert_before_meeting\":true,\"start_airplay_mirroring\":true,\"start_airplay_manually\":true,\"weekly_system_restart\":true,\"display_meeting_list\":false,\"display_top_banner\":false,\"display_feedback_survey\":false,\"auto_accept_incoming_call_and_fecc\":true,\"hide_self_view\":true,\"lock_speaker_volume_control\":true,\"start_hdmi_content_share_manualy\":true,\"auto_direct_sharing\":false,\"voice_commands\":true,\"transform_meeting_to_private\":false,\"hide_id_for_private_meeting\":false,\"auto_start_scheduled_meeting\":false,\"auto_stop_scheduled_meeting\":true,\"audio_device_daily_auto_test\":true,\"support_join_3rd_party_meeting\":true,\"encrypt_shared_screen_content\":false,\"allow_multiple_content_sharing\":false,\"show_non_video_participants\":false,\"show_call_history_in_room\":false,\"show_contact_list_on_controller\":true,\"count_attendees_number_in_room\":false,\"send_whiteboard_to_internal_contact_only\":true}",
              "type": "text"
            },
            {
              "key": "meeting_security",
              "value": "{\"end_to_end_encrypted_meetings\":true,\"encryption_type\":\"enhanced_encryption\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/locations/:locationId/settings?setting_type=meeting",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            "locations",
            ":locationId",
            "settings"
          ],
          "query": [
            {
              "key": "setting_type",
              "value": "meeting"
            }
          ],
          "variable": [
            {
              "key": "locationId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique identifier of the location type. This can be retrieved using the [List Zoom Room Location API](https://marketplace.zoom.us/docs/api-reference/zoom-api/rooms-location/listzrlocations) (Id property in the response)."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404` **Not Found**<br><br>\n**Error Code:** `4801`<br>\nLocation not found: {locationId}",
      "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\":false,\"show_alert_before_meeting\":true,\"start_airplay_mirroring\":true,\"start_airplay_manually\":true,\"weekly_system_restart\":true,\"display_meeting_list\":false,\"display_top_banner\":false,\"display_feedback_survey\":false,\"auto_accept_incoming_call_and_fecc\":true,\"hide_self_view\":true,\"lock_speaker_volume_control\":true,\"start_hdmi_content_share_manualy\":true,\"auto_direct_sharing\":false,\"voice_commands\":true,\"transform_meeting_to_private\":false,\"hide_id_for_private_meeting\":false,\"auto_start_scheduled_meeting\":false,\"auto_stop_scheduled_meeting\":true,\"audio_device_daily_auto_test\":true,\"support_join_3rd_party_meeting\":true,\"encrypt_shared_screen_content\":false,\"allow_multiple_content_sharing\":false,\"show_non_video_participants\":false,\"show_call_history_in_room\":false,\"show_contact_list_on_controller\":true,\"count_attendees_number_in_room\":false,\"send_whiteboard_to_internal_contact_only\":true}",
              "type": "text"
            },
            {
              "key": "meeting_security",
              "value": "{\"end_to_end_encrypted_meetings\":true,\"encryption_type\":\"enhanced_encryption\"}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/locations/:locationId/settings?setting_type=meeting",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            "locations",
            ":locationId",
            "settings"
          ],
          "query": [
            {
              "key": "setting_type",
              "value": "meeting"
            }
          ],
          "variable": [
            {
              "key": "locationId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique identifier of the location type. This can be retrieved using the [List Zoom Room Location API](https://marketplace.zoom.us/docs/api-reference/zoom-api/rooms-location/listzrlocations) (Id property in the response)."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}