Update Vehicle Type by ID

post

/fleetMonitoring/clientapi/v2/vehicleTypes/{type-id}

This operation updates the vehicle type specified by its ID.

Request

Supported Media Types
Path Parameters
Header Parameters
Body ()
Root Schema : VehicleType_update
Type: object
Show Source
Nested Schema : attributes
Type: array
Attributes associated with this vehicle type. Attributes could be custom or sensor based
Show Source
Nested Schema : years
Type: array
Range of years for the vehicle type.
Show Source
Nested Schema : VehicleAttributes_update
Type: object
Show Source
Nested Schema : allowedValues
Type: array
Allowed values for the attribute.
Show Source
Nested Schema : items
Type: object
Back to Top

Response

Supported Media Types

200 Response

Successfully processed.
Body ()
Root Schema : VehicleType_receive
Type: object
Show Source
Nested Schema : attributes
Type: array
Attributes associated with this vehicle type. Attributes could be custom or sensor based
Show Source
Nested Schema : icon
Type: object
Binary object representing the vehicle type icon.
Show Source
Nested Schema : years
Type: array
Range of years for the vehicle type.
Show Source
Nested Schema : VehicleAttributes_receive
Type: object
Show Source
Nested Schema : allowedValues
Type: array
Allowed values for the attribute.
Show Source
Nested Schema : items
Type: object

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.

404 Response

Not Found. The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
Back to Top

Examples

curl -X POST 
   -u <username>:<password>
   -H 'Accept: application/json'
   -H 'Content-Type: application/json'
   --header "X-HTTP-Method-Override: PATCH"
   https://iotserver/fleetMonitoring/clientapi/v2/vehicleTypes/{type-id}

Example of Request Body

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

{  
"name":"Test_Vehicle_Type",
"description":"Vehicle Type Description",
"make":"Vehicle_Type_Make",
"model":"Vehicle_Type_Model",
"icon":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wB",
"years":[
2015,
2016,
2017
],
"attributes":[
{
"name":"TestAttribute_Custom",
"type":"CUSTOM",
"dataType":"STRING",
"required":true,
"allowedValues":[
"Value_1",
"Value_2"
],
"defaultValue":"Value_1"
},
{
"messageFormatField":"ora_obd2_vehicle_speed",
"name":"TestAttribute_Sensor",
"required":false,
"dataType":"NUMBER",
"type":"SENSOR",
"deviceModel":"urn:com:oracle:iot:device:obd2"
}
]
}

Example of Response Body

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

{
"id": "2F29B565-D2A4-4922-AE40-ED6A3E1F5E8B",
"name": "Test_Vehicle_Type",
"description": "Vehicle Type Description",
"make": "Vehicle_Type_Make",
"model": "Vehicle_Type_Model",
"years": [
2015,
2016,
2017
],
"registrationTimeAsString": "2018-04-16T07:58:16.186Z",
"lastModifiedTimeAsString": "2018-04-16T07:58:16.186Z",
"attributes": [
{
"name": "TestAttribute_Custom",
"dataType": "STRING",
"allowedValues": [
"Value_1",
"Value_2"
],
"defaultValue": "Value_1",
"required": true,
"unique": false,
"type": "CUSTOM"
},
{
"name": "TestAttribute_Sensor",
"dataType": "NUMBER",
"deviceModel": "urn:com:oracle:iot:device:obd2",
"required": false,
"unique": false,
"messageFormatField": "ora_obd2_vehicle_speed",
"type": "SENSOR"
}
],
"links": [
{
"href": "https://iotserver/fleetMonitoring/clientapi/v2/vehicleTypes/2F29B565-D2A4-4922-AE40-ED6A3E1F5E8B",
"rel": "self"
},
{
"href": "https://iotserver/fleetMonitoring/clientapi/v2/vehicleTypes/2F29B565-D2A4-4922-AE40-ED6A3E1F5E8B",
"rel": "canonical"
}
],
"icon": {
"links": [
{
"href": "https://iotserver/fleetMonitoring/clientapi/v2/binary/6A10144B-37FC-45B5-BD6F-070142944B50.image.jpeg",
"rel": "self"
}
]
}
}



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'
   --header "X-HTTP-Method-Override: PATCH"
   -d '{"name":"Name of the vehicle type. It must be unique.","description":"Description about the vehicle type.","model":"Model of the vehicle type.","attributes":[{"instructions":"Instructions on how to fill the vehicle type attributes.","messageFormat":"Message format URN which the field is mapped. For attributes of SENSOR type this attribute is mandatory.","unique":false,"dataType":"Data type of the attribute. One of [STRING, NUMBER, BOOLEAN, DATE, BINARY].","name":"Name of the attribute.","messageFormatField":"Message format field to which this attributes is mapped. For attributes of SENSOR type this is mandatory.","deviceModel":"Device model URN for the message format field this attribute is mapped to. It is mandatory for the attribute of the type sensor.","required":false}],"make":"Make of the vehicle type.","years":["years_1","years_2","years_3"]}'
   https://iotserver/fleetMonitoring/clientapi/v2/vehicleTypes/3441c7c2cf3-62da



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