Get resources in area

get

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

This operation retrieves resources present in an area based on the parameters specified in the request.

Request

Query Parameters
  • Minimum Value: -90
    Maximum Value: 90
    The latitude coordinate of the center point of the specified area.
  • The number of items to be returned in the response. The minimum value that can be specified is 1 and the maximum value that can be specified is 100. If the specified value is greater than 100, zero, or if no value is specified, then it defaults to 100.
  • Minimum Value: -180
    Maximum Value: 180
    The longitude coordinate of the center point of the specified area.
  • The record number from which the retrieval starts. The default value is zero. If no value is specified, then it defaults to zero. The value zero indicates that the retrieval will start from the beginning of the collection.
  • Minimum Value: 0
    The radius (in meters) of the circular area. The center of the circular area is defined by the latitude and longitude coordinates. The maximum value of the radius that can be specified is 100000 meters. The default value is 10000 meters.
  • Minimum Value: 0
    Maximum Value: 1440
    The time duration in minutes until a position is considered as the actual position of the resource. The resources with the last known coordinates older than the specified threshold are not returned in the response. The default value is 60 min. The maximum value is 1440 min (24h).
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : Collection of Resources in Area
Type: object
Title: Collection of Resources in Area
The collection of resources found in the specified area. The items in the collection are sorted by distance from the??center of the specified area. Pagination is supported on this operation and the response contains next and/or previous pagination links.
Show Source
Nested Schema : Items
Type: array
Title: Items
The array of resources in the specified area.
Show Source
Nested Schema : Resource in Area
Type: object
Title: Resource in Area
The resource present within the specified radius and/or time duration.
Show Source
  • Title: Distance
    The distance (in meters) of the resource from the center point of the area.
  • Title: Latitude
    The latitude coordinate of the resource position. A maximum of five digits after the decimal point are returned.
  • Title: Longitude
    The longitude coordinate of the resource position. A maximum of five digits after the decimal point are returned.
  • Title: Resource ID
    The external identifier of the resource.
  • Title: Time
    The date in the internet Date-Time format. For example, 2016-09-20T11:37:29Z.

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 resources for a specified area 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/resourcesInArea?lat=49.831307&lng=23.996903&radius=100000&timeDiff=1440&limit=3&offset=1 \
  -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": 6,
    "limit": 3,
    "offset": 1,
    "items": [
        {
            "resourceId": "get_resources_in_area_distance2",
            "time": "2018-06-27T14:24:38+0000",
            "lat": 49.83225,
            "lng": 23.99662,
            "dis": 107
        },
        {
            "resourceId": "get_resources_in_area_duration4",
            "time": "2018-06-27T11:49:38+0000",
            "lat": 49.83884,
            "lng": 24.02898,
            "dis": 2448
        },
        {
            "resourceId": "get_resources_in_area_distance3",
            "time": "2018-06-27T14:24:38+0000",
            "lat": 49.83884,
            "lng": 24.02898,
            "dis": 2448
        }
    ],
    "links": [
        {
            "rel": "canonical",
            "href": "https://<instance_name>.etadirect.com/rest/ofscCore/v1/resources/custom-actions/resourcesInArea?lat=49.831307&lng=23.996903&radius=100000&timeDiff=1440&limit=3&offset=1"
        },
        {
            "rel": "prev",
            "href": "https://<instance_name>.etadirect.com/rest/ofscCore/v1/resources/custom-actions/resourcesInArea?lat=49.831307&lng=23.996903&radius=100000&timeDiff=1440&limit=3&offset=0"
        },
        {
            "rel": "next",
            "href": "https://<instance_name>.etadirect.com/rest/ofscCore/v1/resources/custom-actions/resourcesInArea?lat=49.831307&lng=23.996903&radius=100000&timeDiff=1440&limit=3&offset=4"
        }
    ]
}
Back to Top