Chilkat Online Tools

Swift3 / Zoom API / Delete a Zoom Room

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

    // Adds the "Authorization: Bearer <access_token>" header.
    http.authToken = "<access_token>"

    var resp: CkoHttpResponse? = http.quickRequest("DELETE", url: "https://api.zoom.us/v2/rooms/:roomId")
    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 DELETE
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/rooms/:roomId

Postman Collection Item JSON

{
  "name": "Delete a Zoom Room",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "DELETE",
    "header": [
    ],
    "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": "[Remove](https://support.zoom.us/hc/en-us/articles/360033432032-Zoom-Room-Device-Profiles#h_e55b2092-c418-4b02-819f-44de51448900) a specific Zoom Room profile from a Zoom account.<br><br>\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):** `Light`"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `204` **No Content** <br>\nZoom Room deleted successfully.\n",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "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>\n\n\n\n",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "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}",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "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": ""
    }
  ]
}