Chilkat Online Tools

Swift3 / Zoom API / Update a Zoom Room profile

Back to Collection Items

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

    let http = CkoHttp()!
    var success: Bool

    let req = CkoHttpRequest()!
    req.httpVerb = "PATCH"
    req.path = "/v2/rooms/:roomId"
    req.contentType = "multipart/form-data"

    let jsonFormData1 = CkoJsonObject()!
    jsonFormData1.update("name", value: "ut in")
    jsonFormData1.update("support_email", value: "YAkxZOWRHE@LIxSJPEjJjSLERZGg.gv")
    jsonFormData1.update("support_phone", value: "minim ut sunt")
    jsonFormData1.update("room_passcode", value: "cons")
    jsonFormData1.updateBool("required_code_to_ext", value: false)
    jsonFormData1.updateBool("hide_room_in_contacts", value: false)
    req.addParam("basic", value: jsonFormData1.emit())

    req.addHeader("Authorization", value: "Bearer <access_token>")

    var resp: CkoHttpResponse? = http.synchronousRequest("api.zoom.us", port: 443, ssl: true, req: req)
    if http.lastMethodSuccess == false {
        print("\(http.lastErrorText!)")
        return
    }

    let sbResponseBody = CkoStringBuilder()!
    resp!.getBodySb(sbResponseBody)

    let jResp = CkoJsonObject()!
    jResp.loadSb(sbResponseBody)
    jResp.emitCompact = false

    print("Response Body:")
    print("\(jResp.emit()!)")

    var respStatusCode: Int = resp!.statusCode.intValue
    print("Response Status Code = \(respStatusCode)")
    if respStatusCode >= 400 {
        print("Response Header:")
        print("\(resp!.header!)")
        print("Failed.")
        resp = nil
        return
    }

    resp = nil

}

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": ""
    }
  ]
}