Get position history of a resource
get
/rest/ofscCore/v1/resources/{resourceId}/positionHistory
This operation retrieves the position history of the specified resource for the specified date.
Request
Path Parameters
-
resourceId(required): string
The unique identifier of the resource.
Query Parameters
-
date(required): string(date)
The date for which the resource position history is retrieved. For example, 2016-09-01. The date is in the time zone of the resource. Specify the date in YYYY-MM-DD format.
Response
Supported Media Types
- application/json
200 Response
This section describes the 200 status response for this operation.
Root Schema : Positions History of a Resource
Type:
objectTitle:
Positions History of a ResourceThe collection of historical positions of the specified resource for the specified date.
Show Source
-
items:
array Items
Title:
ItemsThe array of items containing the resource's position history for the specified date. -
totalResults:
integer
Title:
Total ResultsThe total number of resource position items returned by the operation.
Nested Schema : Items
Type:
arrayTitle:
ItemsThe array of items containing the resource's position history for the specified date.
Show Source
-
Array of:
object Resource Position
Title:
Resource PositionThe array of objects that contain position information of the resource.
Nested Schema : Resource Position
Type:
objectTitle:
Resource PositionThe array of objects that contain position information of the resource.
Show Source
-
acc:
number
Title:
AccuracyMinimum Value:0The accuracy of the position in meters. The accuracy is not retrieved, if it is not set for the position. -
alt:
number
Title:
AltitudeMinimum Value:0The altitude of the position (in meters) above the World Geodetic System (WGS) 84 reference ellipsoid. The altitude is not retrieved, if it is not set for the position. -
dir:
number
Title:
DirectionMinimum Value:0Maximum Value:360The direction (in degrees) in which the vehicle is headed. The direction is not retrieved, if it is not set for the position. -
i:
number
Title:
DurationThe duration of the position in minutes. A position has a duration when several positions in close proximity are grouped into one. The duration is not returned when the duration is zero. -
lat(required):
number
Title:
LatitudeMinimum Value:-90Maximum Value:90The latitude coordinate of the position. A maximum of five digits after the decimal point are returned. -
lng(required):
number
Title:
LongitudeMinimum Value:-180Maximum Value:180The longitude coordinate of the position. A maximum of five digits after the decimal point are returned. -
s:
string
Title:
StatusAllowed Values:[ "earlyStart", "lateFinish", "leftLocation", "idle" ]The status of the position. Possible values:- earlyStart: The activity was started far from its location (red color on map)
- lateFinish: The activity was completed far??from its location??(red color on map)
- leftLocation: The resource left the activity location during work time (red color on map)
- idle: The resource was idle (yellow color on map)
The status is not returned when the status is normal??(blue color on map).
-
spd:
number
Title:
SpeedMinimum Value:0The vehicle speed in meters per second. The speed is not retrieved, if it is not set for the position. -
time(required):
string(timestamp-date-time-iso8601)
Title:
TimeThe date in the??Internet Date-Time format. For example, 2018-06-27T06:06:05+0000.
Default Response
This section describes the default error response for this operation.
Root Schema : Error
Type:
Show Source
object-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
Examples
The following example shows how to retrieve position history for a specific resource for a specified date by submitting a GET request on the REST resource using cURL:
cURL command Example
curl -X GET \ https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/get_resource_track/positionHistory?date=2018-06-27 \ -H 'Authorization: Bearer eyJ0eXAiO...rest of the access token skipped for brevity'
Response Header Example
The following shows an example of the response header.
HTTP/1.1 200 OK Server: nginx/1.2.7 Date: Wed, 27 Jun 2018 12:44:50 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive
Response Body Example
The following shows an example of the response body in JSON format.
{
"totalResults": 3,
"items": [
{
"time": "2018-06-27T06:00:45+0000",
"lat": 49.97706,
"lng": 36.27788
},
{
"time": "2018-06-27T06:01:20+0000",
"lat": 49.97706,
"lng": 36.27788
},
{
"time": "2018-06-27T06:01:53+0000",
"lat": 49.97806,
"lng": 36.27888
}
],
"links": [
{
"rel": "canonical",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/get_resource_track/positionHistory?date=2018-06-27"
}
]
}