1. Home
  2. Kore.ai Conversational Platform
  3. SDKs & APIs
  4. Using Kore.ai APIs
  5. Import Bot as a New Bot API
  6. Bot Import – Upload File API

Bot Import – Upload File API

Used to Upload the botdefinition, botconfig, and botfunction file (if any)  as well as the bot icon to the local server and get the file ID. You need to upload the files separately.

POST  https://{{host}}/api/public/uploadfile

Query Parameters

Parameter Description
host Environment URL, for example, https://bots.kore.ai

Body Parameters – To get the Bot Definition File ID

Parameter Description
file Upload the Botdefinition.json
fileContext bulkImport
fileExtension json

Body Parameters – To get the Bot Config File ID

Parameter Description
file Upload the Botconfig.json
fileContext bulkImport
fileExtension json

Body Parameters – To get the Bot Function File ID

Parameter Description
file Upload the Bot function file
fileContext bulkImport
fileExtension js

Body Parameters – To get the Bot icon File ID

Parameter Description
file Upload the Bot icon
fileContext bulkImport
fileExtension json

Body Parameters – To get the ML Utterances File ID

Parameter Description
file Upload the ML Utterance file (.json or CSV)
fileContext bulkImport
fileExtension .json or .csv

Authorization

Invoke the API with JWT in the header with the following syntax:

auth: {JWT}

Response content type

application/json

Sample Request

curl -X POST \
  http://{{host}}/api/public/uploadfile \
  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \
  -H 'content-type: multipart/form-data' \
  -F file=@botDefinition.json \
  -F fileContext=bulkImport \
  -F fileExtension=json

Sample Response

{
    "fileId": "5c077d28d28e06c112681656",
    "hash": "c275df72765efb7de332e7d54300cb12de66b78e"
}


Was this article helpful to you? Yes No