Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »

Name

Type

Description

room

STRING

Chat unique identifier

data

OBJECT

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

Message Data Object

Name

Type

Description

id

STRING

message unique identifier

messageType

STRING

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

“TEXT”

“IMAGE”

“DOCUMENT”

“LINK”

“AUDIO”

“VIDEO”

“videoRequestedByAgent”

“videoRequestedByCustomer”

“videoAccepted”

“videoRejected”

“videoStarted”

“videoEnded”

“screenSharingStarted”

“screenSharingEnded”

“endChat”

“leave”

ts

NUMBER

Timestamp of when message was sent

deliverySuccess

BOOLEAN

Indicates if the message has been succesfully delivered

deliveryErrorReason

STRING

In case of delivery failed, describes the error occurred

replyTo

STRING

Message ID you are replying to

content

OBJECT

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

STRING

Only in “TEXT” message, contains the message sent

user

OBJECT

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

Example

{
    "data" : {
        "replyTo" : "",
        "id" : "e857df30-76a4-4c6c-b4a5-4faed2ed6f45",
        "messageType" : "TEXT",
        "content" : {
            "text" : "Buongiorno, sono l'operatore Gabriele Verde, come posso esserle utile?",
            "user" : {
                "id" : "USER_gverde1@acd.enghouse.com",
                "isAgent" : true
            }
        },
        "ts" : 1643191581119.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : ""
    },
    "_id" : ObjectId("61f11d7cd42454470cb22da4"),
    "room" : "CHAT_DEFAULT_a098a0bc-b34c-452c-829c-1b03aa7a67ee"
}

Image message

Name

Type

Description

caption

STRING

Message caption

fileName

STRING

Contains name of the document/image message

documentType

STRING

Document format

user

OBJECT

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

