Skip to main content

@wildix/xbees-conversations-client > AddChannelMembersCommand

AddChannelMembersCommand class

Adds members to an existing channel. This operation is idempotent, meaning that if a member already exists in the channel, the operation will still return a successful response.

Signature:

export declare class AddChannelMembersCommand extends AddChannelMembersCommand_base 

Extends: AddChannelMembersCommand_base

Example

Use a bare-bones client and the command you need to make an API call.

import { ConversationsClient, AddChannelMembersCommand } from "@wildix/xbees-conversations-client"; // ES Modules import
// const { ConversationsClient, AddChannelMembersCommand } = require("@wildix/xbees-conversations-client"); // CommonJS import
const client = new ConversationsClient(config);
const input = { // AddChannelMembersInput
channelId: "STRING_VALUE", // required
userId: "STRING_VALUE",
silent: true || false,
members: [ // UsersIdList
"STRING_VALUE",
],
membersToInvite: [ // UsersToInviteList
{ // UserToInvite
email: "STRING_VALUE",
phone: "STRING_VALUE",
name: "STRING_VALUE",
colleague: true || false,
},
],
};
const command = new AddChannelMembersCommand(input);
const response = await client.send(command);
// { // AddChannelMembersOutput
// members: [ // ChannelMembersList // required
// { // ChannelMember
// id: "STRING_VALUE", // required
// createdAt: "STRING_VALUE", // required
// role: "member" || "supervisor", // required
// },
// ],
// users: [ // UsersList // required
// { // User
// id: "STRING_VALUE", // required
// name: "STRING_VALUE",
// email: "STRING_VALUE",
// phone: "STRING_VALUE",
// picture: "STRING_VALUE",
// locale: "STRING_VALUE",
// timeZone: "STRING_VALUE",
// company: "STRING_VALUE",
// bot: true || false,
// pbxDomain: "STRING_VALUE",
// pbxPort: "STRING_VALUE",
// pbxExtension: "STRING_VALUE",
// pbxSerial: "STRING_VALUE",
// pbxUserId: "STRING_VALUE",
// createdAt: "STRING_VALUE",
// updatedAt: "STRING_VALUE",
// },
// ],
// };