Skip to main content

@wildix/xbees-users-client > CreateBotCommand

CreateBotCommand class

Signature:

export declare class CreateBotCommand extends CreateBotCommand_base 

Extends: CreateBotCommand_base

Example

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

import { UsersClient, CreateBotCommand } from "@wildix/xbees-users-client"; // ES Modules import
// const { UsersClient, CreateBotCommand } = require("@wildix/xbees-users-client"); // CommonJS import
const client = new UsersClient(config);
const input = { // CreateBotInput
company: "STRING_VALUE",
name: "STRING_VALUE", // required
picture: "STRING_VALUE",
searchable: true || false,
callback: { // BotCallback
endpoint: { // BotEndpoint Union: only one key present
dialogflowCx: { // BotDialogflowCxEndpoint
credentials: "DOCUMENT_VALUE", // required
agent: "STRING_VALUE", // required
location: "STRING_VALUE", // required
language: "STRING_VALUE", // required
},
openAiAssistant: { // BotOpenAiAssistantEndpoint
key: "STRING_VALUE", // required
assistantId: "STRING_VALUE", // required
},
webhook: { // BotWebhookEndpoint
url: "STRING_VALUE", // required
secret: "STRING_VALUE", // required
},
sqs: { // BotSqsEndpoint
url: "STRING_VALUE", // required
key: "STRING_VALUE", // required
secret: "STRING_VALUE", // required
},
},
},
};
const command = new CreateBotCommand(input);
const response = await client.send(command);
// { // CreateBotOutput
// bot: { // Bot
// id: "STRING_VALUE", // required
// name: "STRING_VALUE", // required
// picture: "STRING_VALUE",
// searchable: true || false,
// createdAt: "STRING_VALUE", // required
// updated: "STRING_VALUE",
// },
// };