@wildix/xbees-conversations-client > CreateKiteChannelCommand
CreateKiteChannelCommand class
Creates a new kite channel with specified widget or email.
Signature:
export declare class CreateKiteChannelCommand extends CreateKiteChannelCommand_base
Extends: CreateKiteChannelCommand_base
Example
Use a bare-bones client and the command you need to make an API call.
import { ConversationsClient, CreateKiteChannelCommand } from "@wildix/xbees-conversations-client"; // ES Modules import
// const { ConversationsClient, CreateKiteChannelCommand } = require("@wildix/xbees-conversations-client"); // CommonJS import
const client = new ConversationsClient(config);
const input = { // CreateKiteChannelInput
userId: "STRING_VALUE",
channelId: "STRING_VALUE",
targetId: "STRING_VALUE", // required
targetRouteId: "STRING_VALUE",
welcomeMessages: [ // WelcomeMessagesList
{ // WelcomeMessage
text: "STRING_VALUE",
elements: [ // ElementsList
{ // Element Union: only one key present
actions: [ // ActionsElementsList
{ // ActionElement Union: only one key present
button: { // ButtonElement
text: "STRING_VALUE", // required
handler: { // ButtonHandler Union: only one key present
link: { // ButtonLinkHandler
url: "STRING_VALUE", // required
},
reply: { // ButtonReplyHandler
text: "STRING_VALUE",
},
action: { // ButtonActionHandler
id: "STRING_VALUE", // required
},
},
variant: "contained" || "outlined",
disabled: true || false,
},
},
],
},
],
attachments: [ // MessageAttachmentList
{ // MessageAttachment
id: "STRING_VALUE", // required
fsId: "STRING_VALUE", // required
mime: "STRING_VALUE",
name: "STRING_VALUE", // required
size: Number("int"), // required
width: Number("int"),
height: Number("int"),
thumbnail: "STRING_VALUE",
},
],
quote: { // MessageQuote
messageId: "STRING_VALUE", // required
channelId: "STRING_VALUE", // 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",
},
text: "STRING_VALUE",
attachments: [
{
id: "STRING_VALUE", // required
fsId: "STRING_VALUE", // required
mime: "STRING_VALUE",
name: "STRING_VALUE", // required
size: Number("int"), // required
width: Number("int"),
height: Number("int"),
thumbnail: "STRING_VALUE",
},
],
forward: { // MessageForward
forwardCompany: "STRING_VALUE",
forwardDate: "STRING_VALUE", // required
forwardEmail: "STRING_VALUE",
forwardName: "STRING_VALUE",
messageId: "STRING_VALUE", // required
channelId: "STRING_VALUE", // required
},
mentions: [ // UsersList
{
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",
},
],
giphy: { // MessageGiphy
id: "STRING_VALUE", // required
size: "STRING_VALUE", // required
url: "STRING_VALUE", // required
height: "STRING_VALUE", // required
width: "STRING_VALUE", // required
},
createdAt: "STRING_VALUE", // required
updatedAt: "STRING_VALUE",
},
forward: {
forwardCompany: "STRING_VALUE",
forwardDate: "STRING_VALUE", // required
forwardEmail: "STRING_VALUE",
forwardName: "STRING_VALUE",
messageId: "STRING_VALUE", // required
channelId: "STRING_VALUE", // required
},
messageId: "STRING_VALUE", // required
mentions: [ // UsersIdList
"STRING_VALUE",
],
user: "<User>", // required
},
],
initialMessage: { // InitialMessage
text: "STRING_VALUE",
elements: [
{// Union: only one key present
actions: [
{// Union: only one key present
button: {
text: "STRING_VALUE", // required
handler: {// Union: only one key present
link: {
url: "STRING_VALUE", // required
},
reply: {
text: "STRING_VALUE",
},
action: {
id: "STRING_VALUE", // required
},
},
variant: "contained" || "outlined",
disabled: true || false,
},
},
],
},
],
attachments: "<MessageAttachmentList>",
quote: {
messageId: "STRING_VALUE", // required
channelId: "STRING_VALUE", // required
user: "<User>", // required
text: "STRING_VALUE",
attachments: "<MessageAttachmentList>",
forward: {
forwardCompany: "STRING_VALUE",
forwardDate: "STRING_VALUE", // required
forwardEmail: "STRING_VALUE",
forwardName: "STRING_VALUE",
messageId: "STRING_VALUE", // required
channelId: "STRING_VALUE", // required
},
mentions: [
"<User>",
],
giphy: {
id: "STRING_VALUE", // required
size: "STRING_VALUE", // required
url: "STRING_VALUE", // required
height: "STRING_VALUE", // required
width: "STRING_VALUE", // required
},
createdAt: "STRING_VALUE", // required
updatedAt: "STRING_VALUE",
},
forward: "<MessageForward>",
messageId: "STRING_VALUE", // required
mentions: [
"STRING_VALUE",
],
},
};
const command = new CreateKiteChannelCommand(input);
const response = await client.send(command);
// { // CreateKiteChannelOutput
// channel: { // Channel
// subject: "STRING_VALUE",
// description: "STRING_VALUE",
// picture: "STRING_VALUE",
// pictureColor: "STRING_VALUE",
// access: "private" || "public",
// company: "STRING_VALUE",
// context: { // ChannelContext
// source: "kite",
// target: "STRING_VALUE",
// events: [ // ChannelContextEventList
// { // ChannelContextEvent
// id: "STRING_VALUE",
// owner: "STRING_VALUE",
// start: "STRING_VALUE",
// end: "STRING_VALUE",
// summary: "STRING_VALUE",
// attendees: [ // ChannelContextEventAttendeeList
// { // ChannelContextEventAttendee
// email: "STRING_VALUE", // required
// name: "STRING_VALUE",
// status: "accepted" || "tentative" || "declined" || "none", // required
// },
// ],
// },
// ],
// },
// kite: true || false,
// kiteTarget: "STRING_VALUE",
// kiteVariant: "STRING_VALUE",
// kiteAssign: "STRING_VALUE",
// kiteServiceName: "STRING_VALUE",
// kiteDefaultSubject: "STRING_VALUE",
// service: "STRING_VALUE",
// serviceTitle: "STRING_VALUE",
// serviceRecipient: "STRING_VALUE",
// assignee: { // 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",
// },
// telephony: true || false,
// sms: true || false,
// mms: true || false,
// whatsapp: true || false,
// whatsappStatus: "24h_channel_closed",
// broadcast: true || false,
// external: true || false,
// channelId: "STRING_VALUE", // required
// channelType: "direct" || "group", // required
// memberCount: Number("int"), // required
// createdAt: "STRING_VALUE", // required
// createdBy: "STRING_VALUE", // required
// updatedAt: "STRING_VALUE",
// },
// };