Create shipment
post
/fleetMonitoring/clientapi/v2/shipments
This operation creates new shipments in the application.
Request
Supported Media Types
- application/json
Root Schema : Shipment_create
Type:
Show Source
object-
carrierName:
string
Carrier Name
-
cost:
integer
Shipment Cost
-
costCurrency:
string
Currency for the costs provided
-
domainName:
string
Domain Name
-
driverExternalId:
string
External ID of the driver. [If driverLoginId is provided then this is not mandatory].
-
driverLoginId:
string
Login ID of the driver. [If driverExternalId is provided then this is not mandatory].
-
earliestStartTime:
integer
Earliest Start Time
-
equipment:
object Equipment_create
-
equipmentUtilization:
integer
Equipment Utilization
-
externalId:
string
External ID
-
externalReference:
string
External Reference
-
isTPLManaged:
boolean
Property description was not set
-
latestStartTime:
integer
Latest Start Time
-
loadedDistance:
number
Loaded Distance
-
metricResultMap:
object MetricResultMap_create
-
name:
string
Shipment Name
-
orderCount:
integer
Number of Orders
-
powerUnitId:
object ExternalEntityIDRefs_create
-
powerUnitLicensePlateNumber:
string
Power Unit Registration Number.
-
shipUnitCount:
integer
Number of Shipment Units
-
stops:
array stops
List of stops
-
unLoadedDistance:
integer
Unloaded Distance
-
volume:
number
Volume
-
volumeUtilization:
number
Volume Utilization
-
weight:
number
Weight of the shipment
-
weightUtilization:
number
Weight Utilization
Nested Schema : Equipment_create
Type:
Show Source
object-
externalId:
string
Property description was not set
-
groupId:
string
Property description was not set
Nested Schema : MetricResultMap_create
Type:
Show Source
object-
empty:
boolean
Property description was not set
-
metricResults:
array metricResults
The metric result lists of an entity.
Nested Schema : ExternalEntityIDRefs_create
Type:
Show Source
object-
externalId:
string
External ID
-
id:
string
ID
Nested Schema : MetricResult_create
Type:
Show Source
object-
booleanValue:
boolean
Property description was not set
-
cacheId:
string
Property description was not set
-
computedTime:
integer
Property description was not set
-
confidenceLevel:
integer
Property description was not set
-
entityId:
string
Property description was not set
-
entityType:
string
Property description was not set
-
eventTime:
integer
Property description was not set
-
eventTimeAsString:
string
Property description was not set
-
geoLocationValue:
object GeoPosition_create
-
global:
boolean
Property description was not set
-
id:
string
Property description was not set
-
indexId:
string
Property description was not set
-
interval:
string
One of [CURRENT, EVERY2MINUTE, HOURLY, DAILY, NEXT24HOURS, WEEKLY, NEXT7DAYS, NEXT30DAYS].
-
lastKnown:
boolean
Property description was not set
-
name:
string
Property description was not set
-
numericValue:
integer
Property description was not set
-
params:
object params
Additional Properties Allowed: additionalPropertiesProperty description was not set
-
paramsHash:
string
Property description was not set
-
stringValue:
string
Property description was not set
-
type:
string
One of [KPI, PREDICTION, ANOMALY, SENSOR].
Nested Schema : GeoPosition_create
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 : params
Type:
objectAdditional Properties Allowed
Show Source
-
string
A map of the following type: Map<String, String>
Property description was not set
Show Source
Nested Schema : Stops_create
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.
-
city:
string
Name of City
-
country:
string
Name of country
-
distanceToNextStop:
number
Estimated distance to next stop
-
expectedDurationFromStart:
integer
Expected duration to reach from Start to this Stop (second)
-
geoLocation:
object GeoPosition_create
-
postalCode:
string
Postal/Zip code
-
state:
string
Name of State
-
stopSequence:
integer
Property description was not set
-
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 : BulkResponse_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,
"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 '{"lastModifiedTime":"Last Modified Time","powerUnitLicensePlateNumber":"Power Unit Registration Number.","tripId":"66ea14491f64-3219","latestStartTime":1469184297746,"earliestStartTime":1469184297746,"unLoadedDistance":12345,"carrierName":"Carrier Name","equipmentUtilization":12345,"createdTime":"Creation Time","startTime":1469184297746,"id":"7a528bf3ae8-f0f","loadedDistance":12345,"weightUtilization":12345,"cost":12345,"volumeUtilization":12345,"lastModifiedBy":"Modified By","lastModifiedTimeAsString":1469184297746,"orderCount":12345,"weight":12345,"externalId":"57255be35617-5f2e","equipment":{"groupId":"6af6400d56f9-29df","externalId":"3052749c7ab2-5ac7"},"stopCount":12345,"volume":12345,"externalReference":"External Reference","driverId":{"externalId":"46bf62c948a3-b00","id":"36527dfe233f-28aa"},"createdBy":"Created by","metricResultMap":{"metricResults":[{"confidenceLevel":12345,"entityType":"Property description was not set","geoLocationValue":{"valid":false,"altitude":0.0,"latitude":0.0,"longitude":0.0,"additionalElements":["additionalElements_1","additionalElements_2","additionalElements_3"]},"eventTimeAsString":"2016-07-22T10:44:57.746Z","lastKnown":false,"numericValue":12345,"computedTime":1469184297746,"entityId":"4dd1d71d3-1dba","type":"One of [KPI, PREDICTION, ANOMALY, SENSOR].","params":{"params_key1":"params_value1","params_key2":"params_value2","params_key3":"params_value3"},"stringValue":"Property description was not set","name":"Property description was not set","eventTime":1469184297746,"interval":"One of [CURRENT, EVERY2MINUTE, HOURLY, DAILY, NEXT24HOURS, WEEKLY, NEXT7DAYS, NEXT30DAYS].","booleanValue":false,"id":"391b696b76fd-1402"}]},"isTPLManaged":false,"domainName":"Domain Name","name":"Shipment Name","powerUnitId":{"externalId":"403724c05c6b-116f","id":"30b2719771c9-11b5"},"stops":[{"departureTime":1469184297746,"stopDurationInSeconds":12345,"distanceToNextStop":0.0,"country":"Name of country","stopSequence":12345,"address":"Unified full address, e.g. 500 Oracle Parkway::Redwood City::CA::US::94065 . Must be provided if geoLocation is not specified.","city":"Name of City","plannedArrivalTime":1469184297746,"postalCode":"Postal/Zip code","expectedDurationFromStart":12345,"plannedDepartureTime":1469184297746,"timeZone":"Time zone of the time fields","stopType":"The reason for stopping","estimatedTimeToNextStop":1469184297746,"estimatedDepartureTime":1469184297746,"geoLocation":{"valid":false,"altitude":0.0,"latitude":0.0,"longitude":0.0,"additionalElements":["additionalElements_1","additionalElements_2","additionalElements_3"]},"arrivalTime":1469184297746,"street":"Name of Street","state":"Name of State","estimatedArrivalTime":1469184297746}],"endTime":1469184297746,"shipUnitCount":12345,"stopsCompleted":12345,"costCurrency":"Property description was not set","status":"Shipment StatusOne of [PLANNED, EN_ROUTE, REACHED_DESTINATION, COMPLETED]."}'
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.