Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
45 lines (37 loc) · 1.61 KB

File metadata and controls

45 lines (37 loc) · 1.61 KB

Send Array of Messages

Send an array of messages to a visitor.

HTTP MethodURLRequires Auth
POST/api/v1/livechat/messagesyes

Body

KeyExample ValueDescription
visitor*"visitor": { "token": "54fc5544030bcecda0e9"}The vistor token.
messages*"messages": [{"msg": "test" }, { "msg": "hello"} ]The array of messages.

Example Call

{% code overflow="wrap" %}

curl --location 'http://localhost:3000/api/v1/livechat/messages' \
--header 'X-Auth-Token: Y97tM4GkYjgaH_fIO5dwBitQQvm3yp-AptYzGQZMX6e' \
--header 'X-User-Id: CkCPNcvsvCDfmWLqC' \
--header 'Content-Type: application/json' \
--data '{
    "visitor": {"token": "54fc5544030bcecda053311cb6b98920b"},
    "messages": [{"msg": "test" },
                { "msg": "hello"} ]
}'

{% endcode %}

Example Response

{
    "messages": [
        {
            "username": "guest-35",
            "msg": "test",
            "ts": "2023-10-31T08:41:29.724Z"
        },
        {
            "username": "guest-35",
            "msg": "hello",
            "ts": "2023-10-31T08:41:29.725Z"
        }
    ],
    "success": true
}