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:
object
Title:
Positions History of a Resource
The collection of historical positions of the specified resource for the specified date.
Show Source
-
items:
array Items
Title:
Items
The array of items containing the resource's position history for the specified date. -
totalResults:
integer
Title:
Total Results
The total number of resource position items returned by the operation.
Nested Schema : Items
Type:
array
Title:
Items
The array of items containing the resource's position history for the specified date.
Show Source
-
Array of:
object Resource Position
Title:
Resource Position
The array of objects that contain position information of the resource.
Nested Schema : Resource Position
Type:
object
Title:
Resource Position
The array of objects that contain position information of the resource.
Show Source
-
acc:
number
Title:
Accuracy
Minimum Value:0
The accuracy of the position in meters. The accuracy is not retrieved, if it is not set for the position. -
alt:
number
Title:
Altitude
Minimum Value:0
The 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:
Direction
Minimum Value:0
Maximum Value:360
The 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:
Duration
The 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:
Latitude
Minimum Value:-90
Maximum Value:90
The latitude coordinate of the position. A maximum of five digits after the decimal point are returned. -
lng(required):
number
Title:
Longitude
Minimum Value:-180
Maximum Value:180
The longitude coordinate of the position. A maximum of five digits after the decimal point are returned. -
s:
string
Title:
Status
Allowed 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:
Speed
Minimum Value:0
The 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:
Time
The 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" } ] }