ProJect - Update registrations

API Url

Used for updating batch project registrations except time via a wizard-like questionnaire.

PUT
http://localhost:16010/ProMarkREST/rest/ProJect/registrations-wizard

Permissions: user

Query parameters

FieldTypeDescription
onlyChangeProjAcoptionalBoolean

true = only Project and activity will be changed.

transSeqoptionalString

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

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    completeBoolean

true = All questions are answered, so save!

    questionsObject[]

Collection with questions and answers used in the wizard. This is basically a carrier (in-out) collection between client-server.

      answerString

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 '/'.

      autoSelectoptionalBoolean

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!

      callBackOnChangeBoolean

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!

      dataTypeNumber

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!

Size range: 0-10
      extraInfoIdoptionalString

The identifier of the extra info. Can be used for external lookups on extra info values. Not to be changed on the client!

      inputTypeNumber

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!

Size range: 0-10
      isMandatoryBoolean

true = It is mandatory to enter an answer (select a value) on the question. Not to be changed on the client!

      isNewBoolean

true = It's a new question that needs to be presented. Not to be changed on the client!

      labelString

Label to display on the question. Not to be changed on the client!

      lookupURIoptionalString

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!

      orderNumber

Order of question. Sort by this value. Not to be changed on the client!

      orgAnsweroptionalString

In case a registration is to be changed, this field contains the original answer. Do not change on the client!

      typeNumber

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!

Size range: 0-6
      valueChangedBoolean

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'.

      valuesoptionalObject[]

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!

        descriptionString

The Description that should be displayed in the list for selection.

        displayIdString

The text to be displayed for selected items. It might be different than 'internalId'.

        internalIdString

This is the answer value that needs to be filled into 'answer' and sent to the server. Not to be displayed.

        sorNoNumber

Order of values to select from.

    registrationsoptionalObject[]

The object containing the daily time to be registered.

      attendanceDateDate

Date when registration is to be registered, as ISO-8601.

      endTimeNumber

Registration time end. Used when project time is registered as a time interval, expressed in seconds before/after midnight and relative to 'attendanceDate'.

      noteoptionalString

Comment or notes on the registration.

      readOnlyBoolean

true = Registration cannot be changed, and neither the note.

      registeredTimeNumber

Registration time expressed in seconds (duration).

      startTimeNumber

Registration time start. Used when project time is registered as a time interval, expressed in seconds before/after midnight and relative to 'attendanceDate'.

      transSeqNumber

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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    completeBoolean

true = All questions are answered, user can save!

    questionsObject[]

Collection with questions and answers used in the wizard. This is basically a carrier (in-out) collection between client-server.

      answerString

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 '/'.

      autoSelectoptionalBoolean

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.

      callBackOnChangeBoolean

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.

      dataTypeNumber

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).

Size range: 0-10
      extraInfoIdoptionalString

The identifier of the extra info. Can be used for external lookups on extra info values.

      inputTypeNumber

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).

Size range: 0-10
      isMandatoryBoolean

true = It is mandatory to enter an answer (select a value) on the question.

      isNewBoolean

true = It's a new question that needs to be presented.

      labelString

Label to display on the question.

      lookupURIoptionalString

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.

      orderNumber

Order of question. Sort by this value.

      orgAnsweroptionalString

In case a registration is to be changed, this field contains the original answer.

      typeNumber

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.

Size range: 0-6
      valueChangedBoolean

The server will always reset it to 'false' in the response.

      valuesoptionalObject[]

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.

        descriptionString

The Description that should be displayed in the list for selection.

        displayIdString

The text to be displayed for selected items. It might be different than 'internalId'.

        internalIdString

This is the answer value that needs to be filled into 'answer' and sent to the server.

        sorNoNumber

Order of values to select from.

    registrationsoptionalObject[]

The object containing the daily time to be registered.

      attendanceDateDate

Date when registration is to be registered, as ISO-8601.

      endTimeNumber

Registration time end. Used when project time is registered as a time interval, expressed in seconds before/after midnight and relative to 'attendanceDate'.

      noteoptionalString

Comment or notes on the registration.

      readOnlyBoolean

true = Registration cannot be changed, and neither the note.

      registeredTimeNumber

Registration time expressed in seconds (duration).

      startTimeNumber

Registration time start. Used when project time is registered as a time interval, expressed in seconds before/after midnight and relative to 'attendanceDate'.

      transSeqNumber

The unique transaction identifier. For new registrations needs to be -1.

      useIntervalBoolean

true = Registration should use a interval

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.