Create shipment
post
/fleetMonitoring/clientapi/v2/shipments
This operation creates new shipments in the application. Unit sensitive fields like weight, volume, distance needs to be given in SI(metric) units
Request
Supported Media Types
- application/json
Header Parameters
-
X-ORACLE-IOT-ORG(optional): string
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
Root Schema : ShipmentImpl_receive
Type:
Show Source
object
-
carrierId:
string
Carrier or transporter identifier
-
carrierName:
string
Carrier Name
-
cost:
integer
Shipment Cost
-
costCurrency:
string
Property description was not set
-
createdBy:
string
Created by
-
createdTime:
string
Creation Time
-
domainName:
string
Domain Name
-
driverId:
object DriverEntityIDRefs_receive
-
earliestEndTime:
integer
Earliest time when a shipment could be completed
-
earliestStartTime:
integer
Earliest Start Time (epoch time in milliseconds)
-
endTime:
integer
End Time (epoch time in milliseconds)
-
equipment:
object Equipment_receive
-
equipmentUtilization:
integer
Equipment Utilization
-
extendedFields:
array extendedFields
List of extended field values supported for this shipment
-
externalId:
string
External ID
-
externalReference:
string
External Reference
-
id:
string
Shipment ID
-
isTPLManaged:
boolean
Property description was not set
-
lastModifiedBy:
string
Modified By
-
lastModifiedTime:
integer
Last Modified Time (epoch time in milliseconds)
-
lastModifiedTimeAsString:
string
Last Modified Time of Shipment as an ISO-8601 formatted string.
-
latestStartTime:
integer
Latest Start Time (epoch time in milliseconds)
-
loadedDistance:
integer
Loaded Distance, value should be provided in kilometers
-
metricSnapshot:
object MetricSnapshot_receive
-
name:
string
Shipment Name
-
orderCount:
integer
Number of Orders
-
plannedDriveDistance:
integer
Planned Drive Distance, value should be provided in kilometers. If user input is provided, it is honored. Otherwise this is derived from distanceToNextStop provided for each stop, or is computed as a sum of loadedDistance and unLoadedDistance distances, or distance information derived from map service; in the order as mentioned.
-
plannedDriveDurationSeconds:
integer
Planned Drive Duration in Seconds. If user input is provided, it is honoured. Otherwise the computation is done by the application.
-
powerUnitId:
object ExternalEntityIDRefs_receive
-
powerUnitLicensePlateNumber:
string
Power Unit Registration Number.
-
shipperId:
string
Shipper identifier or consignor
-
shipperName:
string
Name of the shipper or consignor
-
shipUnitCount:
integer
Number of Shipment Units
-
startTime:
integer
Start Time (epoch time in milliseconds)
-
status:
string
Shipment StatusOne of [PLANNED, EN_ROUTE, REACHED_DESTINATION, COMPLETED].
-
stopCount:
integer
Total Stop Count
-
stops:
array stops
List of stops
-
stopsCompleted:
integer
Stops Completed
-
trackerStatus:
string
Tracker status of the tracked shipment being monitored by data aggregator
-
trackingId:
string
Tracking Id of the tracked shipment, as being monitored by data aggregator
-
transportMode:
string
Transport mode. e.g. (TruckLoad, TL, LessThanTruckLoad, LTL etc)
-
tripId:
string
Trip ID
-
unLoadedDistance:
integer
Unloaded Distance, value should be provided in kilometers
-
volume:
integer
Volume of the shipment, value should be provided in litres
-
volumeUtilization:
integer
Volume Utilization
-
weight:
integer
Weight of the shipment, value should be provided in kilograms
-
weightUtilization:
integer
Weight Utilization
Nested Schema : DriverEntityIDRefs_receive
Type:
Show Source
object
-
externalId:
string
External ID
-
id:
string
ID
-
loginId:
string
Driver Login ID
Nested Schema : Equipment_receive
Type:
Show Source
object
-
externalId:
string
Property description was not set
-
groupId:
string
Property description was not set
Nested Schema : extendedFields
Type:
array
List of extended field values supported for this shipment
Show Source
Nested Schema : MetricSnapshot_receive
Type:
Show Source
object
-
metricValues:
array metricValues
The metric values of an entity
Nested Schema : ExternalEntityIDRefs_receive
Type:
Show Source
object
-
externalId:
string
External ID
-
id:
string
ID
Nested Schema : ShipmentExtendedField_receive
Type:
Show Source
object
-
group:
string
Type of the extended field. Following group types are supported &qot;VehicleIdentifier&qot;, &qot;ShipmentIdentifier&qot;, &qot;CarrierIdentifier&qot;;One of [VehicleIdentifier, ShipmentIdentifier, CarrierIdentifier].
-
name:
string
Unique name of the extended field
Nested Schema : MetricValue_receive
Type:
Show Source
object
-
booleanValue(optional):
boolean
Property description was not set
-
computedTime:
integer
Property description was not set
-
confidenceLevel(optional):
integer
Property description was not set
-
entityId:
string
Property description was not set
-
entityType:
string
Property description was not set
-
esAdditionalData:
object esAdditionalData
Additional Properties Allowed: additionalPropertiesProperty description was not set
-
esRelationType:
object EsJoinFieldValue_receive
-
eventTime:
integer
Property description was not set
-
eventTimeAsString:
string
Property description was not set
-
geoLocationValue(optional):
object GeoPosition_receive
-
id:
string
Property description was not set
-
interval:
string
One of [DYNAMIC, CURRENT, EVERY2MINUTE, HOURLY, DAILY, NEXT24HOURS, WEEKLY, BIWEEKLY, NEXT7DAYS, NEXT30DAYS, MONTHLY, DAYS90, STATIC].
-
lastKnown:
boolean
Property description was not set
-
metadata:
object metadata
Additional Properties Allowed: additionalPropertiesProperty description was not set
-
name:
string
Property description was not set
-
numericValue(optional):
integer
Property description was not set
-
params:
object params
Additional Properties Allowed: additionalPropertiesProperty description was not set
-
stringValue(optional):
string
Property description was not set
-
type:
string
One of [KPI, PREDICTION, ANOMALY, TREND_NELSON, TREND, SENSOR, CORRELATION, CLUSTERING].
Nested Schema : esAdditionalData
Type:
object
Additional Properties Allowed
Show Source
-
string
A map of the following type: Map<String, String>
Property description was not set
Show Source
Nested Schema : EsJoinFieldValue_receive
Type:
Show Source
object
-
name:
string
Property description was not set
-
parent:
string
Property description was not set
Nested Schema : GeoPosition_receive
Type:
Show Source
object
-
additionalElements:
array additionalElements
Property description was not set
-
altitude:
number
Property description was not set
-
latitude:
number
Property description was not set
-
longitude:
number
Property description was not set
-
valid:
boolean
Property description was not set
Nested Schema : metadata
Type:
object
Additional Properties Allowed
Show Source
-
string
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
-
string
A map of the following type: Map<String, String>
Property description was not set
Show Source
Nested Schema : TripStopRecord_receive
Type:
Show Source
object
-
address:
string
Unified full address, e.g. 500 Oracle Parkway::Redwood City::CA::US::94065 . Must be provided if geoLocation is not specified.
-
arrivalTime:
integer
Trip arrival time (millisecond)
-
city:
string
Name of City
-
country:
string
Name of country
-
departureTime:
integer
Trip departure time (millisecond)
-
distanceToNextStop:
number
Estimated distance to next stop
-
estimatedArrivalTime:
integer
Estimated arrival time (millisecond)
-
estimatedDepartureTime:
integer
Estimated departure time (millisecond)
-
estimatedTimeToNextStop:
integer
Estimated time it will take to reach next stop (second)
-
expectedDurationFromStart:
integer
Expected duration from Start to arrive at this Stop (seconds)
-
geoLocation:
object GeoPosition_receive
-
plannedArrivalTime:
integer
Planned Trip arrival time (in millisecond)
-
plannedDepartureTime:
integer
Planned Trip departure time (in millisecond)
-
postalCode:
string
Postal/Zip code
-
state:
string
Name of State
-
stopDurationInSeconds:
integer
Stop duration in seconds
-
stopSequence:
integer
Sequence number of the stop
-
stopType:
string
The reason for stopping
-
street:
string
Name of Street
-
timeZone:
string
Time zone of the time fields
Response
Supported Media Types
- application/json
200 Response
Successfully processed.
Root Schema : BulkOperationResponse_receive
Type:
Show Source
object
-
createdEntries:
array createdEntries
Property description was not set
-
errorEntries:
array errorEntries
Property description was not set
-
failedEntries:
array failedEntries
Property description was not set
-
totalEntries:
integer
Property description was not set
-
updatedEntries:
array updatedEntries
Property description was not set
Nested Schema : CreatedOrUpdatedEntry_receive
Type:
Show Source
object
-
externalId:
string
Property description was not set
-
id:
string
Property description was not set
-
index:
integer
Property description was not set
-
links:
array links
Property description was not set
-
name:
string
Property description was not set
Nested Schema : ErrorOrFailedEntry_receive
Type:
Show Source
object
-
detail:
string
Property description was not set
-
errorCode:
string
Property description was not set
-
externalId:
string
Property description was not set
-
id:
string
Property description was not set
-
index:
integer
Property description was not set
-
name:
string
Property description was not set
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.
Examples
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
-H 'Content-Type: application/json'
https://iotserver/fleetMonitoring/clientapi/v2/shipments
Example of Request Body
The following example shows the content of the request body in JSON format:
[{
"name": "Planned_Shipment-2",
"externalId": "Planned-Shipment-2",
"domainName": "D1",
"cost": 60,
"costCurrency": "EURO",
"equipment": {
"externalId": "EQUIP-3",
"groupId": "TestGrp"
},
"orderCount": 3,
"shipUnitCount": 4,
"carrierName": "MyGlobalCarrier",
"weight": 6.5,
"volume": 6.8,
"loadedDistance": 6.8,
"weightUtilization": 1.2,
"volumeUtilization": 3.6,
"equipmentUtilization": 8.9,
"unLoadedDistance": 7.8,
"plannedDriveDurationSeconds": 11000,
"plannedDriveDistance": 207.53849404103548,
"earliestStartTime": 1512905400000,
"latestStartTime": 1518078200000,
"externalReference": "BM1234565",
"driverLoginId": "iotFmDriver8",
"stops": [{
"stopSequence": 1,
"street": "500 Oracle Parkway",
"city": "Redwood City",
"state": "CA",
"country": "US",
"postalCode": "94065",
"stopType": "P",
"geoLocation": [-122.26223, 37.53084],
"estimatedTimeToNextStop": 792,
"distanceToNextStop": 288,
"estimatedArrivalTime": 1517305083000,
"plannedArrivalTime": 1517305083000,
"plannedDepartureTime": 1517405083000,
"estimatedDepartureTime": 1517300083000
}, {
"stopSequence": 2,
"street": "4210 Network Circle",
"city": "Santa Clara",
"state": "CA",
"country": "US",
"postalCode": "95054",
"stopType": "P",
"geoLocation": [-121.95267, 37.39124],
"estimatedTimeToNextStop": 78,
"distanceToNextStop": 25,
"expectedDurationFromStart": 792,
"plannedArrivalTime": 1517305083000,
"plannedDepartureTime": 1517405083000,
"estimatedArrivalTime": 1517305083000,
"estimatedDepartureTime": 1517405083000
},
{
"stopSequence": 3,
"street": "475 Sansome Street",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94111",
"stopType": "D",
"geoLocation": [-122.40143, 37.79461],
"estimatedTimeToNextStop": 366,
"distanceToNextStop": 21,
"expectedDurationFromStart": 870,
"plannedArrivalTime": 1517516083000,
"plannedDepartureTime": 1518516083000,
"estimatedArrivalTime": 1517516083000,
"estimatedDepartureTime": 1518516083000
}
]
}]
Example of Response Body
The following example shows the content of the response body in JSON format:
{
"totalEntries": 1,
"createdEntries": [
{
"index": 0,
"id": "FB7FD9B7-11C5-49E9-B02B-E0D8547FD22C",
"externalId": "Planned-Shipment-2",
"name": "Planned_Shipment-2",
"links": [
{
"href": "https://iotserver:443/fleetMonitoring/clientapi/v2/shipments//FB7FD9B7-11C5-49E9-B02B-E0D8547FD22C",
"rel": "self"
}
]
}
],
"links": [
{
"href": "https://iotserver:443/fleetMonitoring/clientapi/v2/shipments/",
"rel": "self"
},
{
"href": "https://iotserver:443/fleetMonitoring/clientapi/v2/shipments/",
"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 '{"externalId":"2a674872ae-50eb","tripId":"5ead37fe4ec2-6f6","stops":[{"stopType":"The reason for stopping","plannedArrivalTime":1469184297746,"plannedDepartureTime":1469184297746,"arrivalTime":1469184297746,"estimatedArrivalTime":1469184297746,"estimatedDepartureTime":1469184297746,"departureTime":1469184297746,"timeZone":"Time zone of the time fields","geoLocation":{"longitude":0.0,"latitude":0.0,"altitude":0.0,"additionalElements":["additionalElements_1","additionalElements_2","additionalElements_3"],"valid":false},"city":"Name of City","street":"Name of Street","postalCode":"Postal/Zip code","expectedDurationFromStart":12345,"addressString":"Unified full address, e.g. 500 Oracle Parkway,Redwood City, CA, US, 94065.","stopDurationInSeconds":12345,"estimatedTimeToNextStop":1469184297746,"distanceToNextStop":0.0,"stopSequence":12345,"address":"Unified full address, e.g. 500 Oracle Parkway::Redwood City::CA::US::94065 . Must be provided if geoLocation is not specified.","state":"Name of State","country":"Name of country"}],"cost":12345,"lastModifiedBy":"Modified By","metricSnapshot":{"metricValues":[{"id":"403784e5a1f-6918","name":"Property description was not set","entityType":"Property description was not set","eventTime":1469184297746,"computedTime":1469184297746,"eventTimeAsString":"2016-07-22T10:44:57.746Z","interval":"One of [CURRENT, EVERY2MINUTE, HOURLY, DAILY, NEXT24HOURS, WEEKLY, NEXT7DAYS, NEXT30DAYS].","entityId":"f7124646360-7669","type":"One of [KPI, PREDICTION, ANOMALY, TREND_NELSON, SENSOR].","lastKnown":false,"confidenceLevel":12345,"numericValue":12345,"booleanValue":false,"stringValue":"Property description was not set","geoLocationValue":{"longitude":0.0,"latitude":0.0,"altitude":0.0,"additionalElements":["additionalElements_1","additionalElements_2","additionalElements_3"],"valid":false},"params":{"params_key1":"params_value1","params_key2":"params_value2","params_key3":"params_value3"}}]},"trackingId":"60e78d06795-29c5","lastModifiedTime":1469184297746,"createdTime":"Creation Time","createdBy":"Created by","stopCount":12345,"startTime":1469184297746,"plannedDriveDistance":12345,"plannedDriveDurationSeconds":12345,"endTime":1469184297746,"stopsCompleted":12345,"volume":12345,"costCurrency":"Property description was not set","equipment":{"externalId":"348a4d85cf2-3e7c","groupId":"1e583b3d1dd4-829"},"orderCount":12345,"shipUnitCount":12345,"carrierName":"Carrier Name","weightUtilization":12345,"volumeUtilization":12345,"equipmentUtilization":12345,"earliestStartTime":1469184297746,"latestStartTime":1469184297746,"externalReference":"External Reference","powerUnitLicensePlateNumber":"Power Unit Registration Number.","domainName":"Domain Name","unLoadedDistance":12345,"loadedDistance":12345,"driverId":{"id":"580d67983a40-29f1","externalId":"7e4b96dfde-638e","loginId":"1d106a0211d-45ad"},"powerUnitId":{"id":"2ec82eec4bd5-42c2","externalId":"10b453dc7894-3290"},"isTPLManaged":false,"transportMode":"Transport mode. e.g. (TruckLoad, TL, LessThanTruckLoad, LTL etc)","shipperName":"Name of the shipper or consignor","shipperId":"ee8430f1f72-2758","carrierId":"3c5e70de7ab6-6d62","earliestEndTime":1469184297746,"extendedFields":[{"name":"Unique name of the extended field","group":"Type of the extended field. Following group types are supported &qot;VehicleIdentifier&qot;, &qot;ShipmentIdentifier&qot;, &qot;CarrierIdentifier&qot;;One of [VehicleIdentifier, ShipmentIdentifier, CarrierIdentifier]."}],"trackerStatus":"Tracker status of the tracked shipment being monitored by data aggregator","weight":12345,"status":"Shipment StatusOne of [PLANNED, EN_ROUTE, REACHED_DESTINATION, COMPLETED].","name":"Shipment Name","id":"7e5f516c580d-45ba","lastModifiedTimeAsString":"2016-07-22T10:44:57.746Z"}'
https://iotserver/fleetMonitoring/clientapi/v2/shipments
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.