Create a single vehicle

post

/fleetMonitoring/clientapi/v2/vehicles/

This operation creates a new instance of a vehicle.

Request

Supported Media Types
Header Parameters
  • To allow targeting requests to different organizations. The header value should contain the organization identifier(orgId). This header is optional, if not provided orgId will be ORA_DEFAULT_ORG
Body ()
Root Schema : Vehicle_create
Type: object
Show Source
Nested Schema : attributes
Type: array
Vehicle attributes
Show Source
Nested Schema : Attribute_create
Type: object
Show Source
Back to Top

Response

Supported Media Types

202 Response

Successfully processed.
Body ()
Root Schema : Vehicle_receive
Type: object
Show Source
Nested Schema : attributes
Type: array
Vehicle attributes
Show Source
Nested Schema : MetricSnapshot_receive
Type: object
Show Source
Nested Schema : Attribute_receive
Type: object
Show Source
Nested Schema : metricValues
Type: array
The metric values of an entity
Show Source
Nested Schema : MetricValue_receive
Type: object
Show Source
Nested Schema : esAdditionalData
Type: object
Additional Properties Allowed
Show Source
  • A map of the following type: Map<String, String>
Property description was not set
Show Source
Nested Schema : EsJoinFieldValue_receive
Type: object
Show Source
Nested Schema : GeoPosition_receive
Type: object
Show Source
Nested Schema : metadata
Type: object
Additional Properties Allowed
Show Source
  • A map of the following type: Map<String, String>
Property description was not set
Show Source
Nested Schema : params
Type: object
Additional Properties Allowed
Show Source
  • A map of the following type: Map<String, String>
Property description was not set
Show Source
Nested Schema : additionalElements
Type: array
Property description was not set
Show Source

400 Response

Bad Request. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

401 Response

Unauthorized. The request requires user authentication.

403 Response

Forbidden. The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated.

406 Response

Request Not Acceptable. The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.

415 Response

Unsupported Media Type. The request entity has a media type which the server or resource does not support.
Back to Top

Examples

curl -X POST 
   -u <username>:<password>
   -H 'Accept: application/json'
   -H 'Content-Type: application/json'
   https://iotserver/fleetMonitoring/clientapi/v2/vehicles/

Example of Request Body

The following example shows the content of the request body in JSON format:

{  
"name":"TestVehicle",
"vin":"12345",
"registrationNumber":"Reg-01-01-01",
"type":"17E1131D-4AC7-4551-A09B-C473FC3AF25F",
"description":"Test Vehicle",
"year":2017,
"attributes":[
{
"name":"test_attribute_custom",
"value":"value1"
},
{
"name":"Speed",
"value":{
"deviceId":"3192FE29-C248-42BC-9C1E-5B9E78A87AA4",
"deviceModel":"urn:com:oracle:iot:device:obd2",
"messageFormatField":"ora_obd2_vehicle_speed"
}
}
]
}

Example of Response Body

The following example shows the content of the response body in JSON format:

