Expense - Put travel details

API Url

Used for creating single mileage data.

PUT
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.

      activityDescoptionalString

Activity description.

      activityIdoptionalString

Activity Id.

      departmentDescoptionalString

Department description.

      departmentIdoptionalString

Department Id.

      descriptionoptionalString

Description.

      endTimeDatetime

Date time of end period

      projectDescoptionalString

Project description.

      projectIdoptionalString

Project Id.

      questionsoptionalObject[]

Collection of questions.

        answerString

The answer to the question.

        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

      transSeqInteger

Transaction unique number-not updatable

      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":[
{
"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

FieldTypeDescription
responseObject

Main object containing the response data.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"warning""info"

Success example:

{
"response": {
"errorCode": 0,
"errorMessage": ""
}
}

Error 4xx

FieldTypeDescription
responseObject

Main object containing the response data.

  errorCodeNumber

Error code.

  errorMessageString

Error description.

Error example:

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