Chilkat Online Tools

PowerBuilder / Zoom API / List Zoom Room locations

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

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

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_QueryParams = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat.JsonObject")

loo_QueryParams.UpdateString("parent_location_id","quis officia in reprehenderit")
loo_QueryParams.UpdateString("type","quis officia in reprehenderit")
loo_QueryParams.UpdateInt("page_size",30)
loo_QueryParams.UpdateString("next_page_token","quis officia in reprehenderit")

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

loo_Resp = loo_Http.QuickRequestParams("GET","https://api.zoom.us/v2/rooms/locations",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
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

loo_Resp.GetBodySb(loo_SbResponseBody)

loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.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


destroy loo_Http
destroy loo_QueryParams
destroy loo_SbResponseBody
destroy loo_JResp

Curl Command

curl -G -d "parent_location_id=quis%20officia%20in%20reprehenderit"
	-d "type=quis%20officia%20in%20reprehenderit"
	-d "page_size=30"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/rooms/locations

Postman Collection Item JSON

{
  "name": "List Zoom Room locations",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/rooms/locations?parent_location_id=quis officia in reprehenderit&type=quis officia in reprehenderit&page_size=30&next_page_token=quis officia in reprehenderit",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "rooms",
        "locations"
      ],
      "query": [
        {
          "key": "parent_location_id",
          "value": "quis officia in reprehenderit",
          "description": "A unique identifier of the parent location. For instance, if a Zoom Room is located in Floor 1 of Building A, the location of Building A will be the parent location of Floor 1. Use this parameter to filter the response by a specific location hierarchy level."
        },
        {
          "key": "type",
          "value": "quis officia in reprehenderit",
          "description": "Use this field to filter the response by the type of location. The value can be one of the following:\n`country`, `states`, `city`, `campus`, `building`, `floor`. "
        },
        {
          "key": "page_size",
          "value": "30",
          "description": "The number of records returned within a single API call."
        },
        {
          "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": "A Zoom account owner or a Zoom Room administrator can establish a [location hierarchy](https://support.zoom.us/hc/en-us/articles/115000342983-Zoom-Rooms-Location-Hierarchy) to help manage Zoom Rooms that are spread among a variety of locations. Use this API to list the different location types used for Zoom Rooms in an account.<br><br>\n**Prerequisites:**\n* Account owner or admin permissions.\n* Zoom Rooms Version 4.0 or higher<br><br>\n**Scopes:** `room:read:admin`<br> \n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200` **OK**<br>\nZoom Room locations listed successfully.\n",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/rooms/locations?parent_location_id=quis officia in reprehenderit&type=quis officia in reprehenderit&page_size=30&next_page_token=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            "locations"
          ],
          "query": [
            {
              "key": "parent_location_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "type",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "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_size\\\": 30,\\n  \\\"next_page_token\\\": \\\"\\\",\\n  \\\"locations\\\": [\\n    {\\n      \\\"id\\\": \\\"AAAAAAAAAA\\\",\\n      \\\"name\\\": \\\"Country/Region1\\\",\\n      \\\"parent_location_id\\\": \\\"I-qsfdUbbbbg\\\",\\n      \\\"type\\\": \\\"country\\\"\\n    },\\n    {\\n      \\\"id\\\": \\\"BBBBBBBB\\\",\\n      \\\"name\\\": \\\"State1\\\",\\n      \\\"parent_location_id\\\": \\\"AAAAAAAAAA\\\",\\n      \\\"type\\\": \\\"state\\\"\\n    },\\n    {\\n      \\\"id\\\": \\\"ccccddddd,\\n      \\\"name\\\": \\\"City1\\\",\\n      \\\"parent_location_id\\\": \\\"BBBBBBBB\\\",\\n      \\\"type\\\": \\\"city\\\"\\n    },\\n    {\\n      \\\"id\\\": \\\"fgaajfjfhgjgjgjg\\\",\\n      \\\"name\\\": \\\"Campus1\\\",\\n      \\\"parent_location_id\\\": \\\"ccccddddd,\\n      \\\"type\\\": \\\"campus\\\"\\n    },\\n    {\\n      \\\"id\\\": \\\"YQGK12344\\\",\\n      \\\"name\\\": \\\"Building1\\\",\\n      \\\"parent_location_id\\\": \\\"fgaajfjfhgjgjgjg\\\",\\n      \\\"type\\\": \\\"building\\\"\\n    },\\n    {\\n      \\\"id\\\": \\\"uUbbbbbbbb\\\",\\n      \\\"name\\\": \\\"Floor1\\\",\\n      \\\"parent_location_id\\\": \\\"YQGK12344\\\",\\n      \\\"type\\\": \\\"floor\\\"\\n    }\\n  ]\\n}\""
    },
    {
      "name": "**HTTP Status Code:** `400` **Bad Request**<br>\n\n**Error Code:** `200`<br>\nZoom Room subscription not found. Try again after purchasing a Zoom Room subscription.<br>\n**Error Code:** `300`<br>\nLocation type not exist.<br>\n",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/rooms/locations?parent_location_id=quis officia in reprehenderit&type=quis officia in reprehenderit&page_size=30&next_page_token=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            "locations"
          ],
          "query": [
            {
              "key": "parent_location_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "type",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            }
          ]
        }
      },
      "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>\n\n**Error Code:** `4801`<br>\n Location not found:{parent_location_id}.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/rooms/locations?parent_location_id=quis officia in reprehenderit&type=quis officia in reprehenderit&page_size=30&next_page_token=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            "locations"
          ],
          "query": [
            {
              "key": "parent_location_id",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "type",
              "value": "quis officia in reprehenderit"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}