The mobile application begins the conversation by sending the first packet. This will contain the function name "setConnection" along with some detail about the device that is being used.
{
"method":"setConnection",
"bundleID":"xpedite.software",
"uuid":mobile phone uuid,
"bounds":screen dimensions in 'logical' pixels,
"xpediteVersion":mobile version number
}
When receiving a packet we recommend that you extract the "method" entry as this will identify
the local function you should run. In this first packet the method will always be "setConnection".
We recommend you create a function called "setConnection" and call this function and pass the array.
The setConnection function would typically initialise a session by creating a GUID which will be included
in all successive packets within this current session.
The packet you send back will contain at least four items: a return code, a version number, the token, and a components entry indicating what to display on the screen next. This will be a JSON encoded array. For example:
{
"rc":0, // Just a return code
"version":100, // Your version number
"token":"08829e57-56ec-42a8-8b84-061981c054c8", // A unique token used within your session
"components":[{"type":"label","text":"Hello world"}] // Display some text
}
The packets you send will be similar each time, including two required entries: a return code and a components entry. These array entries are required in every packet you send to the mobile app. The contents can vary.
{
"rc":0, // Just a return code
"components":[{"type":"label","text":"Hello world"}] // Display some text
}
The packets you receive will be similar each time, including at least two entries that will always be included: the method and the token. (The token is not included in the initialisation packet).
{
"method":"addCustomer", // The function to run
"token":"08829e57-56ec-42a8-8b84-061981c054c8" // Always check your token is valid
}
{
"align":"left"
}
{
"autotext":true
}
{
"background":"#ffffff"
}
{
"button":{"position":"left", "icon":"hamburger.png"}
}
{
"cancel":"showCustomer"
}
{
"cancelNavigation":"Annuler"
}
{
"cell":{"icon":"Iconfieldname", "text":"Textfieldname", "method":"Methodfieldname"}
"cell":{"display":"CustomerName"}
}
{
"clickRow":"selectCustomer"
}
{
"color":"#000000"
}
{
"components":[{"type":"label", "text":"Hello world"}]
}
{
"components":[{"type":"button", "text":"Okay", "method":"setOkay"}]
}
{
"components":[{"type":"checkbox", "title":"Current customer", "value":true}]
}
{
"components":[{"type":"date", "title":"Invoice date", "value":"2025-01-20"}]
}
{
"components":[{
"type":"form",
"title":"Add a customer",
"save":"saveCustomer",
"components":[{...}]
}]
}
{
"components":[{"type":"label", "text":"Hello world"}]
}
{
"components":[{"type":"image", "name":"logo.png"}]
}
{
"components":[{
"type":"navigation",
"slidefrom":"left",
"data":[{"text":"Help", "method":"callHelp"
}]
}]
}
{
"components":[{"type":"password", "title":"Password"}]
}
{
"components":[{"type":"scrollview", "text":"Carpe diem..."}]
}
{
"components":[{
"type":"section",
"title":"Name",
"components":[{...}]
}]
}
{
"components":[{
"type":"select",
"title":"Category",
"multi":false,
"options":{1:"A", 2:"B", 3:"C"},
"values":{1:false, 2:true, 3:false}
}]
}
{
"components":[{
"type":"table",
"refresh":"Pull to update list",
"data":{"dynamic":"listCustomers"}
}]
}
{
"components":[{"type":"textbox", "title":"Description", "value":"Part 23/5"}]
}
{
"components":[{
"type":"textview",
"title":"Content",
"value":"It was the best of times, it was the worst of times..."
}]
}
{
"components":[{
"type":"web",
"data":{"html":"Hello world
"}
}]
}
{
"effects":{"shade%":50, "shrink%":20}
}
{
"data":{"dynamic":"retrieveCustomers"}
}
{
"focus":"customer_name"
}
{
"font":"Arial"
}
{
"fontsize":"16"
}
{
"id":"Customer name text field"
}
{
"images":{"url":"https://my.app/resources/images/", "type":"image"}
}
{
"initialHeight":120
}
{
"method":"listCustomers"
}
{
"multi":false
}
{
"name":"customer_name"
}
{
"onEnter":"setOkay"
}
{
"options":{123:"John", 234:"Mary", 345:"Fred"}
}
{
"placeholder":"Enter the students first name"
}
{
"rc":"Failed to update customer entry"
}
{
"refresh":"Pull to refresh"
}
{
"save":"saveCustomer"
}
{
"saveNavigation":"Sauvegarder"
}
{
"setDefaults":{"font":"Arial", "fontsize":12}
}
{
"size":{"x":0, "y":0, "width":100, "height":100}
}
The values can be any mix of three types. (A) The first type is a logical pixel definition, ie where
x = 10 would indicate 10 pixels from the left hand margin of the screen. (B) The second type is a percentage
of the available window, ie where x% = 10 would indicate a position 10% of the available width from the left
hand margin. (C) The third type is a relative position where we can specify an offset from the previous
component, ie where x+ = 10 would indicate a position of 10 pixels beyond the previous component's right
margin.
{
"size":{"center-x":1, "y":100, "width%":90, "height":150}
"size":{"center-x":1, "y+":10, "width%":90, "height":50}
}
{
"slidefrom":"left"
}
{
"text":"Any text"
}
{
"time":1344762534
}
{
"title":"Customer name"
}
{
"token":"08829e57-56ec-42a8-8b84-061981c054c8"
}
{
"value":"2025-01-20"
}
{
"options":{123:"John", 234:"Mary", 345:"Fred"}
"values":{123:false, 234:true, 345:false}
}
{
"version":"P1.213"
}