Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
49 lines (39 loc) · 1.95 KB

set-channel-custom-fields.md

File metadata and controls

49 lines (39 loc) · 1.95 KB

Set Channel Custom Fields

Sets the custom fields for the channel.

HTTP MethodURLRequires Auth
POST/api/v1/channels.setCustomFieldsyes

Body Parameters

KeyExample ValueDescription
roomId* or roomName*ew28FnZqipDR or GENERALThe channel ID or the channel name. You must enter at least one of the parameters.
customFields*{"organization": "tra-la-la"}The custom fields to set for the channel.

Example Call

curl -H "X-Auth-Token: 8h2mKAwxB3AQrFSjLVKMooJyjdCFaA7W45sWlHP8IzO" \
     -H "X-User-Id: ew28FnZqipDpvKw3R" \
     -H "Content-type: application/json" \
     https://localhost:3000/api/v1/channels.setCustomFields \
     -d '{
          "roomId": "GENERAL", 
          "customFields":{"organization": "tra-la-la"} }'

Example Response

{
  "channel":{
    "_id":"GENERAL",
    "ts":"2018-02-18T19:41:02.875Z",
    "t":"c",
    "name":"general",
    "msgs":236,
    "default":true,
    "_updatedAt":"2018-02-23T11:09:05.973Z",
    "lm":"2018-02-18T22:18:20.288Z",
    "customFields":{
      "organization":"tra-la-la"
    }
  },
  "success":true,
  "developerWarning":"[WARNING]: The \"usernames\" field has been removed for performance reasons. Please use the \"*.members\" endpoint to get a list of members/users in a room."
}

Change Log

Version Description
0.62.0 Added