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”

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 are:

  • resolve
  • donotresolve
message Required It is an object and accepts two fields

  • type → Indicates the type of message. “text” for sending plain text and “script” for sending JavaScript templates as messages.
  • val → value of the message to be sent to user.

Example:{
"type": "text",
"val": "Hi User"
}

identities Required It accepts the list of user identities for whom notifications need to be sent.

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": "{{botId}}",
    "createdBy": "{{userId}}",
    "jobType": "PROACTIVE_NOTIFICATIONS_API",
    "action": "PROACTIVE_NOTIFICATIONS",
    "statusLogs": [],
    "_id": "{{requestId}}",
    "lMod": "2022-01-25T06:56:48.000Z",
    "createdOn": "2022-01-25T06:56:48.891Z",
    "requestedTime": "2022-01-25T06:56:48.891Z",
    "__v": 0
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed