Update Channel

Update Channel

PUT https://api.talkplus.io/v1.4/api/channels/:channelId

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.

Path Parameters

NameTypeDescription

channelId*

string

Headers

NameTypeDescription

content-type

string

application/json

app-id*

string

App ID

api-key*

string

App API key

Request Body

NameTypeDescription

name

string

channel name

ownerId

string

channel owner

invitationCode

string

Required if channel type is 'invitationOnly'

imageUrl

string

channel image URL

data

object

key-value data

maxMemberCount

number

maximum number of members allowed. - super channel: default: -1 (unlimited), min: 1, max: 100. - the rest: default: 100, min: 1, max: 100

hideMessagesBeforeJoin

boolean

whether to hide from new member messages that were sent before new member joining

category

string

used as filter during search. max length: 32 characters

subcategory

string

extra filter used along with category. max length: 32 characters

{
  "channel": {
    "id": "channel123",
    "name": "MyFirstChannel",
    "ownerId": "user123",
    "type": "private",
    "imageUrl": "image url",
    "invitationCode": "",
    "isFrozen": false,
    "hideMessagesBeforeJoin": false,
    "category": "", 
    "subcategory": "",
    "privateTag": "",
    "privateData": "",
    "memberCount": 2,
    "maxMemberCount": 100,
    "data": {
      "someMetaKey1": "someMetaValue1",
      "someMetaKey2": "someMetaValue2"
    },
    "members": [
      {
        "id": "user123",
        "username": "john",
        "profileImageUrl": "http://cnd.test.com/123.jpg",
        "data": {},
        "memberInfo": {},
        "lastReadAt": 1583924400,
        "lastSentAt": 1583924400,
        "updatedAt": 1583924400,
        "createdAt": 1583921400
      },
      {
        "id": "user456",
        "username": "james",
        "profileImageUrl": "http://cnd.test.com/456.jpg",
        "data": {},
        "memberInfo": {},
        "lastReadAt": 1583924400,
        "lastSentAt": 1583924400,
        "updatedAt": 1583924400,
        "createdAt": 1583921400
      }
    ],
    "mutedUsers": [],
    "bannedUsers": [],
    "updatedAt": 1583924400,
    "createdAt": 1583921400,
    "unreadCount": 0,
    "lastReadAt": 0,
    "lastMessage": {
      "id": "sdf2l5s9j",
      "channelId": "channel123",
      "userId": "user456",
      "username": "myUsername",
      "profileImageUrl": "http://cdn.test.com/123.jpg",
      "type": "message",
      "text": "Hello world",
      "data": {
        "customField": "customData"
      },
      "parentMessage": {},
      "reactions": {"happy": 1},
      "createdAt": 1583921400
    }
  }
}

Last updated