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.
http://localhost:16010/ProMarkREST/rest/Terminal/registrations
Permissions: user
Request headers
| Field | Type | Description |
|---|---|---|
Accept-Languageoptional | String | =en-GB Language use for localization. |
X-Clientoptional | String | =Client type. "Portal""Mobile""Admin" |
X-Roleoptional | Number | ProMark role (1: Employee, 2: User). {12} |
X-WebPart-Idoptional | Number | Unique web-part identifier. |
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
geolocationoptional | Object | Object containing geolocation coordinates of the client. |
| latitude | Number | Latitude with double precission. |
| longitude | Number | Longitude with double precission. |
| selection | Object | Object containing the user selection. |
| action | Number | Action that is performed (0: Standard input, 1: Cancel, 2: Timeout, 3: Key-down, 4: Key-up). 0-4 |
| type | Number | 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). 1-13 |
| value | String | 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. |
timeStampoptional | Date | Client timestamp including timezone as ISO-8601 string. |
| state | Object[] | 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
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| info | Object | Object containing terminal informations. |
| display | Number | Info display controller (0: Keep current messages, 1: Show new messages, 0: Clear messages). 0-2 |
messagesoptional | Object[] | Collection of terminal messages. |
| order | Number | Message order. |
| text | String | Message body. |
| prompt | Object | Object containing the user prompt setup for the dialogue/transition. |
| defaultValue | String | The default value of the selection (autoselected value). |
| enableReader | Boolean | Specifies if the card reader is to be enabled |
keysoptional | Object[] | Object containing the keyboard setup. Only if prompt.type = 7. |
| backColor | String | Background color of the key in HEX. |
| enabled | Boolean | true = key is enabled. |
| foreColor | String | Color of label that is displayed on the key in HEX. |
| iconId | String | Icon id for the key. |
| id | String | Key ID. Only used together with keys.number. |
| label | String | Label to be displayed on the key. |
| number | Number | Key number. Only used together with keys.id. |
| order | Number | Key order/sequence. Used for rendering keys in the right order. 1-16 |
| mandatory | Boolean | If a value is mandatory or not. |
| message | String | A message text to be displayed above the user input. |
optionsoptional | Object[] | Object containing selectable values. Only if prompt.type = 2/3/5. |
| description | String | Item description. |
| order | Number | Item order. |
| tempMessage | String | A temporary messate to be displayed above the user input. |
| timeout | Number | Timeout in seconds of the transition, where 0 = no timeout. |
| title | String | The header title to be displayed. |
| type | Number | 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). 1-13 |
| state | Object[] | Object containing the session state. Must not be changed by the client and will not be further described. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "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
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data (empty). |
| errorCode | Number | Error code. |
| errorMessage | String | Error description. |