Set positions for resources

post

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

This operation updates resource positions for the specified resources.

Note:A maximum of 300 items are allowed in one request.

Request

Body ()
Root Schema : Collection of Resource Positions
Type: object
Title: Collection of Resource Positions
The collection of resource positions.
Show Source
  • Items
    Title: Items
    Maximum Number of Items: 300
    An array of items containing the position information of one or more resources.
Nested Schema : Items
Type: array
Title: Items
Maximum Number of Items: 300
An array of items containing the position information of one or more resources.
Show Source
Nested Schema : Set Resources Position Request Item
Type: object
Title: Set Resources Position Request Item
The request body parameters of this operation.
Show Source
  • Title: Accuracy
    Minimum Value: 0
    The accuracy of the position in meters.
  • Title: Altitude
    Minimum Value: 0
    The altitude of the position (in meters) above the World Geodetic System (WGS) 84 reference ellipsoid.
  • Title: Direction
    Minimum Value: 0
    Maximum Value: 360
    The direction (in degrees) in which the vehicle is headed. Only one digit after the decimal point is considered.
  • Title: Latitude
    Minimum Value: -90
    Maximum Value: 90
    The latitude coordinate of the resource position. A maximum of five digits after the decimal point are considered.
  • Title: Longitude
    Minimum Value: -180
    Maximum Value: 180
    The longitude coordinate of the resource position. A maximum of five digits after the decimal point are considered.
  • Title: Resource ID
    The external identifier of the resource.
  • Title: Speed
    Minimum Value: 0
    The vehicle speed in meters per second. Only one digit after the decimal point is considered.
  • Title: Time
    The date in the Internet Date-Time format or integer UNIX timestamp. For example, 2016-09-20T11:37:29Z or 1476267764.
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : Summary of Processed Points
Type: object
Title: Summary of Processed Points
The summary of the successfully processed items and the failed items.
Show Source
Nested Schema : Errors
Type: array
Title: Errors
The list of failed items with their corresponding error messages.
Show Source
Nested Schema : Error
Type: object
Title: Error
The details of the error.
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 set resource positions for specified resources by submitting a POST request on the REST resource using cURL:

cURL Command Example

curl -X 'POST' \
     https://<instance_name>.etadirect.com/rest/ofscCore/v1/resources/custom-actions/setPositions \
     -H 'Authorization: Bearer eyJ0eXAiO...rest of the access token skipped for brevity' \
     -H 'Content-Type: application/json' \
     --data-binary '{
  	"items": [
    	{
     		"resourceId": "set_position3",
      		"time": "2018-06-27T09:00:40+0300",
      		"lat": 49.9770569,
      		"lng": 36.277882899999994
    	},
    	{
     		"resourceId": "set_position4",
     	 	"time": "2018-06-27T09:00:57+0300",
      		"lat": 49.9780569,
      		"lng": 36.27888289999999
    	}
  ]
}'

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.

{
    "itemsProcessed": 2,
    "itemsFailed": 0,
    "links": [
        {
            "rel": "canonical",
            "href": "https://<instance_name>.etadirect.com/rest/ofscCore/v1/resources/custom-actions/setPositions"
        }
    ]
}
Back to Top