CIM Messages
CIM Messages are a communication interface between 3rd-party applications and Expertflow CX. Multiple message types are supported. You can:
send messages via Channel Connector using CIM Message REST APIs.
send messages through Socket.io for event-based architecture such as custom Agent Desk.
send messages via Bot Connector to Bot.
Based on the above mentioned points, two keywords associated with messages are defined as follows:
Inbound Messages | Messages received by CCM from any 3rd party (channel connector, custom agent desk or bot connector) are called inbound messages. |
---|---|
Outbound Messages | Messages sent by CCM to any 3rd party (channel connector, custom agent desk or bot connector) are called outbound messages. |
Structure of CIM Messages
The CIM Messages#request and CIM Messages#response structure of CIM Messages is given as follows:
Request
In the Expertflow CX Object Model, a message request contain two parts - Header and Body.
Header
a standard format is set for all types of messages. The generic header format is described below in the Header tab.
fields can be added to the header as per requirement such as in case of Agent Desk and Bot Connector.
Body
the message body changes with respect to the message type. The standard parameters in the body are described below in the Body tab.
there are six basic types of messages i.e. Plain, Media (Image, Video, Audio, File, Sticker), Location, Contact, URL and Button.
a specific type of message such as WrapUp Message is used in Agent Desk to wrap up agent-customer conversation.
A unique ID is also generated to identify each message in a conversation. The payload of Messages is described below.
The parameters present in Message Header are given as follows:
Parameter | Description | Type | Properties |
---|---|---|---|
sender REQUIRED for inbound and outbound messages | It contains sender information. Helps to identify sender type and role e.g. Agent or Customer. | Sender object. |
|
REQUIRED for outbound messages | It contains the parameters of the channel type opted by the customer for conversing with the agent. | ChannelData class object |
|
channelsessionId REQUIRED for outbound messages | System generated ID to manage the session. | String | - |
schedulingMetaData OPTIONAL for outbound messages | contains data for scheduled campaigns | Map (string or object) | - |
roomId OPTIONAL | inbound messages - send roomId in the header | String | - |
conversationId REQUIRED for outbound messages | System generated ID to manage the conversation. | String | - |
customer REQUIRED for outbound messages OPTIONAL for inbound messages | contains attributes related to the customer. It can be sent as | Customer class object |
|
Intent OPTIONAL for conversation bot and bot connector only. | Intents are system events to inform the conversational bot to take action on the intent. It is NULL when agent send a message. | Enum | For example,
|
stamps | List (String) | - | |
Entities OPTIONAL for conversation bot and bot connector only. | Entities are the data of intent. e.g. channel session object etc. | Map (string or object) | - |
providerMessageId OPTIONAL | Channel provider message ID | String | |
originalMessageId OPTIONAL | ID of a message within a conversation. See Intent field above for REPLY_TO intent. | String | - |
timestamp OPTIONAL | It contains the timestamp at which the message was received. | System datetime class object | - |
language OPTIONAL | Used to specify unicode in case of language change. By default, it is English. | LanguageCode class object | - |
securityInfo OPTIONAL | MessageSecurity class object | - |
{
"id": "63c0ea05-4878-4d65-b6e0-2564ec29fc89",
"header": {
"sender": {
"id": "460df46c-adf9-11ed-afa1-0242ac120002",
"type": "CONNECTOR",
"senderName": "WEB_CONNECTOR",
"additionalDetail": null
},
"channelData": {
"channelCustomerIdentifier": "{{$randomPhoneNumber}}",
"serviceIdentifier": "{{$randomPhoneNumber}}",
"customerFirstName": "{{$randomCustomerFirstName}}",
"customerLastName": "{{$randomCustomerLastName}}",
"requestPriority": 0,
"additionalAttributes": []
},
"language": {},
"timestamp": 1677151053951,
"securityInfo": {},
"stamps": [],
"intent": null,
"entities": {},
"channelSessionId": null,
"schedulingMetaData": null
"conversationId": null,
"customer": null,
"originalMessageId": null,
"providerMessageId": null
}
}
Multiple message types are supported by CIM. However, based on selected channels by the vendor, certain types can be used. Following are message types:
Response Code | Description |
---|---|
200 | Code 200 implies that the message has been accepted and delivered successfully. The response body will contain the delivery notification. Example is given as follows: Response Body:
CODE
|
202 | Code 202 means that the message has been accepted. Once, it is delivered, separate delivery notification will be sent. |
400 | Code 400 is sent in case of error in message delivery. |