Stub

Используется для логирования входящих сообщений от бота: то есть передал ли бот сообщения от клиента в edna Chat Center. Логируются только входящие сообщения.

Пример curl

$ curl 'http: //localhost:8080/api/v1/chatbot/stub' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
    "segmentationInfo": {},
    "action": "MESSAGE",
    "clientId": "1",
    "sessionId": "1",
    "questionId": 43,
    "receivedAt": "2022-05-18T08:45:07.401Z",
    "text": "Message",
    "attachments": [
        {
            "url": "http://test...",
            "name": "testImage.png",
            "type": "image/jpeg",
            "size": 256,
            "contentType": null
        }
    ],
    "code": "SWITCH_TO_HUMAN",
    "sender": "ThreadsAPI"
}'

HTTP запрос

POST /api/v1/chatbot/stub HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
Content-Length: 399
Host: localhost: 8080
{
    "segmentationInfo": {},
    "action": "MESSAGE",
    "clientId": "1",
    "sessionId": "1",
    "questionId": 43,
    "receivedAt": "2022-05-18T08:45:07.401Z",
    "text": "Message",
    "attachments": [
        {
            "url": "http://test...",
            "name": "testImage.png",
            "type": "image/jpeg",
            "size": 256,
            "contentType": null
        }
    ],
    "code": "SWITCH_TO_HUMAN",
    "sender": "ThreadsAPI"
}

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

HTTP/1.1 200 OK