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
Body ()
Root Schema : Shipment_create
Type: object
Show Source
Nested Schema : Equipment_create
Type: object
Show Source
Nested Schema : ExternalEntity_create
Type: object
Show Source
Nested Schema : stops
Type: array
List of stops
Show Source
Nested Schema : TripStops_create
Type: object
Show Source
Nested Schema : GeoPosition_create
Type: object
Show Source
Nested Schema : additionalElements
Type: array
Property description was not set
Show Source
Back to Top

Response

Supported Media Types

200 Response

Successfully processed.
Body ()
Root Schema : BulkOperationResponse_receive
Type: object
Show Source
Nested Schema : createdEntries
Type: array
Property description was not set
Show Source
Nested Schema : errorEntries
Type: array
Property description was not set
Show Source
Nested Schema : failedEntries
Type: array
Property description was not set
Show Source
Nested Schema : updatedEntries
Type: array
Property description was not set
Show Source
Nested Schema : CreatedOrUpdatedEntry_receive
Type: object
Show Source
Nested Schema : ErrorOrFailedEntry_receive
Type: object
Show Source

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.
Back to Top

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.
Back to Top