Skip to content

Upload File API

To upload the botdefinition, botconfig, and botfunction files (if any) and the bot icon to the local server. Additionally, the API fetches the file ID to be used in Import Bot API.

Note

You need to upload the files separately. You can upload a file by signing with any app created by the account administrator.

Method POST
Endpoint https://{{host}}/api/public/uploadfile
Content Type application/json
Authorization auth: {{JWT}}

See How to generate the JWT Token.

API Scope
  • Bot Builder: Not Applicable
  • Admin Console: Not Applicable

Query Parameters

PARAMETER DESCRIPTION MANDATE
host The environment URL. For example, https://bots.kore.ai Required

Sample Request

curl -X POST 'https://{{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

Body Parameters

The following parameters are Required and passed based on the file id.

For Bot Definition File ID

PARAMETER DESCRIPTION
file Upload the Botdefinition.json file.
fileContext bulkImport
fileExtension .json

For Bot Config File ID

PARAMETER DESCRIPTION
file Upload the Botconfig.json file.
fileContext bulkImport
fileExtension .json

For Bot Function File ID

PARAMETER DESCRIPTION
file Upload the Bot function file.
fileContext bulkImport
fileExtension .js

For Bot icon File ID

PARAMETER DESCRIPTION
file Upload the Bot icon file.
fileContext bulkImport
fileExtension .json

For ML Utterances File ID

PARAMETER DESCRIPTION
file Upload the ML Utterance file (.json or .csv)
fileContext bulkImport
fileExtension .json or .csv