Tracking: Retrieving last known position
The Nomadia Field Service last position storage can be requested to retrieve the last known position of every assigned equipments.
Target URL
The web service to call to find last known positions is available on Opti-Time server at: /otgs/rest/v2/exportEntities/json/getEntitiesProperties.json
Call this web service through a POST method.
Request headers
The authentication is achieved through the following HTTP headers:
- Content-Type: application/json
- apptoken: your application token to authenticate on the positions server
Request body
The request body should contain a JSON object to define the exchange model fields of the entity EquipmentPosition to be extracted:
{
"sessionId": "",
"entityName": "EquipmentPosition",
"fieldNames": "EQUIPMENTID,POSITION_DATETIME,RESOURCEID,VEHICLEID,XGEO,YGEO,SPEED,BEARING,STATUS,FLAGS,POSITION_METHOD,ACCURACY,GPS_STATUS,BATTERYLEVEL",
"dateFormat": "dd/MM/yyyy",
"extractionKind": "ALL",
"extractionParam": "",
"extractionAreaParam": "",
"entityId": "",
"appointmentCustomerIds": "",
"appointmentResourceIds": "",
"durationAsTimeFormat": false,
"commonInfo": {
"version": "1",
"key": "",
"userLogin": "login",
"userPassword": "password"
}
}
Response codes
- 200: A list of equipments position was successfully returned
Response body
The response contains a JSON object describing the list of positions such as:
{
"sessionId": "c547082f-1b7c-428a-8fb6-96c86150a717",
"result": {
"success": true,
"detail": "Result set contains 2 elements\n"
},
"rows": {
"row": [
{
"property": [
{
"name": "EQUIPMENTID",
"value": "005"
},
{
"name": "POSITION_DATETIME",
"value": "19/11/2018 11:55"
},
{
"name": "RESOURCEID",
"value": "HR_002"
},
{
"name": "VEHICLEID",
"value": "CAR_001"
},
{
"name": "XGEO",
"value": "2.32121539"
},
{
"name": "YGEO",
"value": "48.79710007"
},
{
"name": "SPEED",
"value": "-1.0"
},
{
"name": "BEARING",
"value": "0"
},
{
"name": "STATUS",
"value": "0"
},
{
"name": "FLAGS",
"value": "14"
},
{
"name": "POSITION_METHOD",
"value": "0"
},
{
"name": "ACCURACY",
"value": "165"
},
{
"name": "GPS_STATUS",
"value": "0"
},
{
"name": "BATTERYLEVEL",
"value": "0"
}
]
},
{
"property": [
{
"name": "EQUIPMENTID",
"value": "004"
},
{
"name": "POSITION_DATETIME",
"value": "19/09/2018 08:34"
},
{
"name": "RESOURCEID",
"value": "HR_015"
},
{
"name": "VEHICLEID",
"value": "CAR_004"
},
{
"name": "XGEO",
"value": "4.750241"
},
{
"name": "YGEO",
"value": "44.28887"
},
{
"name": "SPEED",
"value": "0.0"
},
{
"name": "BEARING",
"value": "0"
},
{
"name": "STATUS",
"value": "0"
},
{
"name": "FLAGS",
"value": "4"
},
{
"name": "POSITION_METHOD",
"value": "0"
},
{
"name": "ACCURACY",
"value": "81"
},
{
"name": "GPS_STATUS",
"value": "0"
},
{
"name": "BATTERYLEVEL",
"value": "0"
}
]
}
]
}
}