Chilkat Online Tools

C# / Zoom API / Update a channel

Back to Collection Items

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

Chilkat.Http http = new Chilkat.Http();
bool success;

Chilkat.HttpRequest req = new Chilkat.HttpRequest();
req.HttpVerb = "PATCH";
req.Path = "/v2/chat/channels/:channelId";
req.ContentType = "multipart/form-data";
req.AddParam("est ex","");

req.AddHeader("Authorization","Bearer <access_token>");

Chilkat.HttpResponse resp = http.SynchronousRequest("api.zoom.us",443,true,req);
if (http.LastMethodSuccess == false) {
    Debug.WriteLine(http.LastErrorText);
    return;
}

Chilkat.StringBuilder sbResponseBody = new Chilkat.StringBuilder();
resp.GetBodySb(sbResponseBody);

Chilkat.JsonObject jResp = new Chilkat.JsonObject();
jResp.LoadSb(sbResponseBody);
jResp.EmitCompact = false;

Debug.WriteLine("Response Body:");
Debug.WriteLine(jResp.Emit());

int respStatusCode = resp.StatusCode;
Debug.WriteLine("Response Status Code = " + Convert.ToString(respStatusCode));
if (respStatusCode >= 400) {
    Debug.WriteLine("Response Header:");
    Debug.WriteLine(resp.Header);
    Debug.WriteLine("Failed.");

    return;
}

Curl Command

curl -X PATCH
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'name=est ex'
https://api.zoom.us/v2/chat/channels/:channelId

Postman Collection Item JSON

{
  "name": "Update a channel",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "PATCH",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "name",
          "value": "est ex",
          "description": "(Required) A new name for the channel.",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/chat/channels/:channelId",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "chat",
        "channels",
        ":channelId"
      ],
      "variable": [
        {
          "key": "channelId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) Channel Id."
        }
      ]
    },
    "description": "Zoom chat channels allow users to communicate via chat in private or public channels. Use this API to update the name of a specific channel that you created. \n\n**Scope:** `chat_channel:write`\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:#01579b; padding:8px\"> <b>Note: </b> This API only supports <b>user-managed</b> <a href=\"https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app\">OAuth app</a>.</p><br>\n\n"
  },
  "response": [
    {
      "name": "**Status Code:** `204`\nChannel updated.",
      "originalRequest": {
        "method": "PATCH",
        "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."
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{}"
    },
    {
      "name": "**Status Code:** `400`<br>\nBad request<br>\n**Error Code:** `200`<br>\nUnauthorized request. You do not have permission to update a channel for this user.<br>\n**Error Code:** `5301`<br>\nRequest to update a channel failed.",
      "originalRequest": {
        "method": "PATCH",
        "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."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}