Klat
  • TalkPlus SDK
  • Android
    • Getting Started
    • Callback
    • User
      • Create User / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete User
    • Channel
      • Create / Delete Channel
      • View Channel
      • Updating Channel
      • Viewing Channel LIst
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification
    • Sample Application
    • What's New
  • iOS
    • Getting Started
    • Callback
    • User
      • Create / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete User
    • Channel
      • Create / Delete Channel
      • View Channel
      • Updating Channel
      • View Channel List
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification
    • Sample Application
    • What's New
  • Unity
    • Getting Started
    • Callback
    • User
      • Create User / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete User
    • Channel
      • Create / Delete Channel
      • View Channel
      • Updating Channel
      • View Channel List
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification
    • Sample Application
  • JavaScript
    • Getting Started
    • Realtime Event
    • Pagination
    • User
      • Create User / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete
    • Channel
      • Create / Delete Channel
      • View Channel
      • Updating Channel
      • View Channel List
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification (FCM)
    • Sample Application
    • What's New
  • Flutter
    • Getting Started
    • Callback
    • User
      • Create User / Login
      • Update User Information
      • Block / Unblock
      • Logout
      • Delete User
    • Channel
      • Create Channel
      • View Channel
      • Updating Channel
      • View Channel List
      • Manage Channel Members
      • Join / Leave Channel
      • Messaging
      • Hide / Show Channel
      • Freeze / Unfreeze Channel
      • Transfer Channel Ownership
      • Channel Push Notification Settings
      • Channel Member Data
    • Push Notification (FCM)
  • REST API
    • Getting Started
    • API
      • Users
        • Create User
        • Login (using login token)
        • View User
        • Update User
        • Activate / Deactivate
        • Enable / Disable Push Notification
        • Delete User
        • View Users
        • View Channels
        • Block / Unblock
      • Channel
        • Create Channel
        • View Channel
        • Update Channel
        • Delete Channel
        • View Channel List
        • Manage Channel Members
        • Messaging
        • Hide / Show Channel
        • Channel Freeze / Unfreeze
        • Transfer Channel Ownership
        • Channel Push Notification Settings
      • Bot
        • Create Bot
        • View Bot List
        • View Bot
        • Update Bot
        • Delete Bot
        • View Joined Channel List
        • Messaging
        • Join / Leave Channel
    • Push Notification
    • Rate Limit
  • MISC
    • Webhooks
    • SDK Rate Limit
    • Error Code
    • FAQ
      • Function
      • Spec
Powered by GitBook
On this page
  1. JavaScript
  2. Channel

Updating Channel

Only the channel owner can update channel.

You can enter up to 5 key-value pairs in data field. The maximum size of key is 128 characters and the maximum size of value is 1024 characters. Both key and value must be strings.

await client.updateChannel({
      channelId: 'my_channel', // required
      name: 'my_channel', // optional 
      imageUrl : 'image URL', // optional
      maxMemberCount: 10, // optional. default 100
      hideMessagesBeforeJoin: true,
      category: 'category 1', // optional. can be used for grouping/searching channels
      subcategory: 'subcategory 2', // optional. can be used for grouping/searching channels
      data: { // optional
        someMetaKey1: "someMetaValue1",
        someMetaKey2: "someMetaValue2",
      },
    });
    
// when updating invitationOnly channel
await client.updateChannel({
      channelId: 'my_invitation_only_channel',
      name: 'my_invitation_only_channel',
      imageUrl : 'image URL', // optional
      maxMemberCount: 10, // optional. default 100
      hideMessagesBeforeJoin: true,
      category: 'category 1', // optional. can be used for grouping/searching channels
      subcategory: 'subcategory 2', // optional. can be used for grouping/searching channels
      invitationCode: 'secret_phrase',
      data: { // optional
        someMetaKey1: "someMetaValue1",
        someMetaKey2: "someMetaValue2",
      },
    });

Response

{
  "channel": {
    "id": "my_channel",
    "name": "my_channel",
    "imageUrl": "image url",
    "data": {
      "someMetaKey1": "someMetaValue1",
      "someMetaKey2": "someMetaValue2"
    },
    "ownerId": "user123",
    "pushNotificationDisabled": false,
    "type": "private",
    "invitationCode": "",
    "isFrozen": false,
    "memberCount": 2,
    "maxMemberCount": 10,
    "hideMessagesBeforeJoin": true,
    "category": "test",
    "subcategory": "",
    "privateTag": "",
    "privateData": "",
    "mutedUsers": [],
    "members": [
      {
        "id": "user123",
        "username": "john",
        "profileImageUrl": "http://cnd.test.com/123.jpg",
        "updatedAt": 1603244896634,
        "createdAt": 1603184094285,
        "lastReadAt": 1603244933412,
        "lastSentAt": 1603244933412
      },
      {
        "id": "another_user_id",
        "username": "another_user_id",
        "profileImageUrl": "http://cnd.test.com/another_user.jpg",
        "updatedAt": 1603244410844,
        "createdAt": 1603244410844,
        "lastReadAt": 1603244933412,
        "lastSentAt": 1603244933412
      }
    ],
    "bannedUsers": [],
    "bots": [],
    "pushNotificationDisabled": false,
    "pushNotificationSoundAOS": "",
    "pushNotificationSoundIOS": "",
    "updatedAt": 0,
    "createdAt": 0,
    "unreadCount": 0,
    "lastReadAt": 0,
    "lastMessage": null
  }
}
PreviousView ChannelNextView Channel List

Last updated 6 months ago