Mileage - Create new route
API Url
Used for creating a new mileage route.
POST
http://localhost:16010/ProMarkREST/rest/Mileage/employees/{emp_id}/routes
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. |
| routes | Object[] | Collection of routes |
| distance | Number | Distance of a route |
| from | String | Starting position of a route. |
| name | String | A name for the route |
| to | String | Ending position of a route. |
viaoptional | String | Alternate route. |
Request example:
{"request": {"data": {"routes": [{"name": "KICKOFF","from": "Bucharest","to": "Copenhagen","distance" : 2137}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| routes | Object[] | Collection of routes |
| distance | Number | Distance of a route |
| from | String | Starting position of a route. |
| id | Number | Unique id for a route |
| name | String | A name for the route |
| to | String | Ending position of a route. |
viaoptional | String | Alternate route. |
| 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" |
Success example:
HTTP/1.1 200 OK{"response": {"data": {"routes": [{"id": 123424,"name": "KICKOFF""from": "Bucharest","to": "Copenhagen","distance" : 2137}]},"errorCode": 0,"errorMessage": ""}}
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": 33"errorMessage": "Route already exists"}}