Chilkat Online Tools

PowerBuilder / Zoom API / Update Zoom Room account profile

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Req
oleobject loo_JsonFormData1
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
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_Req = create oleobject
li_rc = loo_Req.ConnectToNewObject("Chilkat_9_5_0.HttpRequest")

loo_Req.HttpVerb = "PATCH"
loo_Req.Path = "/v2/rooms/account_profile"
loo_Req.ContentType = "multipart/form-data"

loo_JsonFormData1 = create oleobject
li_rc = loo_JsonFormData1.ConnectToNewObject("Chilkat_9_5_0.JsonObject")

loo_JsonFormData1.UpdateString("support_email","DxQGZpZZ@tTcjuIQeuYlHsZj.npxc")
loo_JsonFormData1.UpdateString("support_phone","amet cillum anim commodo")
loo_JsonFormData1.UpdateString("room_passcode","reprehende")
loo_JsonFormData1.UpdateBool("required_code_to_ext",0)
loo_Req.AddParam("basic",loo_JsonFormData1.Emit())

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
    return
end if

loo_SbResponseBody = create oleobject
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat_9_5_0.StringBuilder")

loo_Resp.GetBodySb(loo_SbResponseBody)

loo_JResp = create oleobject
li_rc = loo_JResp.ConnectToNewObject("Chilkat_9_5_0.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_SbResponseBody
    destroy loo_JResp
    return
end if

destroy loo_Resp


destroy loo_Http
destroy loo_Req
destroy loo_JsonFormData1
destroy loo_SbResponseBody
destroy loo_JResp

Curl Command

curl -X PATCH
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'basic={"support_email":"DxQGZpZZ@tTcjuIQeuYlHsZj.npxc","support_phone":"amet cillum anim commodo","room_passcode":"reprehende","required_code_to_ext":false}'
https://api.zoom.us/v2/rooms/account_profile

Postman Collection Item JSON

{
  "name": "Update Zoom Room account profile",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "PATCH",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "basic",
          "value": "{\"support_email\":\"DxQGZpZZ@tTcjuIQeuYlHsZj.npxc\",\"support_phone\":\"amet cillum anim commodo\",\"room_passcode\":\"reprehende\",\"required_code_to_ext\":false}",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/rooms/account_profile",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "rooms",
        "account_profile"
      ]
    },
    "description": "Update information on the account profile of a Zoom Room. This information can only by accessed either by the Zoom Room Account Owner or a user with Zoom Rooms admin permission. To update information on an individual Room Profile, use [Update Zoom Room Profile API](https://marketplace.zoom.us/docs/api-reference/zoom-api/rooms/updatezrprofile) instead.\n\n**Prerequisites:**<br>\n* Zoom account owner or Zoom Rooms admin permissions<br>\n\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>\nProfile updated successfully.",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "basic",
              "value": "{\"support_email\":\"DxQGZpZZ@tTcjuIQeuYlHsZj.npxc\",\"support_phone\":\"amet cillum anim commodo\",\"room_passcode\":\"reprehende\",\"required_code_to_ext\":false}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/account_profile",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            "account_profile"
          ]
        }
      },
      "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": "basic",
              "value": "{\"support_email\":\"DxQGZpZZ@tTcjuIQeuYlHsZj.npxc\",\"support_phone\":\"amet cillum anim commodo\",\"room_passcode\":\"reprehende\",\"required_code_to_ext\":false}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/account_profile",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            "account_profile"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}