Skip to main content

Uploading a file and sending a message

Once a file is uploaded, use this API to send it to the bot along with a message.

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
blobIdsarrayThe blobIds returned by the upload, as an array; several files can be passed

Sample payload​

{
"customChannelId": "a-random-channel-id-1",
"customMessageId": "a-random-msg-id-3",
"text": "What is in this image?",
"action": "NONE",
"blobIds": ["1939596382025289728"]
}

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: