Custom EiMe messages ==================== This section define custom implementation of EiMe messages Message structure ----------------- Semantic logic of client's messages was defined by apiVersion field into data field of payload tag. Changes +-------------+----------------------------------+------------+ | apiVersion | description | deprecated | +=============+==================================+============+ | --- | initial version | ✓ | +-------------+----------------------------------+------------+ | 1 | initial version | ✓ | +-------------+----------------------------------+------------+ | 2 | thread with multi-chat support | ✗ | +-------------+----------------------------------+------------+ | 2.1 | conversations with unique thread | ✗ | +-------------+----------------------------------+------------+ API Version 1 ............. The first version of messages follow this custom logics: - plain MSISDN of the user into `thread` tag - data of the payload contain: - `token`: the "tripletta" issued by wind login systems - `useChatDynamic`: for declare wich type of message the client implement: chat_dynamic or chat_interactive - `resetSession`: force server to reset conversation with VirtualAgent e.g. .. code-block:: xml 32012345678 chat_text chat_text { "text": "sample text", "data": { "useChatDynamic": true, "token": "RF1gQhRdSMtq89cn048Zn4Nwfu7amh2wBDdgWqnKnsjz/4Ok+HTXnC7ts6x65AXMOR1LjsKwsbdgBo4KFMavO7P3U+iK8sqZIIioI+FgFPc", "resetSession": false, "apiVersion": 1 } } it API Version 2 ............. Differences with the previous version are: - `thread` encrypted as `base64(sha256(MSISDN))|$|base64(chatTitle)` - enriched data of the payload with: - `os`: Operating system of the client caller. Allowed values: `web` | `android` | `ios` - `appVersion`: version code of the client - `premium`: Whether channel is premium or not. Allowed values: `true` | `false` e.g. request .. code-block:: xml MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA== chat_text chat_text { "text": "sample text", "data": { "useChatDynamic": true, "token": "RF1gQhRdSMtq89cn048Zn4Nwfu7amh2wBDdgWqnKnsjz/4Ok+HTXnC7ts6x65AXMOR1LjsKwsbdgBo4KFMavO7P3U+iK8sqZIIioI+FgFPc", "thread": "MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==", "os": "web", "appVersion": "0.4.65", "apiVersion": 2, "premium": false } } it e.g. response .. code-block:: xml 7ae1cb556a0cc9c29ca3fd36302628df5734e1b9edf1cd07eb0e7335eebd9ee2:MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==|$|U3VwcG9ydG8= chat_text chat_text { "text": "sample text", "data": { "conversationType": "bot" } } it API Version 2.1 ............... The differences with the version `2` are: - the `thread` tag value, in a human-operator chat, has an UUID placed after the `base64(chatTitle)` - the server messages contains `chatTitle` field, placed into the `data` field, that will give to the clients the human-readable name of the chat. - `premium`: Whether channel is premium or not. Allowed values: `true` | `false` e.g. request .. code-block:: xml MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA== chat_text chat_text { "text": "sample text", "data": { "useChatDynamic": true, "token": "RF1gQhRdSMtq89cn048Zn4Nwfu7amh2wBDdgWqnKnsjz/4Ok+HTXnC7ts6x65AXMOR1LjsKwsbdgBo4KFMavO7P3U+iK8sqZIIioI+FgFPc", "thread": "MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==", "os": "web", "appVersion": "0.4.65", "apiVersion": 2, "premium": false } } it e.g. response .. code-block:: xml 7ae1cb556a0cc9c29ca3fd36302628df5734e1b9edf1cd07eb0e7335eebd9ee2:MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==|$|U3VwcG9ydG8=_14850c10-6093-46fb-a7c4-9abf014b3991 chat_text chat_text { "text": "sample text", "data": { "conversationType": "bot", "chatTitle": "Supporto" } } it chat_notice ----------- Available `code` for `chat_notice` :ref:`chat_notice` messages: +----------------------------------+--------+----------+--------------------------------------------------------+ | code | sender | receiver | description | +==================================+========+==========+========================================================+ | **GENESYS#0001** | router | client | Conversation closed for unhandled error | +----------------------------------+--------+----------+--------------------------------------------------------+ | **GENESYS#0002** | router | client | Conversation closed by operator | +----------------------------------+--------+----------+--------------------------------------------------------+ | **GENESYS#0003** | router | client | Conversation with operator timeout | +----------------------------------+--------+----------+--------------------------------------------------------+ | **GENESYS#0004** | router | client | Conversation closed by user | +----------------------------------+--------+----------+--------------------------------------------------------+ | **GENESYS_ERROR#0001** | router | client | Genesys error, generally it's not blocking | +----------------------------------+--------+----------+--------------------------------------------------------+ | **FOREGROUND_CONVERSATION#0001** | router | client | Put conversation on foreground | +----------------------------------+--------+----------+--------------------------------------------------------+ | **FOREGROUND_CONVERSATION#0002** | router | client | Conversation was already opened | +----------------------------------+--------+----------+--------------------------------------------------------+ | **GENESYS_CLOSE_BY_USER#0001** | client | router | Close conversation with operator | +----------------------------------+--------+----------+--------------------------------------------------------+ | **GENESYS_OPEN_FOR_VOTING#0001** | client | router | Force open conversation with operator for voting issue | +----------------------------------+--------+----------+--------------------------------------------------------+