Versions Compared

Key

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

...

Name

Type

Description

id

Status
titlestring

message unique identifier

messageType

Status
titleSTRING

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

“TEXT”

“IMAGE”

“DOCUMENT”

“LINK”

“videoRequestedByAgent”

“videoRequestedByCustomer”

“videoAccepted”

“videoRejected”

“videoStarted”

“videoEnded”

“screenSharingStarted”

“screenSharingEnded”

“endChat”

“leave”

ts

Status
titleNUMBER

Timestamp of when message was sent

deliverySuccess

Status
titleboolean

Indicates if the message has been succesfully delivered

deliveryErrorReason

Status
titlestring

In case of delivery failed, describes the error occurred

replyTo

Status
titlestring

Message ID you are replying to

content

Status
titleobject

Message content. See message content object for more details.

Message Content Object

The structure of the message content depends on the messageType property

Text message

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

Examples

Text message:

Example

Code Block
languagejson

...

            "data" : {
        

...

 

...

 

...

      

...

"replyTo" : "

...

",
                "

...

id" :

...

 "aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDUwODQxMzk0OTA4OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODE2NzQwNTg4MTcxMjQ0NzozMDMwMDcwMTg3NTA5MTIwMjkwMzUzNDkzMzgzMjEwNTk4NAZDZD",
                "

...

messageType" : "

...

TEXT",
                "

...

content" : {
                    "

...

text" : "

...

prova1",
                    "

...

user" : 

...

{
            

...

            "id" : 

...

"4747235938674011",
             

...

 

...

 

...

         "

...

isAgent" :

...

 false
             

...

 

...

 

...

     }

...


      

...

 

...

 

...

     

...

 

...

  },
                "ts" : 1642604343631.0,
                "deliverySuccess" : true,
                "deliveryErrorReason" : ""
            },
            "_id" : ObjectId("61e8277aef3d6b076066d287"),
            "room" : "CHAT_DEFAULT_

...

8857106a-

...

55b8-

...

4c47-

...

a5af-

...

a3aae7530e5a"
        }

Image

...

message

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.

Example

Code Block
languagejson
{
    "data" : {
        "id" : "781d3c44-f0b9-434b-9a09-6f5e5dcb69b0",
        "messageType" : "IMAGE",
        "content" : {
            "caption" : "IMG",
            "fileName" : "45971097-illustrazione-di-happy-emoticon-dà-pollice-in-su-isolato-su-sfondo-bianco.jpg",
            "documentType" : "jpg",
            "user" : {
                "id" : "USER_DEFAULT_9a0a411c-f9c7-4af7-9754-024bf157a3ef",
                "isAgent" : false
            }
        },
        "ts" : 1617789849117.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : ""
    },
    "_id" : ObjectId("606d83d5d6e88353f88732ac"),
    "room" : "CHAT_DEFAULT_18234ff1-4a0e-4668-b002-16bf3cfbdb7d"
}

...