For compactness of the format, fields are stored as array elements, and optional fields are stored in objects. A message packet consists of a global header followed by one or more message types. Each message packet contains a global header that consists of an array that contains the message version and a message serial number. The header is followed by an array of session messages.
There are two types of messages:
- Session
- Client environment
Each message packet contains a global header consisting of an array containing the message version and a message serial number. The header is followed by an array of session messages.
Message format schema
This example of the JSON message format schema:
{
"messageVersion": {
"title": "Json message version",
"type": "string",
"required": true
},
"serialNumber": {
"title": "Number of packet of MessageFormat sent to server",
"type": "integer",
"required": true
},
"clientEnvironment": {
"title": "Client environment",
"type": "$ref": "ClientEnvironment",
"required": true
},
"sessions": {
"description": "We simplified this to an array of one session.",
"type": "array",
"additionalItems": {
{
"description": "Session with list of messages",
"type": "array",
"item": {
{ "$ref" : "Session" },
"required": true,
}
},
},
},
"additionalProperties" : false
}
}
Message format example
This example contains a message header and the client environment information that is submitted by the client framework from an Android native application:
{
"serialNumber": 0,
"messageVersion": "0.0.0.1",
"sessions": [
{
"startTime": 1328311295574,
"id": "945202AC4E93104E05EDADE1F6059B97",
"messages": [
{
"offset": 124,
"screenViewOffset": 4556,
"type": 2,
"logicalPageName": "HomeActivity"
}
]
}
],
"clientEnvironment": {
"mobileEnvironment": {
"android": {
"keyboardType": "QWERTY",
"brand": "generic",
"fingerPrint": "generic/sdk/generic/
:2.2/FRF91/43546:eng/test-keys"
},
"totalMemory": 63422464,
"totalStorage": 12288,
"orientationType": "PORTRAIT",
"appVersion": "1.0.5",
"manufacturer": "unknown",
"userId": "android-build",
"locale": "English (United States)",
"deviceModel": "sdk",
"language": "English"
},
"width": 0,
"height": 0,
"osVersion": "2.2"
}
}
Session messages schema
The Session messages in a JSON packet contain message type objects to be posted to server.
{
"id": {
"title": "Session id",
"type": "string",
"required": true
},
"startTime": {
"title": "Session start time in ticks",
"type": "number",
"required": true
},
"messages": {
"description": "List of messages",
"type": "array",
"additionalItems": {
{
"description": "List of messages",
"type": "array",
"item": {
{ "$ref" : "Client State" },
{ "$ref" : "ScreenView" },
{ "$ref" : "Connection" },
{ "$ref" : "Control" },
{ "$ref" : "Custom Event" },
{ "$ref" : "Exception" },
"required": true,
}
},
},
},
"additionalProperties" : false
}
Session messages example
{
"startTime": 1328311295574,
"id": "945202AC4E93104E05EDADE1F6059B97",
"messages": [
{
"offset": 124,
"screenViewOffset": 4556,
"type": 2,
"logicalPageName": "HomeActivity"
}
]
}
Client environment schema
Client environment data contains session-level information that is sent during all the messages sent to the server. It is part of the message format. CX UI Capture for AJAX does not send clientEnvironment
messages.
{
"$ref" : "MessageHeader",
"osVersion": {
"title": "Operating system version",
"type": "string",
"required": false for UIC, true for native frameworks
},
"orientation": {
"title": "Initial session orientation of the screen",
"type": "integer which can be 0, 90, 180 or -90",
"required": true for iOS and Android. UIC has an orientation in webEnvironment.
},
"height": {
"title": "Initial session height of display/viewport divided by pixel density",
"type": "integer",
"required": true
},
"width": {
"title": "Initial session width of display/viewport divided by pixel density",
"type": "integer",
"required": true
},
"deviceHeight": {
"title": "Initial session device height of display/viewport",
"type": "integer",
"required": true
},
"deviceWidth": {
"title": "Initial session device width of display/viewport",
"type": "integer",
"required": true
},
"mobileEnvironment": {
"description": "Logical page being loaded",
"type": "object",
"properties": {
"appName": {
"title": "Application name",
"type": "string",
"required": true
},
"android": {
"description": "Current state in an Android device",
"type": "object",
"properties": {
"brand": {
"title": "The brand (e.g., carrier) the software is customized for, if any",
"type": "string",
"required": true
},
"fingerPrint": {
"title": "A string that uniquely identifies this build",
"type": "string",
"required": true
},
"keyboardType": {
"title": "Keyboard type",
"type": [ {
"enum": [0],
description: "TWELVE_KEYS"
},
"enum": [1],
description: "NO_KEYS"
},
"enum": [2],
description: "QWERTY"
},
"enum": [3],
description: "UNDEFINED"
}],
"required": true
},
}
},
"totalMemory": {
"title": "Total memory in MBytes of device",
"type": "number",
"required": true
},
"totalStorage": {
"title": "Total storage in MBytes of device",
"type": "number",
"required": true
},
"orientationType": {
"title": "Orientation type of device",
"type": [ {
"LANDSCAPE"
description: "LANDSCAPE"
},
"PORTRAIT",
description: "PORTRAIT"
},
"SQUARE",
description: "SQUARE"
},
"UNDEFINED",
description: "UNDEFINED"
}],
"required": true
},
"appVersion": {
"title": "Version of application",
"type": "string",
"required": true
},
"manufacturer": {
"title": "Manufacturer of device",
"type": "string",
"required": true
},
"userId": {
"title": "User of device",
"type": "string",
"required": true
},
"locale": {
"title": "The user's preferred locale",
"type": "string",
"required": true
},
"deviceModel": {
"title": "Device model",
"type": "string",
"required": true
},
"language": {
"title": "Device's language",
"type": "string",
"required": true
}
},
"additionalProperties" : false
},
“webEnvironment": {
"description": "Web page being loaded",
"type": "object",
"properties": {
"libVersion": {
"title": "Library version,
"type": "string",
"required": true for UIC
},
"screen": {
"description": "Display of the web content",
"type": "object",
"properties": {
"orientation": {
"title": "Initial session orientation of the screen",
"type": "integer which can be 0, 90, 180 or -90",
"required": true for UIC. iOS and Android has it on outer object.
},
"orientationMode": {
"title": "To indicate orientation mode.”,
"type": "string which can be Portrait or Landscape",
"required": true for UIC
}
}
},
"page": {
"title": "Url of the page",
"type": "string",
"required": true for UIC
},
"referrer": {
"title": "Referrer URL (if any) of the page.",
"type": "string",
"required": true for UIC
}
},
"additionalProperties" : false
}
}
Client environment examples
The following examples contain a client environment messages that are submitted from applications.
This example shows the clientEnvironment
message for UIC:
clientEnvironment" : {
"webEnvironment" : {
"libVersion" : "5.0.0.XXXX",
"page" : "http://uictest.com/frames/",
"referrer" : "http://uictest.com/",
"screen" : {
"devicePixelRatio" : 1,
"deviceWidth" : 1920,
"deviceHeight" : 1080,
"deviceToolbarHeight" : 34,
"width" : 942,
"height" : 955,
"orientation" : 0,
"orientationMode" : "PORTRAIT"
}
}
}
This example shows the clientEnvironment message for Android and iOS:
"clientEnvironment": {
"orientation": 90,
"height": 720,
"osVersion": "4.2.2",
"pixelDensity": 2,
"width": 1196,
"deviceHeight": 360,
"osType": "Android" or "iOS"
"deviceWidth": 598
}