Expense - Put travel details
API Url
Used for creating single mileage data.
http://localhost:16010/ProMarkREST/rest/Mileage/employees/{emp_id}/travel-details
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. |
| expenses | Object[] | Collection of expenses. |
activityDescoptional | String | Activity description. |
activityIdoptional | String | Activity Id. |
departmentDescoptional | String | Department description. |
departmentIdoptional | String | Department Id. |
descriptionoptional | String | Description. |
| endTime | Datetime | Date time of end period |
projectDescoptional | String | Project description. |
projectIdoptional | String | Project Id. |
questionsoptional | Object[] | Collection of questions. |
| answer | String | The answer to the question. |
| id | String | Unique identifier for the question. |
| label | String | Label to display on the question. Not to be changed on the client! |
| startTime | Datetime | Date time of start period |
| transSeq | Integer | Transaction unique number-not updatable |
| travelDetails | Object[] | Collection of travel details to be created |
| endTime | Datetime | End time of detail. |
| entryNo | Number | Travel detail unique number per transaction. |
| meals | Boolean[3] | Collection of booleans representing if a meal has been taken or not |
purposeoptional | String | Optional comments about the travel. |
| startTime | Datetime | Start time of detail. |
supplementIdoptional | String | Supplement id if needed. |
Request example:
{"request": {"data": {"expenses":[{"transSeq": 1234567,"startTime": "2017-10-01T08:00:00.000","endTime": "2017-10-02T08:00:00.000","travelDetails": [{"entryNo": 3,"supplementId": "AMT","startTime": "2017-09-07T08:00:00.000","endTime": "2017-09-09T00:00:00.000","meals": [false, true, true],"purpose": "I had a flat tire on the way"}],"questions": [{"id": "2","order": 1,"answer": "6"},{"id": "1","order": 2,"answer": "Magnus A/S"}]}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example:
{"response": {"errorCode": 0,"errorMessage": ""}}
Error 4xx
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| errorCode | Number | Error code. |
| errorMessage | String | Error description. |
Error example:
{"response": {"errorCode": 5,"errorMessage": "No employees"}}