Example

        {
            "data" : {
                "replyTo" : "",
                "id" : "03250778-0425-47c1-92c1-85d1840bef7c",
                "messageType" : "IMAGE",
                "content" : {
                    "caption" : "",
                    "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" : 1643191627987.0,
                "deliverySuccess" : true,
                "deliveryErrorReason" : ""
            },
            "_id" : ObjectId("61f11d7cd42454470cb22da5"),
            "room" : "CHAT_DEFAULT_a098a0bc-b34c-452c-829c-1b03aa7a67ee"
        }

Document message:

Name

Type

Description

caption

STRING

Message caption

fileName

STRING

Contains name of the document/image message

documentType

STRING

Document format

user

OBJECT

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

Example

{
    "data" : {
        "replyTo" : "",
        "id" : "16daf4d4-a77f-406f-ab75-0475f510bc95",
        "messageType" : "DOCUMENT",
        "content" : {
            "caption" : "",
            "fileName" : "WHATSAPP-TEMPLATE-AD-v09.xlsx",
            "documentType" : "xlsx",
            "user" : {
                "id" : "USER_gverde1@acd.enghouse.com",
                "isAgent" : true
            }
        },
        "ts" : 1643191652417.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : ""
    },
    "_id" : ObjectId("61f11d7cd42454470cb22da6"),
    "room" : "CHAT_DEFAULT_a098a0bc-b34c-452c-829c-1b03aa7a67ee"
}

Video message:

Name

Type

Description

caption

STRING

Message caption

fileName

STRING

Contains name of the document/image message

documentType

STRING

Document format

user

OBJECT

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

Example

{
    "data" : {
        "replyTo" : "",
        "id" : "m_dXya7ckVUHyYxQHcQrrdgT2MVSImQFjQ7aCDxA_Mxf7AeR9GMI0vDs2dy2PKgTjE24tQrJImLWYnR5hgtpt7Uw",
        "messageType" : "VIDEO",
        "content" : {
            "caption" : "",
            "fileName" : "video.mp4",
            "documentType" : "mp4",
            "user" : {
                "id" : "4149729381806003",
                "isAgent" : false
            }
        },
        "ts" : 1643207226322.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : ""
    },
    "_id" : ObjectId("61f15a4c932c660c83d5e229"),
    "room" : "CHAT_DEFAULT_06b6ace1-a923-4657-876b-c6432729610d"
}

Audio message:

caption

STRING

Message caption

fileName

STRING

Contains name of the document/image message

documentType

STRING

Document format

user

OBJECT

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

Example

{
    "data" : {
        "replyTo" : "",
        "id" : "m_JLR7O2EHIE6d3fiskFBiqz2MVSImQFjQ7aCDxA_Mxf6hm6TYUaJKXiEqfYgCX8WKxriZux06OzPB8XLZa8yNKA",
        "messageType" : "AUDIO",
        "content" : {
            "caption" : "",
            "fileName" : "audioclip-1643206881000-5760.mp4",
            "documentType" : "mp4",
            "user" : {
                "id" : "4149729381806003",
                "isAgent" : false
            }
        },
        "ts" : 1643206886118.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : ""
    },
    "_id" : ObjectId("61f158ee932c660c83d5e1fa"),
    "room" : "CHAT_DEFAULT_24ec70f1-b92d-44c4-94ad-49bcd15986ea"
}

Link message:

Name

Type

Description

url

STRING

Contains the url of the link message

user

OBJECT

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

Example

{
    "data" : {
        "replyTo" : "",
        "id" : "17909c52-1f26-402c-90cb-3106ba80bb3b",
        "messageType" : "LINK",
        "content" : {
            "url" : "https://www.google.it",
            "user" : {
                "id" : "USER_gverde1@acd.enghouse.com",
                "isAgent" : true
            }
        },
        "ts" : 1643191666618.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : ""
    },
    "_id" : ObjectId("61f11d7cd42454470cb22da7"),
    "room" : "CHAT_DEFAULT_a098a0bc-b34c-452c-829c-1b03aa7a67ee"
}

Video chat events messages:

All video chat events messages have the audio and video boolean properties to indicate the channel used.

Name

Type

Description

audio

BOOLEAN

if true the audio chennel is engaged

video

BOOLEAN

if true the video chennel is engaged

Examples

videoRequestedByCustomer message

{
    "data" : {
        "id" : "c6d3e132-4432-4208-943d-cc2b34ba3107",
        "messageType" : "videoRequestedByCustomer",
        "ts" : 1617786830148.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : "",
        "content" : {
            "user" : {
                "isAgent" : false,
                "id" : "USER_DEFAULT_9a0a411c-f9c7-4af7-9754-024bf157a3ef"
            },
            "audio" : true,
            "video" : true
        }
    },
    "_id" : ObjectId("606d7810d6e88353f88732a1"),
    "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081"
}

videoAccepted message:

{
    "data" : {
        "id" : "715a2213-3123-4718-8266-a489bebc493b",
        "messageType" : "videoAccepted",
        "ts" : 1617786834240.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : "",
        "content" : {
            "user" : {
                "isAgent" : true,
                "id" : "USER_gverde1@acd.enghouse.com"
            },
            "audio" : true,
            "video" : true
        }
    },
    "_id" : ObjectId("606d7810d6e88353f88732a0"),
    "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081"
}

videoStarted message:

{
    "data" : {
        "id" : "cfa53427-1ee7-4e8f-9848-e8e87523aec4",
        "messageType" : "videoStarted",
        "deliverySuccess" : true,
        "deliveryErrorReason" : "",
        "ts" : 1617786839849.0,
        "content" : {
            "user" : {
                "isAgent" : true,
                "id" : "USER_gverde1@acd.enghouse.com"
            },
            "audio" : true,
            "video" : true
        }
    },
    "_id" : ObjectId("606d7810d6e88353f887329f"),
    "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081"
}

screenSharingStarted message:

{
    "data" : {
        "id" : "227130be-f490-4ef2-9923-9bb69ad6756c",
        "messageType" : "screenSharingStarted",
        "deliverySuccess" : true,
        "deliveryErrorReason" : "",
        "ts" : 1617786873764.0,
        "content" : {
            "user" : {
                "isAgent" : true,
                "id" : "USER_gverde1@acd.enghouse.com"
            },
            "audio" : true,
            "video" : true
        }
    },
    "_id" : ObjectId("606d7810d6e88353f887329c"),
    "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081"
}

videoEnded message:

{
    "data" : {
        "id" : "a8ffdf71-ad3e-4495-ba91-057442df88c0",
        "messageType" : "videoEnded",
        "deliverySuccess" : true,
        "deliveryErrorReason" : "",
        "ts" : 1617786886374.0,
        "content" : {
            "user" : {
                "isAgent" : true,
                "id" : "USER_gverde1@acd.enghouse.com"
            },
            "audio" : true,
            "video" : true
        }
    },
    "_id" : ObjectId("606d7810d6e88353f887329a"),
    "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081"
} 

endChat message:

Name

Type

Description

user

OBJECT

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

Example

{
    "data" : {
        "id" : "b88d3de0-23b8-41d1-95c3-1209dd4c8cff",
        "messageType" : "endChat",
        "ts" : 1617786896642.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : "",
        "content" : {
            "user" : {
                "isAgent" : false,
                "id" : "USER_DEFAULT_9a0a411c-f9c7-4af7-9754-024bf157a3ef"
            }
        }
    },
    "_id" : ObjectId("606d7810d6e88353f8873297"),
    "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081"
}
  • No labels