Expense - Post travel details

API Url

Used for creating single mileage data.

POST
http://localhost:16010/ProMarkREST/rest/Mileage/employees/{emp_id}/travel-details

Permissions: user

Path parameters

FieldTypeDescription
emp_idString

Employee ID.

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    expensesObject[]

Collection of expenses.

      activityIdoptionalString

Activity Id.

      departmentIdoptionalString

Department Id.

      descriptionoptionalString

Description.

      endTimeDatetime

Date time of end period

      projectIdoptionalString

Project Id.

      questionsoptionalObject[]

Collection of questions.

        answerString

The answer to the question.

        answerDescriptionString

The answer description for those questions that are supplied also with a list of values.

        idString

Unique identifier for the question.

        labelString

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

      startTimeDatetime

Date time of start period

      travelDetailsObject[]

Collection of travel details to be created

        endTimeDatetime

End time of detail.

        entryNoNumber

Travel detail unique number per transaction.

        mealsBoolean[3]

Collection of booleans representing if a meal has been taken or not

        purposeoptionalString

Optional comments about the travel.

        startTimeDatetime

Start time of detail.

        supplementIdoptionalString

Supplement id if needed.

Request example:

{
"request": {
"data": {
"expenses":[
{
"startDate": "2017-10-01T08:00:00.000",
"endDate": "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",
"answerDescription": "2018 Budget"
},
{
"id": "1",
"order": 2,
"answer": "Magnus A/S"
}
]
}
]
}
}
}

Success example:

HTTP/1.1 200 OK
{
"response": {
"errorCode": 0,
"errorMessage": ""
}
}

Error 4xx

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.

Error example:

{
"response": {
"errorCode": 5,
"errorMessage": "No employees"
}
}