Skip to main content

Sending a message

Once the conversation has started, use this API to send a message to the bot.

URI​

{{base_url}}/generic/ns/{{namespace}}/bot-provider/{{bot_provider_name}}/message/sse

HTTP method​

POST

Headers​

If you have enabled the API key feature, include X-API-KEY in the header, set to the API key configured in the Asgard console. Without it the connection fails.

NameTypeDescription
X-API-KEYstringYour API key

Request parameters​

NameTypeDescription
customChannelIdstringThe chat channel's id. Use the same one as the start request. Conversation memory is per channel id.
customMessageIdstringThe message id. Set your own or leave it empty; useful for tracing and debugging, and usually an incrementing sequence.
textstringThe message to send.
actionstringAlways NONE here

Sample payload​

{
"customChannelId": "a-random-channel-id-1",
"customMessageId": "a-random-msg-id-2",
"text": "Can a microwave oven roast a pork knuckle or cook raw ingredients?",
"action": "NONE"
}

Response​

On success you receive a stream of JSON messages. For the detail of each event:

The events​

Message Template​

The message object's template field carries the render data for the frontend's standard components: