Create shipment

post

/fleetMonitoring/clientapi/v2/shipments

This operation creates new shipments in the application.

Request

Supported Media Types
Body ()
Root Schema : Shipment_create
Type: object
Show Source
Nested Schema : Equipment_create
Type: object
Show Source
Nested Schema : MetricResultMap_create
Type: object
Show Source
Nested Schema : ExternalEntityIDRefs_create
Type: object
Show Source
Nested Schema : stops
Type: array
List of stops
Show Source
Nested Schema : metricResults
Type: array
The metric result lists of an entity.
Show Source
Nested Schema : MetricResult_create
Type: object
Show Source
Nested Schema : GeoPosition_create
Type: object
Show Source
Nested Schema : params
Type: object
Additional Properties Allowed
Show Source
  • A map of the following type: Map<String, String>
Property description was not set
Show Source
Nested Schema : additionalElements
Type: array
Property description was not set
Show Source
Nested Schema : Stops_create
Type: object
Show Source

Response

Supported Media Types

200 Response

Successfully processed.
Body ()
Root Schema : BulkResponse_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.

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.