Create vehicle details in bulk
post
/fleetMonitoring/clientapi/v2/vehicles
This operation creates vehicles in bulk by accepting the list of vehicles in a file stream. The list of vehicles is provided in CSV format as follows:
Format for the CSV file:
registrationNumber,vehicleIdentificationNumber,activationID,secret,vehicle_model,make,year,name
Example:
VEHREG1234,VIN1234,ACT1234,SECRET,VEHMOD1234,VEHMAKE1234,2017,VEHNAME1234
Format for the CSV file:
registrationNumber,vehicleIdentificationNumber,activationID,secret,vehicle_model,make,year,name
Example:
VEHREG1234,VIN1234,ACT1234,SECRET,VEHMOD1234,VEHMAKE1234,2017,VEHNAME1234
Request
There are no request parameters for this operation.
Response
Supported Media Types
- application/json
200 Response
Successfully processed.
401 Response
Unauthorized. The request requires user authentication.
406 Response
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.
Examples
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
https://iotserver/fleetMonitoring/clientapi/v2/vehicles
Example of Response Body
The following example shows the content of the response body in JSON format:
{
"totalEntries":2,
"createdEntries":[
{
"rowNo":1,
"id":"8331DF40-CB33-40EE-AC6E-A9154EC1DD05",
"name":"MyVeh20001",
"links":[
{
"href":"https://iotserver/fleetMonitoring/clientapi/version/resource/path",
"rel":"self"
}
]
}
],
"updatedEntries":[
],
"errorEntries":[
],
"failedEntries":[
{
"rowNo":2,
"detail":"Device registration rollback due to Vehicle creation failure.",
"errorCode":"FM_DEVICE_REGISTRATION_ROLLBACK"
}
],
"activationIDs":[
"dummy1231"
],
"links":[
{
"href":"https://iotserver/fleetMonitoring/clientapi/version/resource/path/",
"rel":"self"
},
{
"href":"https://iotserver/fleetMonitoring/clientapi/version/resource/path",
"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'
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.