{
"id": "FA1EE482-D601-4720-B4F6-0A338BF16E1C",
"name": "TestVehicle",
"make": "make_name",
"model": "model_name",
"year": 2017,
"status": "UNKNOWN",
"vin": "12345",
"type": "17E1131D-4AC7-4551-A09B-C473FC3AF25F",
"registrationNumber": "Reg-01-01-01",
"attributes": [
{
"name": "test_attribute_custom",
"value": "value1"
},
{
"name": "Speed",
"value": {
"deviceId": "3192FE29-C248-42BC-9C1E-5B9E78A87AA4",
"deviceModel": "urn:com:oracle:iot:device:obd2",
"messageFormatField": "ora_obd2_vehicle_speed"
}
}
],
"registrationTime": 1524555339308,
"registrationTimeAsString": "2018-04-24T07:35:39.308Z",
"lastModifiedTime": 1524555339308,
"lastModifiedTimeAsString": "2018-04-24T07:35:39.308Z",
"lastModifiedBy": "iot",
"description": "Test Vehicle",
"metricValues": [
{
"id": "1c4196cb-a8f9-39f8-95b9-2e2af265f7d2",
"name": "sys_openOutageIncidents",
"entityType": "vehicles",
"eventTime": 1524555339469,
"computedTime": 1524555339469,
"eventTimeAsString": "2018-04-24T07:35:39Z",
"interval": "CURRENT",
"entityId": "FA1EE482-D601-4720-B4F6-0A338BF16E1C",
"type": "KPI",
"lastKnown": false,
"numericValue": 0
},
{
"id": "eb8916d6-b2d5-31a8-9fc0-e83fff45799c",
"name": "sys_fuelConsumed",
"entityType": "vehicles",
"eventTime": 1524555339469,
"computedTime": 1524555339469,
"eventTimeAsString": "2018-04-24T07:35:39Z",
"interval": "CURRENT",
"entityId": "FA1EE482-D601-4720-B4F6-0A338BF16E1C",
"type": "KPI",
"lastKnown": false,
"numericValue": 0
},
{
"id": "b8a4acfe-af6a-3821-8301-9432328fd8d0",
"name": "sys_alerts",
"entityType": "vehicles",
"eventTime": 1524555339469,
"computedTime": 1524555339469,
"eventTimeAsString": "2018-04-24T07:35:39Z",
"interval": "CURRENT",
"entityId": "FA1EE482-D601-4720-B4F6-0A338BF16E1C",
"type": "KPI",
"lastKnown": false,
"numericValue": 0
},
{
"id": "2176b6b7-e8b6-397c-8cbb-6218a24e738d",
"name": "sys_availabilityStatus",
"entityType": "vehicles",
"eventTime": 1524555339469,
"computedTime": 1524555339469,
"eventTimeAsString": "2018-04-24T07:35:39Z",
"interval": "CURRENT",
"entityId": "FA1EE482-D601-4720-B4F6-0A338BF16E1C",
"type": "KPI",
"lastKnown": false,
"booleanValue": true
},
{
"id": "2b381dff-66b2-314b-9c43-5ec1d559d1db",
"name": "sys_openIncidents",
"entityType": "vehicles",
"eventTime": 1524555339469,
"computedTime": 1524555339469,
"eventTimeAsString": "2018-04-24T07:35:39Z",
"interval": "CURRENT",
"entityId": "FA1EE482-D601-4720-B4F6-0A338BF16E1C",
"type": "KPI",
"lastKnown": false,
"numericValue": 0
},
{
"id": "a6d176fe-a283-3c74-aae2-7c759dfeb44a",
"name": "sys_consumedFuelCost",
"entityType": "vehicles",
"eventTime": 1524555339469,
"computedTime": 1524555339469,
"eventTimeAsString": "2018-04-24T07:35:39Z",
"interval": "CURRENT",
"entityId": "FA1EE482-D601-4720-B4F6-0A338BF16E1C",
"type": "KPI",
"lastKnown": false,
"numericValue": 0
},
{
"id": "171bd431-7566-3414-ad41-315c46507fbf",
"name": "sys_utilizationStatus",
"entityType": "vehicles",
"eventTime": 1524555339469,
"computedTime": 1524555339469,
"eventTimeAsString": "2018-04-24T07:35:39Z",
"interval": "CURRENT",
"entityId": "FA1EE482-D601-4720-B4F6-0A338BF16E1C",
"type": "KPI",
"lastKnown": false,
"booleanValue": false
}
],
"links": [
{
"href": "https://iotserver/fleetMonitoring/clientapi/v2/vehicles",
"rel": "self"
},
{
"href": "https://iotserver/fleetMonitoring/clientapi/v2/vehicles",
"rel": "canonical"
}
]
}



Complete cURL Example

The following example shows a complete cURL command that you can use to perform the described operation:

curl -X POST 
   -u <username>:<password>
   -H 'Accept: application/json'
   -H 'Content-Type: application/json'
   -d '{"year":12345,"registrationNumber":"Vehicle registration number","name":"Vehicle Name","description":"Vehicle Description","model":"Vehicle model","vin":"Vehicle identification number","attributes":[{"name":"Vehicle Attribute Name","type":"One of [CUSTOM, SENSOR]."}],"type":"Vehicle Type ID","make":"Vehicle make"}'
   https://iotserver/fleetMonitoring/clientapi/v2/vehicles/



Note that in the request, https://iotserver will be replaced by the name and port of your assigned IoT Cloud Service instance. The format of the Cloud Service instance is https://myinstance-myidentitydomain.iot.us.oraclecloud.com and the default port is 443.
Back to Top