Terminal - Create terminal session

API Url

Used when initiating the terminal session; will return the first dialogue.

POST
http://localhost:16010/ProMarkREST/rest/Terminal/sessions

Permissions: user

Request headers

FieldTypeDescription
Accept-LanguageoptionalString

=en-GB Language use for localization.

X-ClientoptionalString

=Client type.

Allowed values:"Portal""Mobile""Admin"
X-RoleoptionalNumber

ProMark role (1: Employee, 2: User).

Allowed values:{12}
X-WebPart-IdoptionalNumber

Unique web-part identifier.

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    empNooptionalString

Employee number. If not sent, the employee defined on the portal account will be used.

    terminaloptionalNumber

The terminal ID. If not sent, the terminal id defined on the webpart attribute will be used.

Size range: 2-9999

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    infoObject

Object containing terminal informations.

      displayNumber

Info display controller (0: Keep current messages, 1: Show new messages, 0: Clear messages).

Size range: 0-2
      messagesoptionalObject[]

Collection of terminal messages.

        orderNumber

Message order.

        textString

Message body.

    promptObject

Object containing the user prompt setup for the dialogue/transition.

      defaultValueString

The default value of the selection (autoselected value).

      enableReaderBoolean

Specifies if the card reader is to be enabled

      keysoptionalObject[]

Object containing the keyboard setup. Only if prompt.type = 7.

        backColorString

Background color of the key in HEX.

        enabledBoolean

true = key is enabled.

        foreColorString

Color of label that is displayed on the key in HEX.

        iconIdString

Icon id for the key.

        idString

Key ID. Only used together with keys.number.

        labelString

Label to be displayed on the key.

        numberNumber

Key number. Only used together with keys.id.

        orderNumber

Key order/sequence. Used for rendering keys in the right order.

Size range: 1-16
      mandatoryBoolean

If a value is mandatory or not.

      messageString

A message text to be displayed above the user input.

      optionsoptionalObject[]

Object containing selectable values. Only if prompt.type = 2/3/5.

        descriptionString

Item description.

        orderNumber

Item order.

      tempMessageString

A temporary messate to be displayed above the user input.

      timeoutNumber

Timeout in seconds of the transition, where 0 = no timeout.

      titleString

The header title to be displayed.

      typeNumber

Prompt type (1: Standard input, 2: Select value from selection list, 3: Select value from selection list or enter id, 4: Select a date, 5: Input Yes/No, 6: Confirm (OK/Cancel), 7: Display keyboard, 8: Prompt for time (HHMM), 9: Password input, 10: Multi-line info-display without input, 11: Editor field, 12: Shift to JobDialog, 13: Download a file to display).

Size range: 1-13
    stateObject[]

Object containing the session state. Must not be changed by the client and will not be further described.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"warning""info"

Success example for creating a new session that returns the first transition/dialogue:

HTTP/1.1 200 OK
{
"response": {
"data": {
"info": {
"display": 1,
"messages": [
{
"order": 1,
"text": "John Doe"
},
{
"order": 2,
"text": "Working on ORDER_1"
}
]
},
"prompt": {
"type": 7,
"title": "Select function",
"message": "",
"tempMessage": "",
"defaultValue": "",
"mandatory" : true,
"timeout": 0,
"keys": [
{
"order": 1,
"id": "CI",
"number": 0,
"label": "Clock-&in",
"enabled": true,
"foreColor": "000000",
"backColor": "C0C0C0",
"iconId":"bell"
},
{
"order": 2,
"id": "CO",
"number": 0,
"label": "Clock-out",
"enabled": false,
"foreColor": "000000",
"backColor": "C0C0C0",
"iconId":"clock-in"
},
...
]
},
"state": [...]
},
"errorCode": 0
"errorMessage": ""
}
}

Error 4xx

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.