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
-
lat(required): number
Minimum Value:
-90
Maximum Value:90
The latitude coordinate of the center point of the specified area. -
limit: integer
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.
-
lng(required): number
Minimum Value:
-180
Maximum Value:180
The longitude coordinate of the center point of the specified area. -
offset: integer
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.
-
radius: number
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. -
timeDiff: number
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).
Response
Supported Media Types
- application/json
200 Response
This section describes the 200 status response for this operation.
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
-
items:
array Items
Title:
Items
The array of resources in the specified area. -
limit:
integer
Title:
Limit
The limit value specified in the request. If the value is not specified in the request or if the specified value is not accepted, then it defaults to 100. -
offset:
integer
Title:
Offset
The offset value specified in the request. -
totalResults:
integer
Title:
Total Results
The total number of items retrieved by the operation.
Nested Schema : Items
Type:
array
Title:
Items
The array of resources in the specified area.
Show Source
-
Array of:
object Resource in Area
Title:
Resource in Area
The resource present within the specified radius and/or time duration.
Nested Schema : Resource in Area
Type:
object
Title:
Resource in Area
The resource present within the specified radius and/or time duration.
Show Source
-
dis:
number
Title:
Distance
The distance (in meters) of the resource from the center point of the area. -
lat:
number
Title:
Latitude
The latitude coordinate of the resource position. A maximum of five digits after the decimal point are returned. -
lng:
number
Title:
Longitude
The longitude coordinate of the resource position. A maximum of five digits after the decimal point are returned. -
resourceId:
string
Title:
Resource ID
The external identifier of the resource. -
time:
string
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.
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 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>.fs.ocs.oraclecloud.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>.fs.ocs.oraclecloud.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>.fs.ocs.oraclecloud.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>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/custom-actions/resourcesInArea?lat=49.831307&lng=23.996903&radius=100000&timeDiff=1440&limit=3&offset=4" } ] }