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
Query Parameters
  • 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.
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
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
Nested Schema : Items
Type: array
Title: Items
The array of items containing the resource's position history for the specified date.
Show Source
Nested Schema : Resource Position
Type: object
Title: Resource Position
The array of objects that contain position information of the resource.
Show Source
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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).

  • 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.
  • 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.
Body ()
Root Schema : Error
Type: object
Error response
Show Source
Back to Top

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>.etadirect.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>.etadirect.com/rest/ofscCore/v1/resources/get_resource_track/positionHistory?date=2018-06-27"
        }
    ]
}
Back to Top