Chilkat Online Tools

DataFlex / Zoom API / List Zoom Room locations

Back to Collection Items

Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vQueryParams
    Handle hoQueryParams
    Variant vResp
    Handle hoResp
    Variant vSbResponseBody
    Handle hoSbResponseBody
    Handle hoJResp
    Integer iRespStatusCode
    String sTemp1
    Boolean bTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
    If (Not(IsComObjectCreated(hoQueryParams))) Begin
        Send CreateComObject of hoQueryParams
    End
    Get ComUpdateString Of hoQueryParams "parent_location_id" "quis officia in reprehenderit" To iSuccess
    Get ComUpdateString Of hoQueryParams "type" "quis officia in reprehenderit" To iSuccess
    Get ComUpdateInt Of hoQueryParams "page_size" 30 To iSuccess
    Get ComUpdateString Of hoQueryParams "next_page_token" "quis officia in reprehenderit" To iSuccess

    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"

    Get pvComObject of hoQueryParams to vQueryParams
    Get ComQuickRequestParams Of hoHttp "GET" "https://api.zoom.us/v2/rooms/locations" vQueryParams To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComGetBodySb Of hoResp vSbResponseBody To iSuccess

    Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
    If (Not(IsComObjectCreated(hoJResp))) Begin
        Send CreateComObject of hoJResp
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
    Set ComEmitCompact Of hoJResp To False

    Showln "Response Body:"
    Get ComEmit Of hoJResp To sTemp1
    Showln sTemp1

    Get ComStatusCode Of hoResp To iRespStatusCode
    Showln "Response Status Code = " iRespStatusCode
    If (iRespStatusCode >= 400) Begin
        Showln "Response Header:"
        Get ComHeader Of hoResp To sTemp1
        Showln sTemp1
        Showln "Failed."
        Send Destroy of hoResp
        Procedure_Return
    End

    Send Destroy of hoResp


End_Procedure

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