Skip to content

Import Bot Functions API

This API allows you to import bot functions from a specified file.

Method POST
Endpoint https://{{host}}/api/public/bot/botId/import/botfunctions
Content Type application/json
Authorization auth: {{JWT}}

See How to generate the JWT Token.

API Scope
  • Bot Builder: Not Applicable
  • Admin Console: Bot Definition > Bot Import

Query Parameters

PARAMETER REQUIRED DESCRIPTION
host Required The environment URL. For example, https://bots.kore.ai
botID Required The Bot ID or Stream ID of the bot into which you want to import the functions. You can get it under General Settings on the Bot Builder.

Sample Request

curl -X POST \
'https://{{host}}/api/public/bot/botId/import/botfunctions' \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--header 'content-type: application/json' \
--data '[{"fileName":"BotFunctions.js","fileId":"6565d8fea4fa7f2827b225f3"}]'

Body Parameters

PARAMETER REQUIRED DESCRIPTION
fileId Required The unique identifier (ID) of the file to be imported. This ID can be retrieved from the response of the Upload File API after uploading the Bot Functions file.
fileName Required The name of the file containing the bot functions to import.

Sample Response

Success

{
    "requestType": "BotImport",
    "status": "Success",
    "createdOn": "2023-11-28T12:14:59.215Z",
    "_id": "6565d9c378438bc41a6cfxxx",
    "createdBy": "u-37bc3853-76fd-5a25-b307-1af2e8f1bxxx",
    "__v": 0,
    "fileId": "6565d8fea4fa7f2827b225f3",
    "fileName": "BotFunctions.js"
}
Failure

```json { "errors": [ { "msg": "Invalid file id", "code": 400 } ] }