Skip to main content
Back to API List This API allows you to import bot functions from a specified file.
FieldValue
MethodPOST
Endpointhttps://{{host}}/api/public/bot/botId/import/botfunctions
Content Typeapplication/json
Authorizationauth: {{JWT}} See How to generate the JWT Token.
API ScopeApp Builder: Not Applicable; Admin Console: Bot Definition > Bot Import

Query Parameters

ParameterRequiredDescription
hostRequiredThe environment URL. For example, https://platform.kore.ai
botIDRequiredThe 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 App 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

ParameterRequiredDescription
fileIdRequiredThe 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.
fileNameRequiredThe 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:
{
    "errors": [
        {
            "msg": "Invalid file id",
            "code": 400
        }
    ]
}