API URL: https://platform.blits.ai/api/external/messages/<YOUR_CONVERSATION_ID>/text
With this POST request a message can be send to the bot. This API only works if the bot is expecting a file. Please follow the following steps to execute the API.
Conversation ID
This is the output of the POST Conversation ID API. Please put the value between two forward slashes so that <YOUR_CONVERSATION_ID> is replaced.
Authorization
To set this up, the above API URL is need together with the authorization header. The header should have the following format:
Bearer <key>
The key can be obtained from the API settings on the settings page of your bot under the JSON Web Token:
Body
The attachment in a format that is accepted by the 'Receive Attachment' block in your flow.
Response
Depending on whether there is a message after the 'Receive Attachment' block, the output will look similar to the below.
Without following message:
{
"conversationToken": "0cef8139-8af8-4936-9f48-589825e492c7",
"expectUserResponse": true,
"response": [
{
"items": [],
"suggestions": []
}
]
}
With following message:
{
"conversationToken": "0cef8139-8af8-4936-9f48-589825e492c7",
"expectUserResponse": true,
"response": [
{
"items": [
{
"simpleResponse": {
"displayText": "Thank you",
"textToSpeech": "Thank you"
}
}
],
"suggestions": []
}
]
}