Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Name

Type

Description

_id

Status
titleSTRING

Internal object identifier

room

Status
titleSTRING

Chat unique identifier

ctlive_type

Status
titleSTRING

Chat type according to the initiator. Can be one of the following values:

“chat”

“cbn”

“cbl”

“cbfs”

“call”

messages

Status
titlearray

Array containing chat messages. See Message Object for more details.

Message Object

...

Name

...

Type

...

Description

...

room

...

Status
titleSTRING

...

Chat unique identifier

...

data

...

Status
titleobject

...

Object containing message info. See message data object for more details.

Message Data Object

Name

Type

Description

id

Status
titlestring

message unique identifier

messageType

Statustitle

STRING

Type of the message. Can assume one of the following values:

“TEXT”

“IMAGE”

“DOCUMENT”

“LINK”

ts

Status
titleNUMBER

Timestamp of when message was sent

deliverySuccess

Status
titleboolean

Indicates whether the message was sent successfully

deliveryErrorReason

Status
titlestring

Error occurred if the message was not sent correctly

replyTo

Status
titlestring

Message ID you are replying to

content

Status
titleobject

Message content. See message content object for more details.

Message Content Object

...

Name

...

Type

...

Description

...

text

...

Status
titleSTRING

...

Only in “TEXT” message, contains the message sent

...

user

...

Status
titleobject

...

Semplified user object containing only user id and isAgent properties of the user who sent the message.

...

url

...

Status
titleSTRING

...

Contains the url of the link message

Example

Code Block
languagejson
{
    "_id" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a",
    "room" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a",
    "ctlive_type" : "chat",
    "messages" : [ 
        {
            "data" : {
                "replyTo" : "",
                "id" : "aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDUwODQxMzk0OTA4OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODE2NzQwNTg4MTcxMjQ0NzozMDMwMDcwMTg3NTA5MTIwMjkwMzUzNDkzMzgzMjEwNTk4NAZDZD",
                "messageType" : "TEXT",
                "content" : {
                    "text" : "prova1",
                    "user" : {
                        "id" : "4747235938674011",
                        "isAgent" : false
                    }
                },
                "ts" : 1642604343631.0,
                "deliverySuccess" : true,
                "deliveryErrorReason" : "",
                "messageSeen" : null
            },
            "_id" : ObjectId("61e8277aef3d6b076066d287"),
            "room" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a"
        }, 
        {
            "data" : {
                "replyTo" : "",
                "id" : "fb32e661-136d-4867-a1f8-a31eca5b673a",
                "messageType" : "TEXT",
                "content" : {
                    "text" : "Buongiorno, sono l'operatore Gabriele Verde, come posso esserle utile?",
                    "user" : {
                        "id" : "USER_gverde1@acd.enghouse.com",
                        "isAgent" : true
                    }
                },
                "ts" : 1642604351616.0,
                "deliverySuccess" : true,
                "deliveryErrorReason" : "",
                "messageSeen" : null
            },
            "_id" : ObjectId("61e8277aef3d6b076066d288"),
            "room" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a"
        }, 
        {
            "data" : {
                "replyTo" : "",
                "id" : "ba35d81d-d56e-49b4-ae17-020b9e477281",
                "messageType" : "endChat",
                "ts" : 1642604409492.0,
                "deliverySuccess" : true,
                "deliveryErrorReason" : "",
                "messageSeen" : null
                "content" : {
                    "user" : {
                        "isAgent" : true,
                        "id" : "USER_gverde1@acd.enghouse.com"
                    }
                }
            },
            "_id" : ObjectId("61e8277aef3d6b076066d289"),
            "room" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a"
        }
    ],
    "__v" : 0
}