@wildix/xbees-conversations-client > AddChannelMemberCommand
AddChannelMemberCommand class
Adds a single member to an existing channel. This operation will either add an existing user or invite a new user to the channel. This operation is idempotent, meaning that if the member already exists, the operation will still return a successful response.
Signature:
export declare class AddChannelMemberCommand extends AddChannelMemberCommand_base
Extends: AddChannelMemberCommand_base
Example
Use a bare-bones client and the command you need to make an API call.
import { ConversationsClient, AddChannelMemberCommand } from "@wildix/xbees-conversations-client"; // ES Modules import
// const { ConversationsClient, AddChannelMemberCommand } = require("@wildix/xbees-conversations-client"); // CommonJS import
const client = new ConversationsClient(config);
const input = { // AddChannelMemberInput
channelId: "STRING_VALUE", // required
userId: "STRING_VALUE",
silent: true || false,
memberId: "STRING_VALUE",
memberToInvite: { // UserToInvite
email: "STRING_VALUE",
phone: "STRING_VALUE",
name: "STRING_VALUE",
colleague: true || false,
},
};
const command = new AddChannelMemberCommand(input);
const response = await client.send(command);
// { // AddChannelMemberOutput
// member: { // ChannelMember
// id: "STRING_VALUE", // required
// createdAt: "STRING_VALUE", // required
// role: "member" || "supervisor", // required
// },
// user: { // 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",
// },
// };