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.

<message from="7ae1cb556a0cc9c29ca3fd36302628df5734e1b9edf1cd07eb0e7335eebd9ee2@onebrand/web_NDAyYmQ5OWRlNDM4YzQxODUzYThmNTcwZDk1MTkzNzU" id="d788d5aa-d8ba-4834-9702-af91854ffa9b" to="va@onebrand" type="chat" xmlns="jabber:client">
  <body></body>
  <thread>32012345678</thread>
  <x xmlns="jabber:x:oob">
    <action>chat_text</action>
    <type>chat_text</type>
    <payload>
      {
        "text": "sample text",
        "data": {
          "useChatDynamic": true,
          "token": "RF1gQhRdSMtq89cn048Zn4Nwfu7amh2wBDdgWqnKnsjz/4Ok+HTXnC7ts6x65AXMOR1LjsKwsbdgBo4KFMavO7P3U+iK8sqZIIioI+FgFPc",
          "resetSession": false,
          "apiVersion": 1
        }
      }
    </payload>
    <language>it</language>
  </x>
</message>

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

<message from="7ae1cb556a0cc9c29ca3fd36302628df5734e1b9edf1cd07eb0e7335eebd9ee2@onebrand/web_NDAyYmQ5OWRlNDM4YzQxODUzYThmNTcwZDk1MTkzNzU" id="d788d5aa-d8ba-4834-9702-af91854ffa9b" to="va@onebrand" type="chat"
  xmlns="jabber:client">
  <body></body>
  <thread>MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==</thread>
  <x xmlns="jabber:x:oob">
    <action>chat_text</action>
    <type>chat_text</type>
    <payload>
      {
        "text": "sample text",
        "data": {
          "useChatDynamic": true,
          "token": "RF1gQhRdSMtq89cn048Zn4Nwfu7amh2wBDdgWqnKnsjz/4Ok+HTXnC7ts6x65AXMOR1LjsKwsbdgBo4KFMavO7P3U+iK8sqZIIioI+FgFPc",
          "thread": "MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==",
          "os": "web",
          "appVersion": "0.4.65",
          "apiVersion": 2,
          "premium": false
        }
      }
    </payload>
    <language>it</language>
  </x>
</message>

e.g. response

<message to="7ae1cb556a0cc9c29ca3fd36302628df5734e1b9edf1cd07eb0e7335eebd9ee2@onebrand/web_NDAyYmQ5OWRlNDM4YzQxODUzYThmNTcwZDk1MTkzNzU" id="d788d5aa-d8ba-4834-9702-af91854ffa9c" from="va@onebrand" type="chat"
  xmlns="jabber:client">
  <body></body>
  <thread>7ae1cb556a0cc9c29ca3fd36302628df5734e1b9edf1cd07eb0e7335eebd9ee2:MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==|$|U3VwcG9ydG8=</thread>
  <x xmlns="jabber:x:oob">
    <action>chat_text</action>
    <type>chat_text</type>
    <payload>
      {
        "text": "sample text",
        "data": {
          "conversationType": "bot"
        }
      }
    </payload>
    <language>it</language>
  </x>
</message>

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

<message from="7ae1cb556a0cc9c29ca3fd36302628df5734e1b9edf1cd07eb0e7335eebd9ee2@onebrand/web_NDAyYmQ5OWRlNDM4YzQxODUzYThmNTcwZDk1MTkzNzU" id="d788d5aa-d8ba-4834-9702-af91854ffa9b" to="va@onebrand" type="chat"
  xmlns="jabber:client">
  <body></body>
  <thread>MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==</thread>
  <x xmlns="jabber:x:oob">
    <action>chat_text</action>
    <type>chat_text</type>
    <payload>
      {
        "text": "sample text",
        "data": {
          "useChatDynamic": true,
          "token": "RF1gQhRdSMtq89cn048Zn4Nwfu7amh2wBDdgWqnKnsjz/4Ok+HTXnC7ts6x65AXMOR1LjsKwsbdgBo4KFMavO7P3U+iK8sqZIIioI+FgFPc",
          "thread": "MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==",
          "os": "web",
          "appVersion": "0.4.65",
          "apiVersion": 2,
          "premium": false
        }
      }
    </payload>
    <language>it</language>
  </x>
</message>

e.g. response

<message to="7ae1cb556a0cc9c29ca3fd36302628df5734e1b9edf1cd07eb0e7335eebd9ee2@onebrand/web_NDAyYmQ5OWRlNDM4YzQxODUzYThmNTcwZDk1MTkzNzU" id="d788d5aa-d8ba-4834-9702-af91854ffa9c" from="va@onebrand" type="chat"
  xmlns="jabber:client">
  <body></body>
  <thread>7ae1cb556a0cc9c29ca3fd36302628df5734e1b9edf1cd07eb0e7335eebd9ee2:MjFkNDQzMzQ1NTkyOWE5MTQyYjU2NWU5NDRjN2ExYmU1NzYwNTlkMDk4MjRmMTVmZDJjNDcwNzAxZDU3NDdkZA==|$|U3VwcG9ydG8=_14850c10-6093-46fb-a7c4-9abf014b3991</thread>
  <x xmlns="jabber:x:oob">
    <action>chat_text</action>
    <type>chat_text</type>
    <payload>
      {
        "text": "sample text",
        "data": {
          "conversationType": "bot",
          "chatTitle": "Supporto"
        }
      }
    </payload>
    <language>it</language>
  </x>
</message>

chat_notice

Available code for chat_notice Messaggio 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