Skip to main content
Skip table of contents

CIM Messages

CIM Messages are a communication interface between 3rd-party applications and Expertflow CX. Multiple message types are supported. You can: 

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. 

  1. 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. 

  1. 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. 


Header

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.

    • id - String - unique identifier of the sender - Required

    • type - Enum - sender type with options: agent/bot/connector/app/system - Required

    • senderName - String - Required

    • additionalDetail - Map (String, Object) - Optional

channelData

REQUIRED for outbound messages

It contains the parameters of the channel type opted by the customer for conversing with the agent.

ChannelData class object

    • serviceIdentifier - String - required - channel service identifier

    • channelCustomerIdentifier - String - required - unique ID usually MSISDN

  • Additional properties for inbound messages:

    • customerFirstName - String - Optional (first name of the customer.)

    • customerLastName - String - Optional (last name of the customer. If you are only receiving name of customer in a single field from provider then add it in customerFirstName only and leave this field).

    • requestPriority  - String - Optional (channel service identifier)

    • additionalAttributes - Optional - 

      • key - String - channel service identifier

      • type - String - channel service identifier

      • value - String - channel service identifier

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 null or customer information can also be sent by 3rd party.

Customer class object

  • id - UUID - system generated ID assigned to customer

  • firstName - String - name of the customer

  • isAnonymous - bool - if no name is specified, then it is marked true.

  • additionalDetail - Map (String, Object) - Optional

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,

  • START_CHAT

  • END_CHAT

  • START_VOICE

  • END_VOICE

  • REPLY_TO - used for quote reply. Set the intent to REPLY_TO, then add the parent message id to the originalMessageId field 

  • UPDATE - used to update/edit a message

  • CALL_LEG_STARTED

  • CALL_LEG_ENDED

  • ASSIGN_RESOURCE_REQUESTED

  • IVR_AGGREGATED_ACTIVITY

  • START_CONVERSATION

stamps


List (String)

-

Entities

OPTIONAL for conversation bot and bot connector only.

Entities are the data of intent. e.g. channel session object etc. 
Entities are used to inform conversational bot about the event and is null for messages sent by agent.

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

-


CODE
{
    "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 
}
}



Body

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


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
	{ 
		"type": "DELIVERYNOTIFICATION",
        "markdownText": "Optional",
        "messageId": "abc12345",
        "status":"DELIVERED",
        "reasonCode":200
    }


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.



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.