Chilkat Online Tools

PowerBuilder / Zoom API / Get top 25 issues of Zoom Rooms

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Issue_name
integer li_Zoom_rooms_count
string ls_From
string ls_V_to
integer li_Total_records
integer i
integer li_Count_i

// 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_QueryParams = create oleobject
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat_9_5_0.JsonObject")

loo_QueryParams.UpdateString("from","1989-05-07")
loo_QueryParams.UpdateString("to","1989-05-07")

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

loo_Resp = loo_Http.QuickRequestParams("GET","https://api.zoom.us/v2/metrics/zoomrooms/issues",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_QueryParams
    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_QueryParams
    destroy loo_SbResponseBody
    destroy loo_JResp
    return
end if

destroy loo_Resp

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

// {
//   "from": "2019-08-15",
//   "to": "2019-09-15",
//   "total_records": 2,
//   "room_issues": [
//     {
//       "issue_name": "Controller disconnected",
//       "zoom_rooms_count": 1
//     },
//     {
//       "issue_name": "Controller is not charging",
//       "zoom_rooms_count": 1
//     }
//   ]
// }

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

ls_From = loo_JResp.StringOf("from")
ls_V_to = loo_JResp.StringOf("to")
li_Total_records = loo_JResp.IntOf("total_records")
i = 0
li_Count_i = loo_JResp.SizeOfArray("room_issues")
do while i < li_Count_i
    loo_JResp.I = i
    ls_Issue_name = loo_JResp.StringOf("room_issues[i].issue_name")
    li_Zoom_rooms_count = loo_JResp.IntOf("room_issues[i].zoom_rooms_count")
    i = i + 1
loop


destroy loo_Http
destroy loo_QueryParams
destroy loo_SbResponseBody
destroy loo_JResp

Curl Command

curl -G -d "from=1989-05-07"
	-d "to=1989-05-07"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/metrics/zoomrooms/issues

Postman Collection Item JSON

{
  "name": "Get top 25 issues of Zoom Rooms",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/metrics/zoomrooms/issues?from=1989-05-07&to=1989-05-07",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "metrics",
        "zoomrooms",
        "issues"
      ],
      "query": [
        {
          "key": "from",
          "value": "1989-05-07",
          "description": "(Required) Start date in 'yyyy-mm-dd' format. The date range defined by the \"from\" and \"to\" parameters should only be one month as the report includes only one month worth of data at once."
        },
        {
          "key": "to",
          "value": "1989-05-07",
          "description": "(Required) End date."
        }
      ]
    },
    "description": "Get top 25 issues of Zoom Rooms.<br>\n**Scopes:** `dashboard_zr:read:admin`<br>\n\n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>\n **Prerequisites:**<br>\n* Business, Education or API Plan with Zoom Rooms set up.\n\n"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nZoom Room Issue details returned",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/zoomrooms/issues?from=1989-05-07&to=1989-05-07",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "zoomrooms",
            "issues"
          ],
          "query": [
            {
              "key": "from",
              "value": "1989-05-07"
            },
            {
              "key": "to",
              "value": "1989-05-07"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"from\": \"2019-08-15\",\n \"to\": \"2019-09-15\",\n \"total_records\": 2,\n \"room_issues\": [\n  {\n   \"issue_name\": \"Controller disconnected\",\n   \"zoom_rooms_count\": 1\n  },\n  {\n   \"issue_name\": \"Controller is not charging\",\n   \"zoom_rooms_count\": 1\n  }\n ]\n}"
    }
  ]
}