Upload File API¶
To upload the botdefinition, botconfig, and botfunction files (if any) and the bot icon to the local server. You can also use this API to upload files for ingestion using Search AI. The API returns the file ID in response which is required in Import Bot API or Ingest Data API for further actions on the file.
Note
To upload botdefinition, botconfig, and botfunction files, 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 | multipart/form-data
|
Authorization | auth: {{JWT}}
|
API Scope |
|
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 |
For Data Ingestion in Search AI
PARAMETER | DESCRIPTION |
file | Upload the file to be ingested into the Search AI application |
fileContext | findly |
fileExtension | pdf, docx, txt, pptx |