Update shipment by ID
post
/fleetMonitoring/clientapi/v2/shipments/{shipmentId}
This operation updates the information about a shipment specified by its shipment ID. Unit sensitive fields like weight, volume, distance needs to be given in SI(metric) units
Request
Supported Media Types
- application/json
Path Parameters
-
shipmentId: string
Shipment ID to be patched
Query Parameters
-
external(optional): boolean
Query to filter subset of shipments to be patched.
Header Parameters
-
X-HTTP-Method-Override: string
To perform a partial update of the shipment, POST request should be orchestrated with method override set to PATCH.
Root Schema : Shipment_update
Type:
Show Source
object
-
carrierName(optional):
string
Carrier Name
-
cost(optional):
integer
Shipment Cost
-
costCurrency(optional):
string
Property description was not set
-
domainName(optional):
string
Domain Name
-
earliestStartTime(optional):
integer
Earliest Start Time
-
equipment(optional):
object Equipment_update
-
equipmentUtilization(optional):
integer
Equipment Utilization
-
latestStartTime(optional):
integer
Latest Start Time
-
loadedDistance(optional):
integer
Loaded Distance, value should be provided in kilometers
-
name(optional):
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(optional):
object ExternalEntity_update
-
powerUnitLicensePlateNumber(optional):
string
Power Unit Registration Number.
-
shipUnitCount(optional):
integer
Number of Shipment Units
-
stops(optional):
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_update
Type:
Show Source
object
-
externalId(optional):
string
Property description was not set
-
groupId(optional):
string
Property description was not set
Nested Schema : ExternalEntity_update
Type:
Show Source
object
-
externalId(optional):
string
External ID
-
id(optional):
string
ID
Nested Schema : TripStops_update
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
-
geoLocation(optional):
object GeoPosition_update
-
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
-
street(optional):
string
Name of Street
-
timeZone(optional):
string
Time zone of the time fields
Nested Schema : GeoPosition_update
Type:
Show Source
object
-
additionalElements(optional):
array additionalElements
Property description was not set
-
altitude(optional):
number
Property description was not set
-
latitude(optional):
number
Property description was not set
-
longitude(optional):
number
Property description was not set
-
valid(optional):
boolean
Property description was not set
Response
Supported Media Types
- application/json
- application/vnd.oracle.resource+json;type=singular
200 Response
Successfully processed.
Root Schema : Shipment_receive
Type:
Show Source
object
-
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 DriverEntity_receive
-
earliestStartTime:
integer
Earliest Start Time
-
endTime:
integer
End Time (millisecond)
-
equipment:
object Equipment_receive
-
equipmentUtilization:
integer
Equipment Utilization
-
externalId:
string
External ID
-
externalReference:
string
External Reference
-
id:
string
Shipment ID
-
lastModifiedBy:
string
Modified By
-
lastModifiedTime:
string
Last Modified Time
-
lastModifiedTimeAsString:
integer
Last Modified Time As String
-
latestStartTime:
integer
Latest Start Time
-
loadedDistance:
integer
Loaded Distance, value should be provided in kilometers
-
metricResultMap:
object MetricResultMap_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 ExternalEntity_receive
-
powerUnitLicensePlateNumber:
string
Power Unit Registration Number.
-
shipUnitCount:
integer
Number of Shipment Units
-
startTime:
integer
Start Time (millisecond)
-
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
-
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 : DriverEntity_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 : MetricResultMap_receive
Type:
Show Source
object
-
metricResults:
array metricResults
The metric result lists of an entity.
Nested Schema : ExternalEntity_receive
Type:
Show Source
object
-
externalId:
string
External ID
-
id:
string
ID
Nested Schema : MetricResult_receive
Type:
Show Source
object
-
booleanValue:
boolean
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_receive
-
id:
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
-
stringValue:
string
Property description was not set
-
type:
string
One of [KPI, PREDICTION, ANOMALY, SENSOR].
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 : 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 : TripStops_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
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.
404 Response
Not Found. The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
405 Response
Method Not Allowed. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
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'
--header "X-HTTP-Method-Override: PATCH"
https://iotserver/fleetMonitoring/clientapi/v2/shipments/{shipmentId}
Example of Request Body
The following example shows the content of the request body in JSON format:
{
"name": "Planned_Shipment-1",
"weight": 6.5,
"volume": 6.8
"plannedDriveDurationSeconds": 11000,
"plannedDriveDistance": 207.53849404103548
}
Example of Response Body
The following example shows the content of the response body in JSON format:
{
"id": "FB7FD9B7-11C5-49E9-B02B-E0D8547FD22C",
"externalId": "Planned-Shipment-2",
"name": "Planned_Shipment-2",
"cost": 60,
"isTPLManaged": false,
"equipment": {
"externalId": "EQUIP-3",
"groupId": "TestGrp"
},
"orderCount": 3,
"shipUnitCount": 4,
"carrierName": "MyGlobalCarrier",
"domainName": "D1",
"weight": 6.5,
"volume": 6.8,
"loadedDistance": 6.8,
"weightUtilization": 1.2,
"volumeUtilization": 3.6,
"equipmentUtilization": 8.9,
"unLoadedDistance": 7.8,
"plannedDriveDurationSeconds": 11000,
"plannedDriveDistance": 128.95876200245783,
"earliestStartTime": 1512905400000,
"latestStartTime": 1518078200000,
"externalReference": "BM1234565",
"driverId": {
"loginId": "iotFmDriver8"
},
"powerUnitId": {},
"stops": [
{
"address": "500 Oracle Parkway::Redwood City::CA::US::94065",
"geoLocation": [
-122.26223,
37.53084
],
"estimatedTimeToNextStop": 792,
"distanceToNextStop": 288,
"expectedDurationFromStart": 0,
"city": "Redwood City",
"country": "US",
"estimatedArrivalTime": 1517305083000,
"estimatedDepartureTime": 1517300083000,
"plannedArrivalTime": 1517305083000,
"plannedDepartureTime": 1517405083000,
"postalCode": "94065",
"state": "CA",
"stopDurationInSeconds": 0,
"stopType": "P",
"street": "500 Oracle Parkway",
"stopSequence": 1
},
{
"address": "4210 Network Circle::Santa Clara::CA::US::95054",
"geoLocation": [
-121.95267,
37.39124
],
"estimatedTimeToNextStop": 78,
"distanceToNextStop": 25,
"expectedDurationFromStart": 792,
"city": "Santa Clara",
"country": "US",
"estimatedArrivalTime": 1517305083000,
"estimatedDepartureTime": 1517405083000,
"plannedArrivalTime": 1517305083000,
"plannedDepartureTime": 1517405083000,
"postalCode": "95054",
"state": "CA",
"stopDurationInSeconds": 0,
"stopType": "P",
"street": "4210 Network Circle",
"stopSequence": 2
},
{
"address": "475 Sansome Street::San Francisco::CA::US::94111",
"geoLocation": [
-122.40143,
37.79461
],
"estimatedTimeToNextStop": 366,
"distanceToNextStop": 21.000000000000004,
"expectedDurationFromStart": 870,
"city": "San Francisco",
"country": "US",
"estimatedArrivalTime": 1517516083000,
"estimatedDepartureTime": 1518516083000,
"plannedArrivalTime": 1517516083000,
"plannedDepartureTime": 1518516083000,
"postalCode": "94111",
"state": "CA",
"stopDurationInSeconds": 0,
"stopType": "D",
"street": "475 Sansome Street",
"stopSequence": 3
}
],
"lastModifiedBy": "iot",
"lastModifiedTime": "2018-04-18T09:24:10.980Z",
"lastModifiedTimeAsString": 1524043450980,
"createdBy": "iot",
"createdTime": "2018-04-18T09:15:27.121Z",
"startTime": 0,
"endTime": 0,
"costCurrency": "EURO",
"status": "PLANNED",
"stopCount": 3,
"stopsCompleted": 0,
"links": [
{
"href": "https://iotserver:443/fleetMonitoring/clientapi/v2/shipments/FB7FD9B7-11C5-49E9-B02B-E0D8547FD22C/",
"rel": "self"
},
{
"href": "https://iotserver:443/fleetMonitoring/clientapi/v2/shipments/FB7FD9B7-11C5-49E9-B02B-E0D8547FD22C/",
"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'
--header "X-HTTP-Method-Override: PATCH"
-d '{"weightUtilization":12345,"cost":12345,"volumeUtilization":12345,"powerUnitLicensePlateNumber":"Power Unit Registration Number.","orderCount":12345,"weight":12345,"equipment":{"groupId":"3ca151f63141-fa5","externalId":"61b37a162ea-576d"},"plannedDriveDistance":12345,"volume":12345,"latestStartTime":1469184297746,"earliestStartTime":1469184297746,"unLoadedDistance":12345,"carrierName":"Carrier Name","equipmentUtilization":12345,"domainName":"Domain Name","name":"Shipment Name","transportMode":"Transport mode. e.g. (TruckLoad, TL, LessThanTruckLoad, LTL etc)","powerUnitId":{"externalId":"2a5168486ef5-3862","id":"5d4712ee424a-30cc"},"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","timeZone":"Time zone of the time fields","state":"Name of State"}],"shipUnitCount":12345,"plannedDriveDurationSeconds":12345,"costCurrency":"Property description was not set","loadedDistance":12345}'
https://iotserver/fleetMonitoring/clientapi/v2/shipments/{shipmentId}
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.