Terminal - Create/Update registration

API Url

Used for each user action and might return a new dialogue/transition if the registration selected has multiple "steps" required.

PUT
http://localhost:16010/ProMarkREST/rest/Terminal/registrations

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.

    geolocationoptionalObject

Object containing geolocation coordinates of the client.

      latitudeNumber

Latitude with double precission.

      longitudeNumber

Longitude with double precission.

    selectionObject

Object containing the user selection.

      actionNumber

Action that is performed (0: Standard input, 1: Cancel, 2: Timeout, 3: Key-down, 4: Key-up).

Size range: 0-4
      typeNumber

Selection type take from 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
      valueString

The user selection. If selection.type = 7, then "keys.id,keys.number". If selection.type = 4, then ISO-8601 string. If selection.type = 8, then "hh:mm" as string.

    timeStampoptionalDate

Client timestamp including timezone as ISO-8601 string.

    stateObject[]

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

Request example when pressing "Absence" on terminal keyboard:

{
"request": {
"data": {
"selection": {
"action": 0,
"type": 7,
"value": "AB,0"
},
"geolocation": {
"latitude": 0.0,
"longitude": 0.0
},
"state": [...]
}
}
}

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 after pressing "Absence" on terminal keyboard:

HTTP/1.1 200 OK
{
"response": {
"data": {
"info": {
"display": 0
},
"prompt": {
"type": 4,
"title": "First absence day:",
"message": "",
"tempMessage": "",
"defaultValue": "2017-01-05",
"mandatory" : false,
"timeout": 30
},
"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.