Chilkat Online Tools

TCL / Zoom API / Get a channel

Back to Collection Items

load ./chilkat.dll

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

set http [new_CkHttp]

# Adds the "Authorization: Bearer <access_token>" header.
CkHttp_put_AuthToken $http "<access_token>"

set sbResponseBody [new_CkStringBuilder]

set success [CkHttp_QuickGetSb $http "https://api.zoom.us/v2/chat/channels/:channelId" $sbResponseBody]
if {$success == 0} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttp $http
    delete_CkStringBuilder $sbResponseBody
    exit
}

set jResp [new_CkJsonObject]

CkJsonObject_LoadSb $jResp $sbResponseBody
CkJsonObject_put_EmitCompact $jResp 0

puts "Response Body:"
puts [CkJsonObject_emit $jResp]

set respStatusCode [CkHttp_get_LastStatus $http]
puts "Response Status Code = $respStatusCode"
if {$respStatusCode >= 400} then {
    puts "Response Header:"
    puts [CkHttp_lastHeader $http]
    puts "Failed."
    delete_CkHttp $http
    delete_CkStringBuilder $sbResponseBody
    delete_CkJsonObject $jResp
    exit
}

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

# {
#   "id": "cabc1234567defghijkl01234",
#   "jid": "cabc1234567defghijkl01234@conference.xmpp.zoom.us",
#   "name": "common2",
#   "type": 5,
#   "channel_settings": {
#     "new_members_can_see_previous_messages_files": true,
#     "allow_to_add_external_users": 1,
#     "posting_permissions": 1
#   }
# }

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

set id [CkJsonObject_stringOf $jResp "id"]
set jid [CkJsonObject_stringOf $jResp "jid"]
set name [CkJsonObject_stringOf $jResp "name"]
set v_type [CkJsonObject_IntOf $jResp "type"]
set New_members_can_see_previous_messages_files [CkJsonObject_BoolOf $jResp "channel_settings.new_members_can_see_previous_messages_files"]
set Allow_to_add_external_users [CkJsonObject_IntOf $jResp "channel_settings.allow_to_add_external_users"]
set Posting_permissions [CkJsonObject_IntOf $jResp "channel_settings.posting_permissions"]

delete_CkHttp $http
delete_CkStringBuilder $sbResponseBody
delete_CkJsonObject $jResp

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/chat/channels/:channelId

Postman Collection Item JSON

{
  "name": "Get a channel",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/chat/channels/:channelId",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "chat",
        "channels",
        ":channelId"
      ],
      "variable": [
        {
          "key": "channelId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) Channel ID: Unique Identifier of a channel."
        }
      ]
    },
    "description": "Zoom chat [channels](https://support.zoom.us/hc/en-us/articles/200912909-Getting-Started-With-Channels-Group-Messaging-) allow users to communicate via chat in private or public groups. Use this API to get information about a specific channel. \n\n**Scope:** `chat_channel:read`\t<br>\n**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`\n\n<p style=\"background-color:#e1f5fe; color:#000000; padding:8px\"> <b>Note: </b> This API supports only <b>user-managed</b> <a href=\"https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app\">OAuth apps</a>. If you use an Account-Level OAuth Access token, you can only retrieve the channel information for the authorized user. You can't retrieve the channel information of other account users. Use the <a href=\"https://marketplace.zoom.us/docs/api-reference/zoom-api/chat-channels-account-level/getchannel\">Account-Level Get Channel Info API</a> to retrieve the channel information of other account users.</p><br>\n\n\n "
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nChannel returned.<br>\n\n\n\n",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/chat/channels/:channelId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "chat",
            "channels",
            ":channelId"
          ],
          "variable": [
            {
              "key": "channelId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Channel ID: Unique Identifier of a channel."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"id\": \"cabc1234567defghijkl01234\",\n \"jid\": \"cabc1234567defghijkl01234@conference.xmpp.zoom.us\",\n \"name\": \"common2\",\n \"type\": 5,\n \"channel_settings\": {\n  \"new_members_can_see_previous_messages_files\": true,\n  \"allow_to_add_external_users\": 1,\n  \"posting_permissions\": 1\n }\n}"
    },
    {
      "name": "**HTTP Status Code:** `400`<br>\nBad Request<br>\n**Error Code:** `200`<br>\nUnauthorized request. You do not have permission to access this user's channel information.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/chat/channels/:channelId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "chat",
            "channels",
            ":channelId"
          ],
          "variable": [
            {
              "key": "channelId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Channel ID: Unique Identifier of a channel."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**Status Code:** `404`<br>\nNot found.<br>\n**Error Code:** `4130`<br>\nChannel does not exist: $channelId.",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/chat/channels/:channelId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "chat",
            "channels",
            ":channelId"
          ],
          "variable": [
            {
              "key": "channelId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Channel ID: Unique Identifier of a channel."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}