To send proactive notifications to the configured channel in bot.
To use this API, the app needs the Bot Builder API scope of Proactive Messages OR the Admin API Scope of Proactive Messages and respective channel should be configured and published with proactive notifications option enabled in the bot.
POST https://{{host}}/api/public/bot/{{BotID}}/notify
.
Path Parameters
Parameter | Required/Optional | Description |
---|---|---|
host | Required | Environment URL, for example, https://bots.kore.ai |
BotId | Required |
Bot ID or Stream ID. You can access it from the General Settings page of the bot. Note: This is required only for Bot Builder API scope of Proactive Messages. |
Body Parameters
Parameter | Required/Optional | Description |
---|---|---|
channel | Required |
Name of the channel for which notifications to be sent Accepted channel types are:“msteams” and “slack“. |
userIdentityType | Required |
Define whether to resolve the user identities provided in the API call to get the channel identities, or to directly use the user identities for delivering the messages The values is resolve. |
message | Required |
It is an object and accepts two fields
Example 1:Text: Example 2: Script:
|
identities | Required |
It accepts the list of user identities for whom notifications need to be sent. A maximum of 1000 identities are supported. |
Authorization
Invoke the API with JWT in the header with the following syntax:
auth: {{JWT}}
Response Content Type
application/json
Sample Request
curl --location --request POST \' https://{{host}}/api/public/bot/{{BotID}}/notify' \ --header 'auth: {{JWT}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "channel": "msteams", "userIdentityType": "resolve", "message": { "type": "text", "val": "hello" }, "identities": [ "john@kore.com", "jane@outlook.com", "sam@slack.com" ] }'
Sample Response
{ "status": "IN_PROGRESS", "percentageComplete": 0, "streamId": "st-xxxxx-xxx-xxx-xxx-xxxxx", "createdBy": "u-xxxxx-xxx-xxx-xxx-xxxxx", "jobType": "PROACTIVE_NOTIFICATIONS_API", "action": "PROACTIVE_NOTIFICATIONS", "statusLogs": [], "_id": "ds-xxxxx-xxx-xxx-xxx-xxxxx", "lMod": "2022-01-25T06:56:48.000Z", "createdOn": "2022-01-25T06:56:48.891Z", "requestedTime": "2022-01-25T06:56:48.891Z", "__v": 0 }