General - Get reasons
API Url
Used for loading reasons depending on request. Employee restrictions will be applied on the returned reasons.
http://localhost:16010/ProMarkREST/rest/General/employees/{empId}/reasons
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. |
Path parameters
| Field | Type | Description |
|---|---|---|
empIdoptional | String | Employee Identifier |
Query parameters
| Field | Type | Description |
|---|---|---|
absenceTypeoptional | String | Absence type for which you need the reason list (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). (Used only if type is "AA") |
dateoptional | Date | Attendance date for which you need to insert the request. Default is TODAY. |
transSeqoptional | Number | Identifier of the registration you are querying for. It will be added to the results in case it's missing, even if the employee does not ususally have access to it (might be set by manager). |
typeoptional | String | Reason type for which you need the reason list ("CIE": Clock-in early, "CIL": Clock-in late, "CIA": Clock-in again, "CIS": Clock-in fixed, "COE": Clock-out early,"COL": Clock-out late, "COS": Clock-out fixed), "ESR": Employee shift rating, "AA": Absence (by default). |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| reasons | Object[] | Collection of reasons. |
allowDistributionoptional | Logical | I have the option to choose more than one secondary reason for time distribution. |
backColoroptional | String | The reason backcolor as HEX (without #). |
| code | String | The reason code (identifier). |
defaultEndTimeoptional | Number | Default interval end time in seconds after midnight. Only for 'useInterval' = true. |
defaultHoursoptional | Number | Default hours in seconds. Only for 'useInterval' = false && 'percent' = undefined. |
defaultStartTimeoptional | Number | Default interval start time in seconds after midnight. Only for 'useInterval' = true. |
| description | String | The reason description. |
extraDataTypeoptional | String | Extra data answear type(0=Not used, 1=Free text, 2=Normal time interval, 3=Secondary reason). |
foreColoroptional | String | The reason forecolor as HEX (without #). |
percentoptional | Number | Percent out of normal time. There are reasons where absence time is set-up as beging a percent out of the normal time, so user does not need to insert the absence hours. |
projectTimeoptional | Boolean | If absence reason is allowed to have Project time or not. |
questionoptional | String | Extra data question. |
scopeoptional | Number | Reason scope for absence reasons (0: All day, 1: Partial, 2: Both). |
secondaryReasonGroupoptional | Object[] | Secondary reason group. |
secondaryReasonsoptional | Object[] | Collection of secondary reasons. |
| description | String | Secondary reason description. |
| id | String | Secondary reason identifier. |
| shortDescription | String | The reason short description. |
| type | String | The type of reason. |
useIntervaloptional | Boolean | true= Enter absence time as time interval instead of absence hours. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example on clock-in early reasons:
HTTP/1.1 200 OK{"response": {"data": {"reasons": [{"type": "CIE","code": "BS","description": "Baby sickness","shortDescription": "BS","question": "Secondary reason","extraDataType": 3,"allowDistribution": false,"secondaryReasons": [{"id": 2153649592,"description": "Temperature is between 38 - 40 degrees"},{"id": 2153649593,"description": "Temperature is between 40 - 99 degrees"}]}]},"errorCode": 0,"errorMessage": ""}}
Success example on absence reasons:
HTTP/1.1 200 OK{"response": {"data": {"reasons": [{"type": "AA","code": "HF","description": "Half-day holiday","shortDescription": "Half","foreColor": "FFFF00","backColor": "808000","extraDataType": 0,"percent": 50},{"type": "AA","code": "SS","description": "Sickness","shortDescription": "Sick","foreColor": "FFFF00","backColor": "FF0000","extraDataType": 0,"useInterval": false,"projectTime": true}]},"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. |
Error example:
HTTP/1.1 404 Not found{"response": {"data": {},"errorCode": 75,"errorMessage": "Employee does not exist"}}