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
Root Schema : Shipment_create
Type:
Show Source
object
-
carrierName(optional):
string
Carrier Name
-
cost(optional):
integer
Shipment Cost
-
costCurrency:
string
Property description was not set
-
domainName(optional):
string
Domain Name
-
earliestStartTime(optional):
integer
Earliest Start Time
-
equipment(optional):
object Equipment_create
-
equipmentUtilization(optional):
integer
Equipment Utilization
-
externalId(optional):
string
External ID
-
externalReference:
string
External Reference
-
latestStartTime(optional):
integer
Latest Start Time
-
loadedDistance(optional):
integer
Loaded Distance, value should be provided in kilometers
-
name:
string
Shipment Name
-
orderCount(optional):
integer
Number of Orders
-
plannedDriveDistance(optional):
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(optional):
integer
Planned Drive Duration in Seconds. If user input is provided, it is honoured. Otherwise the computation is done by the application.
-
powerUnitId:
object ExternalEntity_create
-
powerUnitLicensePlateNumber(optional):
string
Power Unit Registration Number.
-
shipUnitCount(optional):
integer
Number of Shipment Units
-
stops:
array stops
List of stops
-
transportMode(optional):
string
Transport mode. e.g. (TruckLoad, TL, LessThanTruckLoad, LTL etc)
-
unLoadedDistance(optional):
integer
Unloaded Distance, value should be provided in kilometers
-
volume(optional):
integer
Volume of the shipment, value should be provided in litres
-
volumeUtilization(optional):
integer
Volume Utilization
-
weight(optional):
integer
Weight of the shipment, value should be provided in kilograms
-
weightUtilization(optional):
integer
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 : ExternalEntity_create
Type:
Show Source
object
-
externalId:
string
External ID
-
id:
string
ID
Nested Schema : TripStops_create
Type:
Show Source
object
-
address(optional):
string
Unified full address, e.g. 500 Oracle Parkway::Redwood City::CA::US::94065 . Must be provided if geoLocation is not specified.
-
city(optional):
string
Name of City
-
country(optional):
string
Name of country
-
distanceToNextStop(optional):
number
Estimated distance to next stop
-
expectedDurationFromStart(optional):
integer
Expected duration from Start to arrive at this Stop (seconds)
-
geoLocation(optional):
object GeoPosition_create
-
plannedArrivalTime(optional):
integer
Planned Trip arrival time (in millisecond)
-
plannedDepartureTime(optional):
integer
Planned Trip departure time (in millisecond)
-
postalCode(optional):
string
Postal/Zip code
-
state(optional):
string
Name of State
-
stopDurationInSeconds(optional):
integer
Stop duration in seconds
-
street(optional):
string
Name of Street
-
timeZone(optional):
string
Time zone of the time fields
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
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 '{"powerUnitLicensePlateNumber":"Power Unit Registration Number.","plannedDriveDistance":12345,"latestStartTime":1469184297746,"earliestStartTime":1469184297746,"unLoadedDistance":12345,"carrierName":"Carrier Name","equipmentUtilization":12345,"plannedDriveDurationSeconds":12345,"loadedDistance":12345,"weightUtilization":12345,"cost":12345,"volumeUtilization":12345,"orderCount":12345,"weight":12345,"externalId":"3b3927fc2b9f-3809","equipment":{"groupId":"266039052d30-347b","externalId":"97279031884-5d28"},"volume":12345,"externalReference":"External Reference","domainName":"Domain Name","name":"Shipment Name","transportMode":"Transport mode. e.g. (TruckLoad, TL, LessThanTruckLoad, LTL etc)","powerUnitId":{"externalId":"4dbe54cc4abf-349f","id":"4bd962c01a69-2670"},"stops":[{"distanceToNextStop":0.0,"country":"Name of country","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","geoLocation":{"valid":false,"altitude":0.0,"latitude":0.0,"longitude":0.0,"additionalElements":["additionalElements_1","additionalElements_2","additionalElements_3"]},"street":"Name of Street","postalCode":"Postal/Zip code","expectedDurationFromStart":12345,"timeZone":"Time zone of the time fields","state":"Name of State"}],"shipUnitCount":12345,"costCurrency":"Property description was not set"}'
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.