ProJect - Update registrations
API Url
Used for updating batch project registrations except time via a wizard-like questionnaire.
http://localhost:16010/ProMarkREST/rest/ProJect/registrations-wizard
Permissions: user
Query parameters
| Field | Type | Description |
|---|---|---|
onlyChangeProjAcoptional | Boolean | true = only Project and activity will be changed. |
transSeqoptional | String | List with comma delimiter of transaction numbers to be changed. Use it if you want to change not only time or note, but also project/activity/time type/reporting dimensions. |
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| complete | Boolean | true = All questions are answered, so save! |
| questions | Object[] | Collection with questions and answers used in the wizard. This is basically a carrier (in-out) collection between client-server. |
| answer | String | This is the answer to the question and needs to be filled by the client. For dates, it's the ISO-8601 string. For date intervals, it's ISO-8601 dates separated by '/'. |
autoSelectoptional | Boolean | true = If there is a single selectable answer (value), it is autoselected by the server. The client can choose to show the answer already selected, or hide the question entirely. Do not change by the client! |
| callBackOnChange | Boolean | true = After value is changed, do a callback to the server with the entire collection. This is because subsequent values depend on the question answer. Not to be changed on the client! |
| dataType | Number | Data type of the question (0: Text, 1: Integer, 2: Decimal, 3: Boolean: 4: Date. 5: Time of day, 6: Date and time, 7: Time duration, 8: Time interval, 9: Date interval, 10: Date and time interval). Not to be changed on the client! 0-10 |
extraInfoIdoptional | String | The identifier of the extra info. Can be used for external lookups on extra info values. Not to be changed on the client! |
| inputType | Number | Suggestion with controll type to display on the client (0: Standard input, depends on 'dataType', 1: Fill-in, 2: Drop-down, 3: Combo-box, 4: Text area, 5: Radio-set, 6: Check-box, 7: Selection list, 8: Calendar, 9: Calendar drop-down, 10: External lookup URI). Not to be changed on the client! 0-10 |
| isMandatory | Boolean | true = It is mandatory to enter an answer (select a value) on the question. Not to be changed on the client! |
| isNew | Boolean | true = It's a new question that needs to be presented. Not to be changed on the client! |
| label | String | Label to display on the question. Not to be changed on the client! |
lookupURIoptional | String | If collection of 'values' is not sent with the request, then use this URI to bind to remote data. Tipically this is used for large amounts of data, where server paging and server filtering is enabled. Be aware, data schema might be different, depending on external lookup resource. Do not change by the client! |
| order | Number | Order of question. Sort by this value. Not to be changed on the client! |
orgAnsweroptional | String | In case a registration is to be changed, this field contains the original answer. Do not change on the client! |
| type | Number | Type of question (0: Registration period, 1: Project, 2: Activity, 3: Split dates, 4: Piecework, 5: Time type, 6: Extra Info). Not all questions are part of the wizard and depends on setup and selected values. Not to be changed on the client! 0-6 |
| valueChanged | Boolean | The client needs to always set this to 'true' when the question answer is selected or changed! The server will always reset it to 'false'. |
valuesoptional | Object[] | Collection of possible selectable values. It's used when user needs to select among a list of values, tipically for 'inputType' = 2, 3 and 7. Do not change by the client! |
| description | String | The Description that should be displayed in the list for selection. |
| displayId | String | The text to be displayed for selected items. It might be different than 'internalId'. |
| internalId | String | This is the answer value that needs to be filled into 'answer' and sent to the server. Not to be displayed. |
| sorNo | Number | Order of values to select from. |
registrationsoptional | Object[] | The object containing the daily time to be registered. |
| attendanceDate | Date | Date when registration is to be registered, as ISO-8601. |
| endTime | Number | Registration time end. Used when project time is registered as a time interval, expressed in seconds before/after midnight and relative to 'attendanceDate'. |
noteoptional | String | Comment or notes on the registration. |
| readOnly | Boolean | true = Registration cannot be changed, and neither the note. |
| registeredTime | Number | Registration time expressed in seconds (duration). |
| startTime | Number | Registration time start. Used when project time is registered as a time interval, expressed in seconds before/after midnight and relative to 'attendanceDate'. |
| transSeq | Number | The unique transaction identifier. For new registrations needs to be -1. |
Request example:
{"request": {"data": {"complete": false,"questions": [{"order": 1,"type": 1,"label": "Project","isMandatory": true,"inputType": 10,"dataType": 0,"isNew": true,"callBackOnChange": true,"answer": "AARSLEFF","valueChanged": true}],"registrations": [{"attendanceDate": "2017-05-15","registeredTime": 0,"startTime": 0,"endTime": 0,"transSeq": -1}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| complete | Boolean | true = All questions are answered, user can save! |
| questions | Object[] | Collection with questions and answers used in the wizard. This is basically a carrier (in-out) collection between client-server. |
| answer | String | This is the answer to the question and needs to be filled by the client. For dates, it's the ISO-8601 string. For date intervals, it's ISO-8601 dates separated by '/'. |
autoSelectoptional | Boolean | true = If there is a single selectable answer (value), it is autoselected by the server. The client can choose to show the answer already selected, or hide the question entirely. |
| callBackOnChange | Boolean | true = After value is changed, do a callback to the server with the entire collection. This is because subsequent values depend on the question answer. |
| dataType | Number | Data type of the question (0: Text, 1: Integer, 2: Decimal, 3: Boolean: 4: Date. 5: Time of day, 6: Date and time, 7: Time duration, 8: Time interval, 9: Date interval, 10: Date and time interval). 0-10 |
extraInfoIdoptional | String | The identifier of the extra info. Can be used for external lookups on extra info values. |
| inputType | Number | Suggestion with controll type to display on the client (0: Standard input, depends on 'dataType', 1: Fill-in, 2: Drop-down, 3: Combo-box, 4: Text area, 5: Radio-set, 6: Check-box, 7: Selection list, 8: Calendar, 9: Calendar drop-down, 10: External lookup URI). 0-10 |
| isMandatory | Boolean | true = It is mandatory to enter an answer (select a value) on the question. |
| isNew | Boolean | true = It's a new question that needs to be presented. |
| label | String | Label to display on the question. |
lookupURIoptional | String | If collection of 'values' is not sent with the request, then use this URI to bind to remote data. Tipically this is used for large amounts of data, where server paging and server filtering is enabled. Be aware, data schema might be different, depending on external lookup resource. |
| order | Number | Order of question. Sort by this value. |
orgAnsweroptional | String | In case a registration is to be changed, this field contains the original answer. |
| type | Number | Type of question (0: Registration period, 1: Project, 2: Activity, 3: Split dates, 4: Piecework, 5: Time type, 6: Extra Info). Not all questions are part of the wizard and depends on setup and selected values. 0-6 |
| valueChanged | Boolean | The server will always reset it to 'false' in the response. |
valuesoptional | Object[] | Collection of possible selectable values. It's used when user needs to select among a list of values, tipically for 'inputType' = 2, 3 and 7. |
| description | String | The Description that should be displayed in the list for selection. |
| displayId | String | The text to be displayed for selected items. It might be different than 'internalId'. |
| internalId | String | This is the answer value that needs to be filled into 'answer' and sent to the server. |
| sorNo | Number | Order of values to select from. |
registrationsoptional | Object[] | The object containing the daily time to be registered. |
| attendanceDate | Date | Date when registration is to be registered, as ISO-8601. |
| endTime | Number | Registration time end. Used when project time is registered as a time interval, expressed in seconds before/after midnight and relative to 'attendanceDate'. |
noteoptional | String | Comment or notes on the registration. |
| readOnly | Boolean | true = Registration cannot be changed, and neither the note. |
| registeredTime | Number | Registration time expressed in seconds (duration). |
| startTime | Number | Registration time start. Used when project time is registered as a time interval, expressed in seconds before/after midnight and relative to 'attendanceDate'. |
| transSeq | Number | The unique transaction identifier. For new registrations needs to be -1. |
| useInterval | Boolean | true = Registration should use a interval |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Response example when selecting values from list:
{"response": {"data": {"complete": false,"questions": [{"order": 1,"type": 1,"label": "Project","isMandatory": true,"inputType": 10,"dataType": 0,"isNew": true,"callBackOnChange": true,"values": [{"sortNo": 1,"internalID": "Proj#1","displayID": "Project1","description": "Project number 1"}]}],"registrations": [{"attendanceDate": "2017-05-15","registeredTime": 7200,"startTime": 0,"endTime": 0,"note": "I had too much coffee","transSeq": -1"userInterval": false}]}}}
Response example when selecting values from remote URI:
{"response": {"data": {"complete": false,"questions": [{"order": 1,"type": 0,"label": "Period for registration","isMandatory": true,"inputType": 0,"dataType": 9,"isNew": false,"callBackOnChange": true,"answer": "2017-05-15/2017-05-16","orgAnswer": "2017-05-15/2017-05-16"}{"order": 1,"type": 1,"label": "Project","isMandatory": true,"inputType": 10,"dataType": 0,"isNew": true,"callBackOnChange": true,"lookupURI": "/rest/ProJect/projects?mostRecent=true&fields=id,description,ref1"}],"registrations": [{"attendanceDate": "2017-05-15","registeredTime": 0,"startTime": 0,"endTime": 0,"transSeq": -1"userInterval": false},{"attendanceDate": "2017-05-16","registeredTime": 0,"startTime": 0,"endTime": 0,"transSeq": -1"userInterval": false}]}}}
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. |