Expense - Put mileages

API Url

Used for updating single mileage data.

PUT
http://localhost:16010/ProMarkREST/rest/Mileage/employees/{emp_id}/mileages

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.

    mileagesObject[]

Collection of mileages to be updated

      accountIdString

Mileage account id.

      activityDescoptionalString

Activity description.

      activityIdoptionalString

Activity Id.

      attendanceDateDate

Date of mileage expense.

      carRegNoString

License plate of the car.

      carTypeNumber

0: Company car, 1: Private car

      commentoptionalString

A comment for the mileage

      departmentDescoptionalString

Department description.

      departmentIdoptionalString

Department Id.

      descriptionoptionalString

Description.

      distanceNumber

Distance of a route

      fromString

Starting position of a route.

      projectDescoptionalString

Project description.

      projectIdoptionalString

Project Id.

      questionsoptionalObject[]

Collection of questions.

        idString

Unique identifier for the question.

        labelString

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

      roundtripBoolean

If the mileage includes the return trip too.

      supplementsoptionalObject[]

A colection of supplements

        idString

Supplement unique id

        typeNumber

Supplement type.

      toString

Ending position of a route.

      transSeqNumber

Mileage transaction unique number if updated

      viaoptionalString

Alternate route.

        answerString

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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"warning""info"

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"
}
}