Expense - Get all mileages
API Url
Used to get all mileages for an employee.
http://localhost:16010/ProMarkREST/rest/Mileage/mileages
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. |
Query parameters
| Field | Type | Description |
|---|---|---|
endDateoptional | Date | End date for absences, Default : TODAY. |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| mileages | Object[] | Collection of absence intervals. |
| accountDesc | String | Mileage account description. |
| accountId | String | Mileage account id. |
activityDescoptional | String | Activity description. |
activityIdoptional | String | Activity Id. |
| attendanceDate | Date | Date of mileage expense. |
| carRegNo | String | License plate of the car. |
| carType | Number | 0: Company car, 1: Private car |
commentoptional | String | A comment for the mileage |
departmentDescoptional | String | Department description. |
departmentIdoptional | String | Department Id. |
descriptionoptional | String | Description. |
| distance | Number | Distance of a route |
| from | String | Starting position of a route. |
| id | String | Unique identifier for the absence object. |
projectDescoptional | String | Project description. |
projectIdoptional | String | Project Id. |
questionsoptional | Object[] | Collection of questions. |
| answer | String | The answer to the question. |
answerDescriptionoptional | String | The answer description for those questions that are supplied also with a list of values. |
| 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 |
| id | String | Unique identifier for the question. |
| 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! |
| label | String | Label to display on the question. Not to be changed on the client! |
maxValueoptional | Number | Maximum value. Not to be changed on the client! |
minValueoptional | Number | Minimum value. Not to be changed on the client! |
| order | Number | The question order |
| readOnly | Boolean | TRUE = registration is read-only. |
| roundtrip | Logical | If the mileage includes the return trip too. |
supplementsoptional | Object[] | A colection of supplements |
| description | String | Supplement description |
| id | String | Supplement unique id |
| type | Number | Supplement type. |
| to | String | Ending position of a route. |
viaoptional | String | Alternate route. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example:
HTTP/1.1 200 OK{"response": {"data": {"mileages": [{"id": 2193120,"carRegNo": "B-04-AIU","carType": 1,"accountId": "001","accountDesc": "Taxed mileage","roundtrip": true,"comment": "I had a flat tire on the way","from": "Bucharest","to": "Copenhagen","distance" : 2137,"attendanceDate": "2018-09-20","supplements": [{"id": "001","description": "Mileage supplement","type": 8}],"questions": [{"id": "2","order": 1,"label": "Number of persons","isMandatory": false,"inputType": 0,"dataType": 1,"answer": "6","answerDescription": "2018 Budget"},{"id": "1","order": 2,"label": "Client name","isMandatory": true,"inputType": 0,"dataType": 0,"answer": "Magnus A/S"}]}]},"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. |