Used to initiate enable a channel for a bot.
To use this API, app needs the Admin API Scope of Channel Management under ChannelManagement.
POST https://{{host}}/api/public/bot/channels
Query Parameters
Parameter | Required/ Optional |
Description |
---|---|---|
host | Required | Environment URL, for example, https://bots.kore.ai |
Body Parameters
Parameter | Required/ Optional |
Description |
---|---|---|
streamId | Required | Stream or Bot ID – You can access it from the General Settings page of the bot. |
appName | Required | The app associated with this Bot, you can obtain it from the Manage Apps page of the bott |
clientId | Required | The client id for the app associated with this Bot, you can obtain it from the Manage Apps page of the bott |
type | Required |
Channel that you want to enable for this Bot. Following are the channel type details:
|
Authorization
Invoke the API with JWT in the header with the following syntax:
auth: {{JWT}}
Response content type
application/json
Sample Request
Sample Request for Web/Mobile channel:
curl --location --request POST 'https://{{host}}/api/public/channels' \ --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "streamId": "st-xxxxfxxx-edxx-xxxx-xxbb-fxxxexxfxfcx", "channelDetails": { "displayName": "Web / Mobile Client", "type": "rtm", "app": { "clientId": "cs-xexxdxxx-xbbc-xxex-xxef-xxxxxxxxfxfx", "appName": "app_name" }, "enable": true }, "type": "rtm" }'
Sample Request for MS Teams channel:
curl --location --request POST 'https://{{host}}/api/public/channels' \ --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "streamId": "st-42d7cc4e-8385-5c70-9e1f-5b68f521aabd", "channelDetails": { "botName": "Banking Bot", "enable": true, "type": "msteams", "appId": "cbabcxce-acxb-xxxx-axxf-xabxxxfexxxb", "appPassword": "" }, "type": "msteams" }'
Sample Request for WebHook channel:
curl --location --request POST 'https://{{host}}/api/public/channels' \ --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "streamId": "st-cxfaxxax-xexx-xxex-axxe-xxdxexxxfxex", "channelDetails": { "app": { "clientId": "cs-dxxcxxxc-Xxxx-xxxx-axxx-xxxxcxbexeax", "appName": "Banking Bot" }, "createInstance": true, "type": "ivr", "displayName": "webhook1", "enable": true, "isAsync": false, }, "type": "ivr" }'
Sample Request for Slack channel:
curl --location --request POST 'https://{{host}}/api/public/channels' \ --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "streamId": "st-1b845445-9380-5fda-abb0-51a4423971ca", "channelDetails": { "displayName": "slack", "botName":"Banking Bot", "enable": true, "type": "slack", "accessToken": "xoxb-xxxxxxxx-xxxxxx-xa5FhuuDvOta4Bhlv7PfWZ", "clientId": "xxxxxx.xxxxxx", "clientSecret": "xxexxdxxxdxcxxbxacxxxdfxxxxxex", "verificationToken": "abcd" }, "type": "slack" }'
Sample Response
The response from the platform depends on the channel being enabled.
Sample response for web/mobile SDK:
{ "displayName": "Web / Mobile Client", "type": "rtm", "name": "Web / Mobile Client", "isAlertsEnabled": false, "enable": true, "sttEnabled": false, "sttEngine": "kore" }
Sample response for webhook channel:
{ "displayName": "webhook", "enable": true, "isAsync": false, "type": "ivr", "url": "<webhook-url>" }
Sample response for slack channel:
{ "streamUserAccountId": "su-bxxxxfax-exba-xxeb-xxxc-xxxacxxxxxx", "type": "slack", "enable": false, "verificationToken": "mxSxdWXcQxEFxrRPEdeoCC" }
Sample response for msteams channel:
{ "type": "msteams", "enable": false, "accountId": "su-bcf9xxxfc-dxxx-xxxc-xexa-bxxexxxxxxx", "app_id": "xxebcfxf-xxxd-xxca-xxea-bxxxxxxaxxx" }