• KB Home
  • API
  • API edna Chat Center для Bot Connect
  • История сообщений

История сообщений

Бот может получить историю сообщений по threadId.

Пример curl

$ curl 'http://localhost:8080/api/v1/chatbot/messages?threadId=1' -i -X GET \
-H 'Authorization: Bearer <token>'

HTTP запрос

GET /api/v1/chatbot/messages?threadId=1 HTTP/1.1
Authorization: Bearer <token>
Host: localhost:8080

Пример успешного HTTP ответа

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 424
[
    {
        "text": "Client question",
        "sender": "CLIENT",
        "receivedDate": "2022-05-18T08:45:07.981Z"
    },
    {
        "text": "Bot response",
        "sender": "BOT",
        "receivedDate": "2022-05-18T08:45:07.981Z"
    },
    {
        "text": "Another client question",
        "sender": "CLIENT",
        "receivedDate": "2022-05-18T08:45:07.981Z"
    },
    {
        "text": "Operator response",
        "sender": "OPERATOR",
        "receivedDate": "2022-05-18T08:45:07.981Z"
    }
]