Chilkat Online Tools

delphiDll / Zoom API / Update a Zoom Room profile

Back to Collection Items

var
http: HCkHttp;
success: Boolean;
req: HCkHttpRequest;
jsonFormData1: HCkJsonObject;
resp: HCkHttpResponse;
sbResponseBody: HCkStringBuilder;
jResp: HCkJsonObject;
respStatusCode: Integer;

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

http := CkHttp_Create();

req := CkHttpRequest_Create();
CkHttpRequest_putHttpVerb(req,'PATCH');
CkHttpRequest_putPath(req,'/v2/rooms/:roomId');
CkHttpRequest_putContentType(req,'multipart/form-data');

jsonFormData1 := CkJsonObject_Create();
CkJsonObject_UpdateString(jsonFormData1,'name','ut in');
CkJsonObject_UpdateString(jsonFormData1,'support_email','YAkxZOWRHE@LIxSJPEjJjSLERZGg.gv');
CkJsonObject_UpdateString(jsonFormData1,'support_phone','minim ut sunt');
CkJsonObject_UpdateString(jsonFormData1,'room_passcode','cons');
CkJsonObject_UpdateBool(jsonFormData1,'required_code_to_ext',False);
CkJsonObject_UpdateBool(jsonFormData1,'hide_room_in_contacts',False);
CkHttpRequest_AddParam(req,'basic',CkJsonObject__emit(jsonFormData1));

CkHttpRequest_AddHeader(req,'Authorization','Bearer <access_token>');

resp := CkHttp_SynchronousRequest(http,'api.zoom.us',443,True,req);
if (CkHttp_getLastMethodSuccess(http) = False) then
  begin
    Memo1.Lines.Add(CkHttp__lastErrorText(http));
    Exit;
  end;

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

jResp := CkJsonObject_Create();
CkJsonObject_LoadSb(jResp,sbResponseBody);
CkJsonObject_putEmitCompact(jResp,False);

Memo1.Lines.Add('Response Body:');
Memo1.Lines.Add(CkJsonObject__emit(jResp));

respStatusCode := CkHttpResponse_getStatusCode(resp);
Memo1.Lines.Add('Response Status Code = ' + IntToStr(respStatusCode));
if (respStatusCode >= 400) then
  begin
    Memo1.Lines.Add('Response Header:');
    Memo1.Lines.Add(CkHttpResponse__header(resp));
    Memo1.Lines.Add('Failed.');
    CkHttpResponse_Dispose(resp);
    Exit;
  end;
CkHttpResponse_Dispose(resp);

CkHttp_Dispose(http);
CkHttpRequest_Dispose(req);
CkJsonObject_Dispose(jsonFormData1);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jResp);

Curl Command

curl -X PATCH
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'basic={"name":"ut in","support_email":"YAkxZOWRHE@LIxSJPEjJjSLERZGg.gv","support_phone":"minim ut sunt","room_passcode":"cons","required_code_to_ext":false,"hide_room_in_contacts":false}'
https://api.zoom.us/v2/rooms/:roomId

Postman Collection Item JSON

{
  "name": "Update a Zoom Room profile",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "PATCH",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "basic",
          "value": "{\"name\":\"ut in\",\"support_email\":\"YAkxZOWRHE@LIxSJPEjJjSLERZGg.gv\",\"support_phone\":\"minim ut sunt\",\"room_passcode\":\"cons\",\"required_code_to_ext\":false,\"hide_room_in_contacts\":false}",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/rooms/:roomId",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "rooms",
        ":roomId"
      ],
      "variable": [
        {
          "key": "roomId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) Unique Identifier of a Zoom Room."
        }
      ]
    },
    "description": "Update basic information on a specific Zoom Room in a Zoom account.<br>\n\n**Prerequisites:**<br>\n* Pro or a higher plan with [Zoom Room](https://zoom.us/zoomrooms) license.<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>\nRoom Profile information updated successfully.\n",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "basic",
              "value": "{\"name\":\"ut in\",\"support_email\":\"YAkxZOWRHE@LIxSJPEjJjSLERZGg.gv\",\"support_phone\":\"minim ut sunt\",\"room_passcode\":\"cons\",\"required_code_to_ext\":false,\"hide_room_in_contacts\":false}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/:roomId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            ":roomId"
          ],
          "variable": [
            {
              "key": "roomId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique Identifier of a 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.<br><br>\n\n",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "basic",
              "value": "{\"name\":\"ut in\",\"support_email\":\"YAkxZOWRHE@LIxSJPEjJjSLERZGg.gv\",\"support_phone\":\"minim ut sunt\",\"room_passcode\":\"cons\",\"required_code_to_ext\":false,\"hide_room_in_contacts\":false}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/:roomId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            ":roomId"
          ],
          "variable": [
            {
              "key": "roomId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique Identifier of a Zoom Room."
            }
          ]
        }
      },
      "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:** `1012`<br>\nRoom not found:{roomId}\n",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "basic",
              "value": "{\"name\":\"ut in\",\"support_email\":\"YAkxZOWRHE@LIxSJPEjJjSLERZGg.gv\",\"support_phone\":\"minim ut sunt\",\"room_passcode\":\"cons\",\"required_code_to_ext\":false,\"hide_room_in_contacts\":false}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/:roomId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            ":roomId"
          ],
          "variable": [
            {
              "key": "roomId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique Identifier of a Zoom Room."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}