Get last known positions of resources

get

/rest/ofscCore/v1/resources/custom-actions/lastKnownPositions

This operation retrieves the last known position of the specified resources.

Note: The maximum number of resources that can be specified in one request is 100.

Request

Query Parameters
  • Collection Format: csv
    The comma-separated string of resource IDs as per swagger CSV format. For example, john.smith,scott.tiger.
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : Last known Positions of the Resources
Type: object
Title: Last known Positions of the Resources
The collection of the last known positions of the specified resources. The collection also includes error information.
Show Source
Nested Schema : Items
Type: array
Title: Items
The array of resource IDs with their last known position information.
Show Source
Nested Schema : Last Known Position
Type: object
Title: Last Known Position
The last known position of the resource.
Show Source

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 the last known position of the specified resources 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/custom-actions/lastKnownPositions?resources=get_position1,get_position2,get_position3,not_existing_id \
  -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": 4,
    "items": [
        {
            "resourceId": "not_existing_id",
            "errorMessage": "Resource not found"
        },
        {
            "resourceId": "get_position1",
            "time": "2018-06-27T06:05:18+0000",
            "lat": 49.98106,
            "lng": 36.28188
        },
        {
            "resourceId": "get_position2",
            "time": "2018-06-27T06:06:05+0000",
            "lat": 49.98206,
            "lng": 36.28288
        },
        {
            "resourceId": "get_position3",
            "errorMessage": "Last known position is not found for resource"
        }
    ],
    "links": [
        {
            "rel": "canonical",
            "href": "https://<instance_name>.etadirect.com/rest/ofscCore/v1/resources/custom-actions/lastKnownPositions?resources=get_position1%2Cget_position2%2Cget_position3%2Cnot_existing_id"
        }
    ]
}
Back to Top