Chilkat Online Tools

C / Zoom API / List Zoom Room locations

Back to Collection Items

#include <C_CkHttp.h>
#include <C_CkJsonObject.h>
#include <C_CkHttpResponse.h>
#include <C_CkStringBuilder.h>

void ChilkatSample(void)
    {
    HCkHttp http;
    BOOL success;
    HCkJsonObject queryParams;
    HCkHttpResponse resp;
    HCkStringBuilder sbResponseBody;
    HCkJsonObject jResp;
    int respStatusCode;

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

    http = CkHttp_Create();

    queryParams = CkJsonObject_Create();
    CkJsonObject_UpdateString(queryParams,"parent_location_id","quis officia in reprehenderit");
    CkJsonObject_UpdateString(queryParams,"type","quis officia in reprehenderit");
    CkJsonObject_UpdateInt(queryParams,"page_size",30);
    CkJsonObject_UpdateString(queryParams,"next_page_token","quis officia in reprehenderit");

    // Adds the "Authorization: Bearer <access_token>" header.
    CkHttp_putAuthToken(http,"<access_token>");

    resp = CkHttp_QuickRequestParams(http,"GET","https://api.zoom.us/v2/rooms/locations",queryParams);
    if (CkHttp_getLastMethodSuccess(http) == FALSE) {
        printf("%s\n",CkHttp_lastErrorText(http));
        CkHttp_Dispose(http);
        CkJsonObject_Dispose(queryParams);
        return;
    }

    sbResponseBody = CkStringBuilder_Create();
    CkHttpResponse_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObject_Create();
    CkJsonObject_LoadSb(jResp,sbResponseBody);
    CkJsonObject_putEmitCompact(jResp,FALSE);

    printf("Response Body:\n");
    printf("%s\n",CkJsonObject_emit(jResp));

    respStatusCode = CkHttpResponse_getStatusCode(resp);
    printf("Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        printf("Response Header:\n");
        printf("%s\n",CkHttpResponse_header(resp));
        printf("Failed.\n");
        CkHttpResponse_Dispose(resp);
        CkHttp_Dispose(http);
        CkJsonObject_Dispose(queryParams);
        CkStringBuilder_Dispose(sbResponseBody);
        CkJsonObject_Dispose(jResp);
        return;
    }

    CkHttpResponse_Dispose(resp);


    CkHttp_Dispose(http);
    CkJsonObject_Dispose(queryParams);
    CkStringBuilder_Dispose(sbResponseBody);
    CkJsonObject_Dispose(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": ""
    }
  ]
}