============
XMPP Service
============
.. toctree::
:maxdepth: 1
.. contents:: List of available services
:local:
:depth: 1
.. _dynamic-buddies:
Dynamic Buddies
===============
Xmpp Service VCard returns dynamic buddies configuration. You can find it on **DESC** field.
**VCard Fields:**
+------------------+-------------------------------------------------+
| **Field** | **Description** |
+==================+=================================================+
| payload | Json payload with dynamic buddies configuration |
+------------------+-------------------------------------------------+
| url | Doesn't manage on xmpp_service |
+------------------+-------------------------------------------------+
| thumb | Doesn't manage on xmpp_service |
+------------------+-------------------------------------------------+
| status | Doesn't manage on xmpp_service |
+------------------+-------------------------------------------------+
**Json Parameters:**
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| **Param** | **Description** |
+=============================+========================================================================================================+
| DESC | Payload param inside vcard with all info about buddy |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| DESC:**items** | Items array that represent channels |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| items:**mobileIsPublished** | Flag to determine if item on mobile application are published |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| items:**webIsPublished** | Flag to determine if item on webchat application are published |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| items:**address** | Channel address set server side, if *serverAddress* exists it will be *thread* on xmpp message |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| items:**serverAddress** | Channel server address set server side, it's not mandatory and if set it will be *to* on xmpp message |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| items:**type** | Channel type: **group** or **channel** |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| info:**name** | Channel name to show |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| info:**status** | Channel status to show |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| info:**imageUrl** | Avatar Image Url to show |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| info:**thumbUrl** | Avatar Thumb Url to show |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
| items:**items** | Items array that represent channels on channel parent container |
+-----------------------------+--------------------------------------------------------------------------------------------------------+
**Example:**
.. code-block:: xml
{
"items": [
{
"address": "ae72f789-8edc-413e-870a-ec5d23877813",
"serverAddress": "bot-management",
"type": "channel",
"mobileIsPublished": true,
"webIsPublished": true,
"info": {
"name": "bot-for-test-all-possibilities-facebook",
"status": "",
"imageUrl": "",
"thumbUrl": "",
"defaultMessage": ""
}
},
{
"address": "29ed6653-29db-47ff-ba44-344853fcbc61",
"serverAddress": "bot-management",
"type": "channel",
"mobileIsPublished": false,
"webIsPublished": true,
"info": {
"name": "Bot for Test: All possibilities",
"status": "",
"imageUrl": "",
"thumbUrl": "",
"defaultMessage": ""
}
},
{
"address": "ffc2b639-bbc0-47c1-acd3-e9a4e74f865c",
"serverAddress": "bot-management",
"type": "channel",
"mobileIsPublished": true,
"webIsPublished": false,
"info": {
"name": "Fibra Fastweb",
"status": "Fibra FW Demo",
"imageUrl": "",
"thumbUrl": "",
"defaultMessage": "Ottimo! Hai scelto l'offerta Fibra FW per la tua abitazione!\\n\\n\\n\n\nSe completiamo la raccolta di informazioni necessarie, possiamo procedere ad attivare il contratto e la linea al più presto\\n\\n\\n\n\nSappi che puoi riprendere quando vuoi la conversazione e completare gli step con comodo."
}
}
]
}
**Example with Mobile Ticketing:**
.. code-block:: json
{
"items": [
{
"address": "mobile_ticketing_group",
"type": "group",
"mobileIsPublished": true,
"webIsPublished": false,
"info": {
"name": "Mobile Ticketing",
"status": "Acquista qui i tuoi biglietti",
"imageUrl": "http://....",
"thumbUrl": "http://...."
},
"items": [
{
"address": "atm_milano",
"type": "channel",
"serverAddress": "myticket",
"mobileIsPublished": true,
"webIsPublished": false,
"info": {
"name": "ATM Milano",
"status": "Qui i biglietti di Milano",
"imageUrl": "http://....",
"thumbUrl": "http://....",
"defaultMessage": "Ciao qui puoi acquistare i fantastici biglietti di ATM Milano"
}
},
{
"address": "atm_firenze",
"type": "channel",
"serverAddress": "myticket",
"mobileIsPublished": true,
"webIsPublished": false,
"info": {
"name": "ATAF Firenze",
"status": "Qui i biglietti di Firenze",
"imageUrl": "http://....",
"thumbUrl": "http://....",
"defaultMessage": "Ciao qui puoi acquistare i fantastici biglietti di ATAF Firenze"
}
}
]
}
]
}
Below an example with a simple channel without group:
.. code-block:: json
{
"items": [
{
"address": "liam",
"type": "channel",
"serverAddress": "liam",
"mobileIsPublished": true,
"webIsPublished": false,
"info": {
"name": "Liam",
"status": "Life in a monk house",
"imageUrl": "http://....",
"thumbUrl": "http://....",
"defaultMessage": "Ciao qui puoi accedere a tutte le funzionalità della Monk House"
}
}
]
}
.. _add-to-roster:
Add To Roster
=============
Backend application adds to Roster all channels received that are:
- without a group
- without a name
- with a different name found on the Roster
- on the AddressBook but don't exist on the Roster
- with OTHERS group and a subscription diffent of none
**Request message:**
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| **Tag** | **Value** | |
+===========================+===================================+=============================================================+
| x:type | cmd_add_to_roster | |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| x:action | cmd_add_to_roster | |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| x:payload | Json object named channelUsers | |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| payload:channelUsers | Array of ChannelUser | |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| payload:status | int | 0 => OK; other => ERROR |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| payload:errorCode | string | SQL_ERROR|NO_USER_FOUND|NO_CHANNEL_FOUND |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| payload:errorMessage | array of objects | Each object has one element, with message key |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| errorMessage:message | string | Text of message |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
**Example:**
.. code-block:: xml
cmd_add_to_roster
cmd_add_to_roster
{
"channelUsers":[
{
"name": "Mario Rossi",
"address": "00393471111111"
},
{
"name": "Luca Rossi",
"address": "00393472222222"
}
]
}
.. _search-users:
Search Users
============
This command is used to update the local roster with contacts fetched from mobile contact list.
**Request message:**
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| **Tag** | **Type** | **Description** |
+===========================+===================================+=============================================================+
| x:type | cmd_search_users | |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| x:action | cmd_search_users | |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| x:payload | object | |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
| payload:userList | array of msisdn | List of MSISDN (International format) to search for |
+---------------------------+-----------------------------------+-------------------------------------------------------------+
**Example:**
.. code-block:: xml
cmd_search_users
{
userList: ["00393296260815","00393333333333","00393490899289","00393494371802","00393497588825"]
}