Chilkat Online Tools

Node.js / Zoom API / List Zoom Rooms

Back to Collection Items

var os = require('os');
if (os.platform() == 'win32') {  
    if (os.arch() == 'ia32') {
        var chilkat = require('@chilkat/ck-node21-win-ia32');
    } else {
        var chilkat = require('@chilkat/ck-node21-win64'); 
    }
} else if (os.platform() == 'linux') {
    if (os.arch() == 'arm') {
        var chilkat = require('@chilkat/ck-node21-arm');
    } else if (os.arch() == 'x86') {
        var chilkat = require('@chilkat/ck-node21-linux32');
    } else {
        var chilkat = require('@chilkat/ck-node21-linux64');
    }
} else if (os.platform() == 'darwin') {
    if (os.arch() == 'arm64') {
        var chilkat = require('@chilkat/ck-node21-mac-m1');
    } else {
        var chilkat = require('@chilkat/ck-node21-macosx');
    }
}


function chilkatExample() {

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

    var http = new chilkat.Http();
    var success;

    var queryParams = new chilkat.JsonObject();
    queryParams.UpdateInt("page_size",30);
    queryParams.UpdateInt("page_number",1);
    queryParams.UpdateString("next_page_token","quis officia in reprehenderit");

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

    // resp: HttpResponse
    var resp = http.QuickRequestParams("GET","https://api.zoom.us/v2/metrics/zoomrooms",queryParams);
    if (http.LastMethodSuccess == false) {
        console.log(http.LastErrorText);
        return;
    }

    var sbResponseBody = new chilkat.StringBuilder();
    resp.GetBodySb(sbResponseBody);

    var jResp = new chilkat.JsonObject();
    jResp.LoadSb(sbResponseBody);
    jResp.EmitCompact = false;

    console.log("Response Body:");
    console.log(jResp.Emit());

    var respStatusCode = resp.StatusCode;
    console.log("Response Status Code = " + respStatusCode);
    if (respStatusCode >= 400) {
        console.log("Response Header:");
        console.log(resp.Header);
        console.log("Failed.");

        return;
    }

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "page_count": 1,
    //   "page_number": 1,
    //   "page_size": 30,
    //   "total_records": 1,
    //   "zoom_rooms": [
    //     {
    //       "id": "EbgjgjhghZY9wh0A",
    //       "room_name": "testZoomRoom",
    //       "calendar_name": "example.cal",
    //       "email": "example@example.com",
    //       "account_type": "Work Email",
    //       "status": "Offline",
    //       "device_ip": "Computer : 192.0.2.0",
    //       "camera": "Integrated Webcam",
    //       "microphone": "Microphone Array (Realtek Audio)",
    //       "speaker": "Speakers / Headphones (Realtek Audio)",
    //       "last_start_time": "2019-08-29T16:37:07Z",
    //       "issues": [
    //         "Zoom room is offline"
    //       ],
    //       "health": "critical"
    //     }
    //   ]
    // }

    // Sample code for parsing the JSON response...
    // Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    var id;
    var room_name;
    var calendar_name;
    var email;
    var account_type;
    var status;
    var device_ip;
    var camera;
    var microphone;
    var speaker;
    var last_start_time;
    var health;
    var j;
    var count_j;
    var strVal;

    var page_count = jResp.IntOf("page_count");
    var page_number = jResp.IntOf("page_number");
    var page_size = jResp.IntOf("page_size");
    var total_records = jResp.IntOf("total_records");
    var i = 0;
    var count_i = jResp.SizeOfArray("zoom_rooms");
    while (i < count_i) {
        jResp.I = i;
        id = jResp.StringOf("zoom_rooms[i].id");
        room_name = jResp.StringOf("zoom_rooms[i].room_name");
        calendar_name = jResp.StringOf("zoom_rooms[i].calendar_name");
        email = jResp.StringOf("zoom_rooms[i].email");
        account_type = jResp.StringOf("zoom_rooms[i].account_type");
        status = jResp.StringOf("zoom_rooms[i].status");
        device_ip = jResp.StringOf("zoom_rooms[i].device_ip");
        camera = jResp.StringOf("zoom_rooms[i].camera");
        microphone = jResp.StringOf("zoom_rooms[i].microphone");
        speaker = jResp.StringOf("zoom_rooms[i].speaker");
        last_start_time = jResp.StringOf("zoom_rooms[i].last_start_time");
        health = jResp.StringOf("zoom_rooms[i].health");
        j = 0;
        count_j = jResp.SizeOfArray("zoom_rooms[i].issues");
        while (j < count_j) {
            jResp.J = j;
            strVal = jResp.StringOf("zoom_rooms[i].issues[j]");
            j = j+1;
        }

        i = i+1;
    }


}

chilkatExample();

Curl Command

curl -G -d "page_size=30"
	-d "page_number=1"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/metrics/zoomrooms

Postman Collection Item JSON

{
  "name": "List Zoom Rooms",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/metrics/zoomrooms?page_size=30&page_number=1&next_page_token=quis officia in reprehenderit",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "metrics",
        "zoomrooms"
      ],
      "query": [
        {
          "key": "page_size",
          "value": "30",
          "description": "The number of records returned within a single API call."
        },
        {
          "key": "page_number",
          "value": "1",
          "description": "The page number of the current page in the returned records."
        },
        {
          "key": "next_page_token",
          "value": "quis officia in reprehenderit",
          "description": "The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes."
        }
      ]
    },
    "description": "List information on all Zoom Rooms in an account.<br><br>\n**Scopes:** `dashboard_zr:read:admin`\n\n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Resource-intensive`<br>\n **Prerequisites:**<br>\n* Business, Education or API Plan with Zoom Rooms set up.\n\n\n"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nList of Zoom rooms returned.<br>\nOnly available for paid accounts that have enabled the Dashboard feature.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/zoomrooms?page_size=30&page_number=1&next_page_token=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "zoomrooms"
          ],
          "query": [
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "page_number",
              "value": "1"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"page_count\": 1,\n \"page_number\": 1,\n \"page_size\": 30,\n \"total_records\": 1,\n \"zoom_rooms\": [\n  {\n   \"id\": \"EbgjgjhghZY9wh0A\",\n   \"room_name\": \"testZoomRoom\",\n   \"calendar_name\": \"example.cal\",\n   \"email\": \"example@example.com\",\n   \"account_type\": \"Work Email\",\n   \"status\": \"Offline\",\n   \"device_ip\": \"Computer : 192.0.2.0\",\n   \"camera\": \"Integrated Webcam\",\n   \"microphone\": \"Microphone Array (Realtek Audio)\",\n   \"speaker\": \"Speakers / Headphones (Realtek Audio)\",\n   \"last_start_time\": \"2019-08-29T16:37:07Z\",\n   \"issues\": [\n    \"Zoom room is offline\"\n   ],\n   \"health\": \"critical\"\n  }\n ]\n}"
    }
  ]
}