Expense - Put mileages
API Url
Used for updating single mileage data.
http://localhost:16010/ProMarkREST/rest/Mileage/employees/{emp_id}/mileages
Permissions: user
Path parameters
| Field | Type | Description |
|---|---|---|
| emp_id | String | Employee ID. |
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| mileages | Object[] | Collection of mileages to be updated |
| 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. |
projectDescoptional | String | Project description. |
projectIdoptional | String | Project Id. |
questionsoptional | Object[] | Collection of questions. |
| id | String | Unique identifier for the question. |
| label | String | Label to display on the question. Not to be changed on the client! |
| roundtrip | Boolean | If the mileage includes the return trip too. |
supplementsoptional | Object[] | A colection of supplements |
| id | String | Supplement unique id |
| type | Number | Supplement type. |
| to | String | Ending position of a route. |
| transSeq | Number | Mileage transaction unique number if updated |
viaoptional | String | Alternate route. |
| answer | String | The answer to the question. |
Request example:
{"request": {"data": {"mileages": [{"transSeq": 2193120,"carRegNo": "B-04-AIU","carType": 1,"accountId": "001","roundtrip": true,"comment": "I had a flat tire on the way","from": "Bucharest","to": "Copenhagen","distance" : 2137,"supplements": [{"id": "Supplement1","type": 1}] ,"questions": [{"id": "2","order": 1,"label": "Number of persons","answer": "6"},{"id": "1","order": 2,"label": "Client name","answer": "Magnus"}]}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
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:
{"response": {"errorCode": 5,"errorMessage": "No employees"}}