Current Version |
Last Modification Date |
Version 1.19 |
March 11, 2025 |
Revision History
Version |
Release Date |
Sections Changed |
Description of Change |
1.0 |
April 4, 2024 |
All |
Added Location, Link, PTLane, RailLink, Driver, Tractor, Schedule, Shipment, Trailer and Manifest entities. |
1.1 |
April 12, 2024 |
Schedule Events - Schedule |
Fixed values of dispatchType to be Travel, Dock, Meal. |
1.2 |
April 19, 2024 |
Live Events - Shipment |
Updated properties of shipper, consignee and thirdPartyCustomer to be consolidated as customer properties. |
1.3 |
April 26, 2024 |
Live Events - Shipment |
Fixed data type of shipper, consignee and thirdPartyCustomer to be an object. |
1.4 |
May 8, 2024 |
Live Events - Manifest |
Added child manifest field and its corresponding properties. |
1.5 |
May 28, 2024 |
Live Events - Shipment |
Updated field names to be downstreamInterlineCarrierId and upstreamInterlineCarrierId and added EDIProId, EDIFlag, appointmentDueTime, freightClass, isStackable, isDimensioned, isReWeighed, isLong, status, currentLocation and extendedCurrentLocation fields in UpdateShipment. |
1.6 |
July 3, 2024 |
Live Events - Shipment, Manifest |
Updated hazmatinfo and its properties and added contactName, contactPhone, customerOpenHours and customerCloseHours fields in UpdateShipment. Fixed validation of routeId in UpdateManifest. |
1.7 |
July 5, 2024 |
Network Events - Service, Resource Events - Trailer, Live Events - Shipment, Pickup, Dock |
Added UpdateService, DeleteService, DeleteTrailer, CancelShipment, UpdatePickup, CityDriverArrival and ChangeTrailerLocationInTerminal Events. |
1.8 |
July 10, 2024 |
Network Events - Service, Live Events - Shipment, Pickup, Dock |
Updated Payload Field Description of CancelShipment. Added missing EventId and EventType fields in UpdateService, UpdatePickup, CityDriverArrival and ChangeTrailerLocationInTerminal Events. |
1.9 |
July 25, 2024 |
Live Events - Manifest, Dock, Dispatch |
Added CompleteManifest, CancelManifest, ForkliftPickup, ForkliftDrop, ShipmentToManifestAssignment, ShipmentToManifestUnassignment, UpdatePlannedDispatch, DeletePlannedDispatch, LHDispatchUpdate, LHDispatchEnd and LHDispatchCancel Events. Added TrailerId field in UpdateManifest. |
1.10 |
August 7, 2024 |
All |
Updated EventId to EntityId in all events. Updated field names to plannedDeliveryDate, PDRouteId and description of lastStatusTime in UpdateManifest. |
1.11 |
August 22, 2024 |
Live Events - Manifest, Network Events - Location |
Added OpenTrailer and CloseTrailer Events. Updated data type of shiftFreightType field to string array in UpdateLocation. |
1.12 |
September 11, 2024 |
Live Events - Pickup |
Added CancelPickup and PickedUp Events. |
1.13 |
September 19, 2024 |
Network Events - Service, Live Events - Shipment, Pickup, Dock, Dispatch |
Updated EntityId field in UpdateService, UpdateShipment, UpdatePickup, CancelPickup, PickedUp, CityDriverArrival, OpenTrailer, CloseTrailer, ForkliftPickup, ForkLiftDrop, ShipmentToManifestAssignment, ShipmentToManifestUnassignment, ChangeTrailerLocationInTerminal, UpdatePlannedDispatch, DeletePlannedDispatch, LHDispatchUpdate, LHDispatchEnd and LHDispatchCancel Events. |
1.14 |
September 20, 2024 |
Network Events - Link, Service |
Updated EntityId field in UpdateLink, DeleteLink and UpdateService Events. Added RouteType field in DeleteLink. |
1.15 |
September 30, 2024 |
Live Events - Shipment, Pickup |
Added PickupId and SubPickupId field in CancelShipment Event. Updated properties of shipper, consignee and thirdPartyCustomer to be consolidated as customer properties in PickedUp Event. |
1.16 |
November 13, 2024 |
Network Events - Service, Resource Events - Driver, Live Events - Shipment, Pickup, Manifest, Dock, Dispatch |
Updated Data Format of Sequence field in UpdateService, UpdateManifest and LHDispatchUpdate. Updated Values with correct date format in UpdateDriver, PickedUp, UpdatePlannedDispatch and LHDispatchUpdate. Added Source field in UpdateService, UpdatePickup, CityDriverArrival and ChangeTrailerLocationInTerminal. Added TotalLength, TotalWidth and TotalHeight fields in UpdateShipment. Updated ProId field to be nullable in CancelShipment. Added ShipmentDelivery Event. Updated Description of Sequence and ManifestId field in LHDispatchUpdate. Updated Event Name of UpdatePlannedLHDispatch and DeletePlannedLHDispatch. |
1.17 |
November 21, 2024 |
Network Events - Location, Live Events - Pickup, Manifest |
Updated Values of ShiftFreightType in UpdateLocation. Updated Mandatory Status of EventDateTime in CityDriverArrival. Updated Values and Description of OriginShift, DestinationShift, CloseDate and CloseTime fields in UpdateManifest. |
1.18 |
February 17, 2025 |
Schedule Events - Schedule |
Added childLoads and its properties in UpdateSchedule. |
1.19 |
March 11, 2025 |
Schedule Events - Schedule |
Added PublishSchedule Event. |
Introduction
Welcome to the Optym LTL Suite Integration Documentation!
Optym LTL Suite offers a suite of tailored products specifically designed for the Less-Than-Truckload (LTL) industry. This website serves as a comprehensive resource for integrating with any of the HaulSuite products. The integration details provide the necessary insights to seamlessly incorporate our solutions into your workflow.
As each HaulSuite product may necessitate different sets of events, this document serves as a centralized platform for accessing unified integration information. Consider it your go-to reference for understanding and implementing each event effectively. Note that the prioritization of event development should align with the product roadmap and the features that are of utmost importance to you.
To begin your integration journey, explore the following key sections:
Authentication and Connection Mechanism: Discover how data security is maintained during integration and learn how to implement authentication on your end to ensure secure data exchange.
Terminology & Acronyms: Familiarize yourself with the specialized business terminologies used throughout the documentation, ensuring clarity, and understanding as you navigate the integration process.
Events Specifications: Dive into the details of each event, where you'll find comprehensive information including:
- Field Name: The expected name of the field for seamless integration.
- Values: Example values for the field, providing context and guidance.
- Mandatory Status: Indicates whether the field is mandatory for the event to be processed.
- Data Type: Specifies the expected data type for accurate handling of information.
- Data Format: Defines the specific data format required for the field.
- Validation: Outlines any validation criteria applied to the data upon event reception.
- Description: Offers a succinct description of the field's purpose and significance.
For additional insights into Optym products and solutions, visit our website.
Should you require any assistance or have further inquiries, don't hesitate to reach out to our support team.
Authentication and Connection Mechanism
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Optym's LTL Suite’s integration endpoint utilizes Microsoft Azure's Event Hub. The events will be received at a single endpoint secured via Azure Active Directory Authentication.
Messages are transmitted to the event hub via HTTP calls, with security enforced through short-lived tokens generated from a distinct AD authentication endpoint.
Authentication:
For each integration, Optym will provide a unique Tenant ID, Client ID, and a Client Secret. GET HTTPS request should be made using these keys to obtain a unique token.
It's important to note that the Client Secret will have a finite lifespan and must be periodically renewed by Optym to uphold security standards.
The token provided is short-lived, and the token generation response will include an "expires_on" timestamp. If the token expires while sending a message, the response code will be 401 - unauthenticated and accompanied by a descriptive body. In such instances, the token should be reacquired, and the message should be resubmitted accordingly.
Refer below to the 2 steps:
1. Generate Token:
HTTPS GET Request Details:
URL: https://login.microsoftonline.com/{TENANT_ID}/oauth2/token
Content-Type = Form data
Auth Headers: No Auth
Form Keys and Values:
["grant_type"] = "client_credentials"
["client_id"] = CLIENT_ID
["client_secret"] = CLIENT_SECRET
["resource"] = "https://eventhubs.azure.net"
Response codes: 201 Success. 401 Authorization failure. 400 Bad Request
2. Send Events:
The events should be sent to the event hub along with the token generated as a Bearer token in the headers of HTTPS POST request.
HTTPS POST Request Details:
URL: https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages
Headers:
Authorization: Bearer token, with the token generated in previous step
Content-Type: application/atom+xml;type=entry;charset=utf-8
Response codes: 201 Success. 401 Authorization failure. 500 Internal error
Refer to the right section that provides C# code for the implementation.
Terminology & Acronyms
Term |
Description |
Carrier's System |
Carrier’s IT System with which Optym LTL Suite will integrate for data exchange. |
Service |
It is specified by an origin terminal and a destination terminal with origin and destination being either an EOL or Hub which can generate and deliver freight. It usually has a type to denote how fast the service can deliver. It also has a count of days (a service standard) associated to denote within how many days the service must be delivered once picked up. |
Pickup |
Collection of freight from the local customers within the area of service of a terminal. |
Delivery |
Distribution of freight to the local customers within the area of service of a terminal. |
Origin |
The origin service center of a shipment. |
Destination |
The destination service center of a shipment. |
Status |
Status of the shipment, trailer, etc. based on context. |
Hazmat |
Acronym for hazardous material |
Skid |
A group of shipments kept together on a pallet such that can be handled by a forklift at one time |
Manifest |
A group of shipments loaded together on a trailer to a specific next destination |
Dispatch |
The movement of a driver starting at some terminal and ending at some terminal. Multiple dispatches constitute a schedule for the driver. |
Schedule(Alias: Run) |
A group of dispatches over multiple days which constitute a space-time tour for the driver |
Load |
A trailer loaded with shipments expressed as a trailer origin-destination pair. Load is also used to denote a link of a load plan. |
Domicile |
Terminal where a driver is based out of and hence would be the start and end point of a schedule |
Dolly |
Equipment which connects different trailers |
Swap |
Indicates the event of transferring shipments from one trailer to another to facilitate city pickups |
Break / Transfer |
The act of opening a load at a terminal to re-sort the shipments and put in a different trailer for the next Terminal |
Yard |
A slot in the parking or empty area of a terminal |
Dock |
A building in a terminal with bays and doors and facilitates much of the operations |
Terminal |
A facility with dock, yard, equipment, and labor which facilitates operations for a freight company in that location. Terminals constitute the service and operations network for the company. |
City |
Cities / Towns a terminal serve picking up from and delivering shipments to |
Team drivers |
Two drivers together on a schedule alternatively driving and sleeping |
Solo driver |
Single driver on a schedule |
Purchase / PT |
PT stands for purchase transportation. Purchase is hiring a vendor to move a load. A Purchase Available Count is the number of trips on a load on a day of week that can be purchased from a carrier. A Purchase Plan Counts is the number of trips on a load on a day of the week planned to be used by a carrier. |
Linehaul |
Part of the freight operations when shipments move from one terminal to another on their path using trailers |
Rail |
Part of the freight operations when shipments move from one terminal to another on their path using rail trailers |
Link |
A direct space path between two locations / terminals |
Shipper |
Party (customer) who is sender of the shipment from the city and is availing service from the freight company |
Consignee |
Party who is receiver of the shipment in the city |
Handling Unit |
Smallest unit(piece) in a shipment, multiples of which constitute a shipment |
Freezable |
Indicator of freezable material in the shipment |
Food |
Indicator of food material in the shipment |
Guaranteed |
Indicator of a shipment having a guaranteed delivery date |
Stackable |
Indicates if a shipment is sturdy enough to bear weight on top of its handling units |
Dimensioned |
Indicates if a shipment has its dimensions measured during the operations |
Close |
The event of closing a trailer |
Bobtail |
Driving a truck without an attached trailer |
Headload |
A headload is a group of one or more shipments with a common destination loaded in the nose of the trailer where the breakbulk terminal does not have to rehandle the freight, even though the load plan says that a terminal is to rehandle that load. |
Mode |
Medium of transport like linehaul, city, rail, purchase, etc. |
Carrier |
Party who transported a shipment |
Load Plan |
Path of a service constituted by origin, rehandling Terminals and destination written as a hyphen separated chain of Terminals |
Rehandle |
The act of handling a shipment again at a break terminal |
Proper |
Freight whose destination matches the destination of the load |
Duty |
Single day’s work on a schedule. Usually, 5 duties constitute a weeklong schedule. |
Terminal code |
3 letter unique alphabetical code of a Terminal |
Door |
A door at a terminal where trailer is docked and loading or unloading of shipments is done to or from the trailer |
Lay |
The act of driver staying at a Terminal away from domicile during his/her schedule |
Outbound |
Freight, load, or dispatch leaving a terminal |
Inbound |
Freight, load, or dispatch arriving at a terminal |
Route |
Actual space path taken by a trailer |
Customer |
Party who booked pickup of a shipment from the city and is availing service from the freight company |
Appointment |
Scheduled time window for a pickup or delivery operation in the city |
Pro |
A unique tracking number of a billed shipment. Also, used to denote a shipment |
Re-weighed |
Indicates if a shipment has been weighed during the operations |
Sub-shipment |
Parts of a single shipment that can be tracked individually |
Shift Plan |
Load Plan with shifts (or sorts) where a shift denotes departure shift (window) at the corresponding terminal |
Equipment |
This would refer to trailer, which comes in several types like pup, van, short van, etc. |
Primary driver / Secondary driver |
The two drivers forming a team for a schedule |
Certification |
Driver’s certification on driving clearances |
Seniority Date |
Date on which driver joined the firm. (Used for seniority-based decisions) |
Driver Type |
Type of the driver i.e., City, Linehaul, Contractor, Shuttle, Combo |
Driving Type |
What driving/routing the driver can do i.e., solo, team, sleeper |
Cab Type |
Type of cab for the tractor ex. Sleeper |
Priority Class |
Priority of the customer to be used in moving freight |
Thru |
Denotes a break freight |
Relay |
Act of a load passing by a terminal without breaking at it |
Transfer Capacity |
The amount of tonnage the Terminal can handle in a day. |
Minimum Handling Duration |
Minimum time a shipment would need to be rehandled at a terminal |
EOL |
End of line. Terminal with no break freight. |
Hub |
Breakbulk. Terminal with break freight. |
Events Specifications
The data update notification from the Carrier's system will be accepted by the following events. The LTL Integration system will queue the update event for ETL to execute.
Network Events
Location
UpdateLocation
{
"entityId":"ALN",
"eventType":"UpdateLocation",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"changeType":"Update",
"locationCode":"ALN",
"locationNumber":"1056",
"city":"Bethlehem",
"type":"EOL",
"state":"TX",
"country":"USA",
"latitude": 40.66,
"longitude": -75.38,
"timeZoneUTCOffset": -5.0,
"region":"HBG",
"secondaryRegion":"12",
"minTrailerRelayDuration": 30,
"minDriverRelayDuration": 30,
"obCloseTime":"10:30",
"ibDueTime":"08:00",
"adjacentHighways":"I-42",
"handlesThruFreight": true,
"driverHourlyDockCost": 50.0,
"handlingCost": 72.0,
"doorCount": 20,
"yardSpaceCount": 79,
"dockHandlingPerHour": 80.0,
"layCost": 50.0,
"dockCapacityPerHour": 1000000,
"weightLoadAverageTarget": 15000,
"IANATimeZone":"America/New_York",
"hasMaintenanceGarage": true,
"operatingShifts": [
{
"shiftName":"Dayshift",
"shiftType":"Day",
"shiftFreightType": [
"NextDay",
"SameDay",
"Priority"
],
"linehaulDoorAllocationFraction": 0.2,
"minProcessingDurationInMinutes": 30,
"dockHeadCount": 52,
"dockProcessingCost": 2.0,
"shiftHours": [
{
"shiftStartDay":"Mon",
"shiftStartTime":"23:30",
"shiftEndDay":"Wed",
"shiftEndTime":"23:30"
}
]
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ALN",
"eventType": "UpdateLocation",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"changeType": "Update",
"locationCode": "ALN",
"locationNumber": "1056",
"city": "Bethlehem",
"type": "EOL",
"state": "TX",
"country": "USA",
"latitude": 40.66,
"longitude": -75.38,
"timeZoneUTCOffset": -5.0,
"region": "HBG",
"secondaryRegion": "12",
"minTrailerRelayDuration": 30,
"minDriverRelayDuration": 30,
"obCloseTime": "10:30",
"ibDueTime": "08:00",
"adjacentHighways": "I-42",
"handlesThruFreight": true,
"driverHourlyDockCost": 50.0,
"handlingCost": 72.0,
"doorCount": 20,
"yardSpaceCount": 79,
"dockHandlingPerHour": 80.0,
"layCost": 50.0,
"dockCapacityPerHour": 1000000,
"weightLoadAverageTarget": 15000,
"IANATimeZone": "America/New_York",
"hasMaintenanceGarage": true,
"operatingShifts": [
{
"shiftName": "Dayshift",
"shiftType": "Day",
"shiftFreightType": [
"NextDay",
"SameDay",
"Priority"
],
"linehaulDoorAllocationFraction": 0.2,
"minProcessingDurationInMinutes": 30,
"dockHeadCount": 52,
"dockProcessingCost": 2.0,
"shiftHours": [
{
"shiftStartDay": "Mon",
"shiftStartTime": "23:30",
"shiftEndDay": "Wed",
"shiftEndTime": "23:30"
}
]
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ALN |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the Location |
eventType |
UpdateLocation |
Y |
String |
Length: [1-50] |
It must be UpdateLocation. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
changeType |
Add, Update |
N |
String |
Length: [1-50] |
|
If the Location is Added or Updated. |
locationCode |
ALN |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique alphabetical code for location. |
locationNumber |
1056 |
N |
String |
Length: [1-50] |
|
Additional unique identifier of the location. Usually an interger |
city |
Bethlehem |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Name of the city where the location is situated. Defaults are taken from locationCode values |
type |
EOL/HUB/Relay |
Y |
String |
Length: [1-50] |
It should be one of the predefined types of locations the client has. Event will be rejected if it is not provided. |
Describes whether the location is EOL, Hub, Relay, etc. |
state |
TX |
Y |
String |
Length: [1-50] |
Any string denoting a state, province, or territory. Event will be rejected if it is not provided. |
Code for the state, province, or territory in which the location is located. |
country |
USA |
N |
String |
Length: [1-50] |
|
Country or country code |
latitude |
40.66 |
Y |
Number |
Number |
Minimum acceptable value: -90; Maximum acceptable value: 90 (For the continental US, this valueis always negative). Event will be rejected if it is not provided. |
Latitude coordinates for the location |
longitude |
-75.38 |
Y |
Number |
Number |
Minimum acceptable value: -180; Maximum acceptable value: 180 (For the continental US, this valueis always negative). Event will be rejected if it is not provided. |
Longitude coordinates for the location. |
timeZoneUTCOffset |
-5 |
N |
Number |
-12 to 14 |
|
Time zone of the location offset from UTC |
region |
HBG |
N |
String |
Length: [1-50] |
Should be one from the predefined values. |
Primary region of the location |
secondaryRegion |
12 |
N |
String |
Length: [1-50] |
Should be one from the predefined values. |
Secondary region of the location |
minTrailerRelayDuration |
30 |
N |
Integer |
Non-negative Integer |
|
Minimum time in minutes each trailer must be spent at the location during relay operation |
minDriverRelayDuration |
30 |
N |
Integer |
Non-negative Integer |
|
Minimum time in minutes each driver must spend at the location during relay operation |
obCloseTime |
10:30 |
N |
String |
hh:mm |
|
End time of outbound operations in the local timezone. |
ibDueTime |
08:00 |
N |
String |
hh:mm |
|
Latest time freight should reach location to go into the city in the local timezone |
adjacentHighways |
I-20, I-42 |
N |
String |
Length: [1-150] |
|
Comma separated highway codes adjacent to location |
handlesThruFreight |
false and true |
N |
Boolean |
Boolean |
|
Does the location handle thru freight? |
driverHourlyDockCost |
50 |
N |
Number |
Number |
|
Cost of driver working on the dock at the location |
handlingCost |
72 |
N |
Number |
Number |
|
Cost of handling a shipment on the dock at the location in USD. |
doorCount |
20 |
N |
Integer |
Non-negative Integer |
|
Total number of doors at the location |
yardSpaceCount |
79 |
N |
Integer |
Non-negative Integer |
|
Total number of parking spaces in the yard at the location |
dockHandlingPerHour |
80 |
N |
Number |
Number |
|
Number of shipments that can be handled per hour. Unit: shipments/hour |
layCost |
50 |
N |
Number |
Number |
|
Cost of driver staying at a foreign location |
dockCapacityPerHour |
1000000 |
N |
Integer |
Non-negative Integer |
|
The amount of tonnage the location can handle in a day |
weightLoadAverageTarget |
15000 |
N |
Integer |
Positive Integer |
Should be between 0 and 100,000 |
Tells the standard weight load average location targets or assumes for projections |
IANATimeZone |
America/New_York |
N |
String |
Length: [1-50] |
|
IANA time zone value |
hasMaintenanceGarage |
True, False |
N |
Boolean |
Boolean |
|
Whether location has a garage where equipment maintenance can happen |
operatingShifts |
|
N |
Array |
|
|
The details of each of the operating shifts for the location. |
operatingShifts properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
shiftName |
Dayshift, HVXP |
Y |
String |
Length: [1-50] |
Should be one from the predefined values. Shift information will be rejected if not valid. Event will be rejected if it is not provided. |
Name of the shift. |
shiftType |
OB, Hub, IB |
N |
String |
Length: [1-50] |
Should be one from the predefined values. |
This tells us which of the special cycle model shifts this window belongs to. (This value will also appear in cycle based load plans). |
shiftFreightType |
["NextDay", "SameDay", "Priority"] |
N |
String Array |
String Array |
Should be one from the predefined values. |
This tells us what kind of freight is eligible for handling in this window. We can use this to limit specific kinds of shipments being handled in certain windows. |
linehaulDoorAllocationFraction |
0.2 |
N |
Number |
Non-negative Number |
Between 0 and 1 |
Fraction of total doors that are allocated for linehaul operation. Default values are taken from parameters. |
minProcessingDurationInMinutes |
30 |
N |
Integer |
Positive Integer |
Should be a non-negative number. |
The model uses this number to determine the earliest time a shipment can be sent on a load after arriving at the location. We recommend you provide the time it takes to rehandle an entire trailer during this operating window. Default values are taken from parameters. |
dockHeadCount |
52 |
N |
Integer |
Non-negative Integer |
|
Count of the dock workers available in the operating shift. |
dockProcessingCost |
2 |
N |
Number |
Non-negative Number |
|
Cost of handling a shipment on the dock at the location in this shift. Default values are taken from parameters. |
shiftHours |
|
N |
Array |
|
|
Defines the days and hours used for the defined Operating Shift across the week |
shiftHours properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
shiftStartDay |
Mon |
Y |
String |
Length: [3] |
String specifying days of the week. Should be one from predefined values. Event will be rejected if it is not provided. |
Start day of the shift |
shiftStartTime |
23:30 |
Y |
String |
hh:mm |
Event will be rejected if it is not provided. |
Start time of the shift in the local timezone |
shiftEndDay |
Wed |
Y |
String |
Length: [3] |
String specifying days of the week. Should be one from predefined values. Event will be rejected if it is not provided. |
End day of the shift |
shiftEndTime |
23:30 |
Y |
String |
hh:mm |
Event will be rejected if it is not provided. |
End time of the shift in the local timezone |
DeleteLocation
{
"entityId":"ALN",
"eventType":"DeleteLocation",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"locationCode":"ALN"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ALN",
"eventType": "DeleteLocation",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"locationCode": "ALN"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ALN |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the Location |
eventType |
DeleteLocation |
Y |
String |
Length: [1-50] |
It must be DeleteLocation. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
locationCode |
ALN |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique alphabetical code for Location. |
Link
UpdateLink
{
"entityId":"ALN-ABL-NoHazmat",
"eventType":"UpdateLink",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"changeType":"Add",
"origin":"ALN",
"destination":"ABL",
"distance": 474,
"teamTravelDurationInMinutes": 257,
"soloTravelDurationInMinutes": 357,
"soloCostPerDistanceUnit": 1.8,
"teamCostPerDistanceUnit": 2.1,
"routeType":"NoHazmat",
"isShuttleLink": true,
"isPartnerMove": true,
"thirdPartyOnly": true,
"highwaysUsed":"I-20",
"equipmentConfigurations": [
{
"equipmentType":"shortPup",
"countPerTractor": 2
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ALN-ABL-NoHazmat",
"eventType": "UpdateLink",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"changeType": "Add",
"origin": "ALN",
"destination": "ABL",
"distance": 474,
"teamTravelDurationInMinutes": 257,
"soloTravelDurationInMinutes": 357,
"soloCostPerDistanceUnit": 1.8,
"teamCostPerDistanceUnit": 2.1,
"routeType": "NoHazmat",
"isShuttleLink": true,
"isPartnerMove": true,
"thirdPartyOnly": true,
"highwaysUsed": "I-20",
"equipmentConfigurations": [
{
"equipmentType": "shortPup",
"countPerTractor": 2
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ALN-ABL-NoHazmat |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique indentifier of the Link |
eventType |
UpdateLink |
Y |
String |
Length: [1-50] |
It must be UpdateLink. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
changeType |
Add, Update |
N |
String |
Length: [1-50] |
|
If the Link is Added or Updated. |
origin |
ALN |
Y |
String |
Length: [1-50] |
Should be among locations defined in the locations data. Event will be rejected if it is not provided. |
Link Origin Code |
destination |
ABL |
Y |
String |
Length: [1-50] |
Should be among locations defined in the locations data and not same as origin. |
Link Destination Code |
distance |
474 |
Y |
Integer |
Positive Integer |
Can't be negative. Event will be rejected if it is not provided. |
Distance between the origin and destination |
teamTravelDurationInMinutes |
257 |
N |
Integer |
Positive Integer |
Can't be negative |
Team Travel Time in Minutes |
soloTravelDurationInMinutes |
357 |
Y |
Integer |
Positive Integer |
Can't be negative. Event will be rejected if it is not provided. |
Solo Travel Time in Minutes |
soloCostPerDistanceUnit |
1.8 |
Y |
Number |
Positive Number |
Can't be negative. Event will be rejected if it is not provided. |
USD per mile for Solo |
teamCostPerDistanceUnit |
2.1 |
N |
Number |
Positive Number |
Can't be negative |
USD per mile for Team |
routeType |
NoHazmat |
N |
String |
Length: [1-50] |
From predefined values |
Describes restrictions or abilities about link supporting hazmat or other special properties. |
isShuttleLink |
true, false |
N |
Boolean |
Boolean |
|
Do shuttle movements move tractors on the link. |
isPartnerMove |
True, false |
N |
Boolean |
Boolean |
|
Is trailer moved by Partner |
thirdPartyOnly |
true, false |
N |
Boolean |
Boolean |
|
Is the link used only by the third party carriers and not by the company drivers. |
highwaysUsed |
I-20, I-42 |
N |
String |
Length: [1-150] |
|
The highways used while travelling from the link origin to link destination. |
equipmentConfigurations |
Equipment Config Object |
N |
Array |
|
|
An array of Equipment Config objects. Refer to Equipment Config Properties in the below section. |
equipmentConfigurations properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
equipmentType |
shortPup, longPup |
Y |
String |
Length: [1-50] |
From predefined values. Event will be rejected if it is not provided |
Defines the type of equipment |
countPerTractor |
2 |
Y |
Integer |
Positive Integer |
Event will be rejected if it is not provided |
Max number of pups of given type in the tractor. |
DeleteLink
{
"entityId":"ALN-ABL-NoHazmat",
"eventType":"DeleteLink",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"origin":"ALN",
"destination":"ABL",
"routeType":"NoHazmat"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ALN-ABL-NoHazmat",
"eventType": "DeleteLink",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"origin": "ALN",
"destination": "ABL",
"routeType": "NoHazmat"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ALN-ABL-NoHazmat |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the Link |
eventType |
DeleteLink |
Y |
String |
Length: [1-50] |
It must be DeleteLink. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
origin |
ALN |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Link Origin Code |
destination |
ABL |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Link Destination Code |
routeType |
NoHazmat |
N |
String |
Length: [1-50] |
From predefined values |
Describes restrictions or abilities about link supporting hazmat or other special properties. |
PT Lane
UpdatePTLane
{
"entityId":"ATL-LAX-JBHunt-1080",
"eventType":"UpdatePTLane",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"changeType":"Update",
"purchaseLaneId":"ATL-LAX-JBHunt-1080",
"origin":"ATL",
"destination":"LAX",
"transportMode":"Road",
"carrierId":"JBHunt",
"drivingType":"Solo",
"trailerType":"Long Van",
"carrierSuppliesTrailer": true,
"costPerTrip": 1200,
"cancellationCost": 400,
"travelDurationInMinutes": 1080,
"distance": 1500,
"availabilityByDay": [
{
"dayOfWeek":"SUN",
"availableTripCount": 3
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ATL-LAX-JBHunt-1080",
"eventType": "UpdatePTLane",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"changeType": "Update",
"purchaseLaneId": "ATL-LAX-JBHunt-1080",
"origin": "ATL",
"destination": "LAX",
"transportMode": "Road",
"carrierId": "JBHunt",
"drivingType": "Solo",
"trailerType": "Long Van",
"carrierSuppliesTrailer": true,
"costPerTrip": 1200,
"cancellationCost": 400,
"travelDurationInMinutes": 1080,
"distance": 1500,
"availabilityByDay": [
{
"dayOfWeek": "SUN",
"availableTripCount": 3
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ATL-LAX-JBHunt-1080 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the PT Lane |
eventType |
UpdatePTLane |
Y |
String |
Length: [1-50] |
It must be UpdatePTLane. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
changeType |
Add, Update |
N |
String |
Length: [1-50] |
|
If the PT Lane is Added or Updated. |
purchaseLaneId |
ATL-LAX-JBHunt-1080 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
A unique PT lane identifier |
origin |
ATL |
Y |
String |
Length: [1-50] |
Should be among location codes defined in the locations data. Event will be rejected if it is not provided. |
Location code from which purchase movement moves. |
destination |
LAX |
Y |
String |
Length: [1-50] |
Should be among location codes defined in the locations data. Event will be rejected if it is not provided. |
Location code to which purchase movement moves. |
transportMode |
Road, Air, Ocean |
N |
String |
Length: [1-50] |
Should be in acceptable values |
Defines the type of purchase. |
carrierId |
JBHunt |
N |
String |
Length: [1-50] |
|
SCAC code for PT carrier (or unique identifying code for PT carrier) |
drivingType |
Solo |
Y |
String |
Length: [1-50] |
Should be "Solo" or "Team". Event will be rejected if it is not provided. |
This value distinguishes whether the PT schedule is solo run or a team run. |
trailerType |
Long Van |
N |
String |
Length: [1-50] |
Should be in the equipment types list agreed upon ahead of time. |
Type of equipment the PT carrier pulls. |
carrierSuppliesTrailer |
TRUE |
N |
Boolean |
Boolean |
|
This field indicates if the PT carrier pulls their own trailer, or if they pull the LTL carrier's trailer |
costPerTrip |
1200 |
Y |
Integer |
Positive Number |
Event will be rejected if it is not provided. |
Cost to use this purchase lane with this purchase carrier. |
cancellationCost |
400 |
N |
Integer |
Positive Number |
|
Cost to cancel this purchase move if it is planned but then cancelled. |
travelDurationInMinutes |
1080 |
Y |
Integer |
Positive Integer |
Event will be rejected if it is not provided. |
Travel time in minutes from purchase origin to purchase destination |
distance |
1500 |
N |
Integer |
Positive Integer |
Can't be negative |
Distance between the origin and destination |
availabilityByDay |
|
N |
Array |
|
|
Available equipment counts by day of week |
availabilityByDay properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
dayOfWeek |
SUN, or MON, or ., SAT |
Y |
String |
Length: [3] |
Should one among 'SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'. Event will be rejected if it is not provided. |
Day of week |
availableTripCount |
3 |
Y |
Integer |
Non-negative Integer |
Event will be rejected if it is not provided |
Available equipment counts on the specific day of week. |
DeletePTLane
{
"entityId":"ATL-LAX-JBHunt-1080",
"eventType":"DeletePTLane",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"purchaseLaneId":"ATL-LAX-JBHunt-1080"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ATL-LAX-JBHunt-1080",
"eventType": "DeletePTLane",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"purchaseLaneId": "ATL-LAX-JBHunt-1080"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ATL-LAX-JBHunt-1080 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique indentifier of the PT Lane |
eventType |
DeletePTLane |
Y |
String |
Length: [1-50] |
It must be DeletePTLane. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
purchaseLaneId |
ATL-LAX-JBHunt-1080 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
A unique PT lane identifier |
Rail Link
UpdateRailLink
{
"entityId":"CGO-FON-BNSF-1",
"eventType":"UpdateRailLink",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"changeType":"Update",
"railLinkId":"CGO-FON-BNSF-1",
"origin":"CGO",
"destination":"FON",
"departureTime":"16:00",
"arrivalTime":"07:00",
"daysEnRoute": 2,
"totalRailDistance": 1000,
"totalDrayageDistance": 50,
"carrierList": [
"KNSW",
"BNSF",
"NOSO"
],
"passThrough":"extraField1, extraField2",
"availabilityByDay": [
{
"dayOfWeek":"SUN",
"hasDeparture":"TRUE"
}
],
"equipmentTypeCosts": [
{
"equipmentType":"longPup",
"equipmentOwner":"BNSF",
"loadedCost": 2000.0,
"emptyCost": 1000.0,
"dailyAvailableCount": 2
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "CGO-FON-BNSF-1",
"eventType": "UpdateRailLink",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"changeType": "Update",
"railLinkId": "CGO-FON-BNSF-1",
"origin": "CGO",
"destination": "FON",
"departureTime": "16:00",
"arrivalTime": "07:00",
"daysEnRoute": 2,
"totalRailDistance": 1000,
"totalDrayageDistance": 50,
"carrierList": [
"KNSW",
"BNSF",
"NOSO"
],
"passThrough": "extraField1, extraField2",
"availabilityByDay": [
{
"dayOfWeek": "SUN",
"hasDeparture": "TRUE"
}
],
"equipmentTypeCosts": [
{
"equipmentType": "longPup",
"equipmentOwner": "BNSF",
"loadedCost": 2000.0,
"emptyCost": 1000.0,
"dailyAvailableCount": 2
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
CGO-FON-BNSF-1 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique indentifier of the rail link |
eventType |
UpdateRailLink |
Y |
String |
Length: [1-50] |
It must be UpdateRailLink |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
changeType |
Add, Update |
N |
String |
Length: [1-50] |
|
If the rail link is Added or Updated. |
railLinkId |
CGO-FON-BNSF-1 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
A unique rail link identifier |
origin |
CGO |
Y |
String |
Length: [1-50] |
Should be among location codes defined in the locations data. Event will be rejected if it is not provided. |
Location code of rail link origin. |
destination |
FON |
Y |
String |
Length: [1-50] |
Should be among location codes defined in the locations data. Event will be rejected if it is not provided. |
Location code of rail link destination. |
departureTime |
16:00 |
Y |
String |
hh:mm |
Event will be rejected if it is not provided |
This is the time the trailer departs from origin |
arrivalTime |
07:00 |
Y |
String |
hh:mm |
Event will be rejected if it is not provided |
This is the time the trailer arrives at destination |
daysEnRoute |
2 |
Y |
Integer |
Non-negative Integer |
Event will be rejected if it is not provided |
Business days for transit from origin to destination |
totalRailDistance |
1000 |
N |
Integer |
Positive Integer |
|
Sum of miles of all rail portions that makeup the rail movement from rail origin to destination |
totalDrayageDistance |
50 |
N |
Integer |
Non-negative Integer |
|
Sum of miles of all rail drayage portions from rail origin to destination |
carrierList |
["KNSW", "BNSF", "NOSO"] |
N |
String array |
String array |
|
List of carriers in the order in which they are used for rail movement |
passThrough |
comma-separated field names which are pass-through. Example extraField1, extraField2 |
N |
String |
Length: [1-100] |
|
These fields' values will be stored in Optym LTL Suite but not processed for any Business logic. |
availabilityByDay |
|
N |
Array |
|
|
Rail availability by day of week. |
equipmentTypeCosts |
|
N |
Array |
|
|
Costs related to the equipment used on rail lane by carrier |
availabilityByDay properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
dayOfWeek |
SUN', 'MON',..'SAT' |
Y |
String |
Length: [3] |
Should one among 'SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'. Event will be rejected if it is not provided |
Day of week |
hasDeparture |
True, False |
Y |
Bool |
Boolean |
Event will be rejected if it is not provided |
Denotes if rail link is available on the specific day of week. |
equipmentTypeCosts properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
equipmentType |
shortPup, longPup |
Y |
String |
Length: [1-50] |
From predefined values |
Defines the type of equipment |
equipmentOwner |
BNSF, CSX |
N |
String |
Length: [1-50] |
|
Unique identifying code for rail carrier |
loadedCost |
2000 |
Y |
Number |
Positive Number |
Event will be rejected if it is not provided |
Cost to use this lane with this rail carrier |
emptyCost |
1000 |
N |
Number |
Positive Number |
|
Cost to run empty on this lane with this rail carrier |
dailyAvailableCount |
2 |
N |
Integer |
Non-negative Integer |
|
Available equipment counts on each day of the week. |
DeleteRailLink
{
"entityId":"CGO-FON-BNSF-1",
"eventType":"DeleteRailLink",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"railLinkId":"CGO-FON-BNSF-1"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "CGO-FON-BNSF-1",
"eventType": "DeleteRailLink",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"railLinkId": "CGO-FON-BNSF-1"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
CGO-FON-BNSF-1 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique indentifier of the rail link |
eventType |
DeleteRailLink |
Y |
String |
Length: [1-50] |
It must be DeleteRailLink. Event will be rejected if it is not provided |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
railLinkId |
CGO-FON-BNSF-1 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
A unique rail link identifier |
Service
UpdateService
{
"entityId":"ABC-DAL-Economy",
"eventType":"UpdateService",
"origin":"ABC",
"destination":"DAL",
"source":"docksystem",
"serviceDays": 2.0,
"serviceType":"Economy",
"earliestDepartureTime":"22:30",
"latestArrivalTime":"22:46",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"loadPlan": [
{
"sequence": 2.0,
"loadOrigin":"ATL",
"loadDestination":"DLS",
"loadOriginShift":"Hub",
"loadDestinationShift":"Hub",
"cutTime":"22:00",
"transitDays": 5
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ABC-DAL-Economy",
"eventType": "UpdateService",
"origin": "ABC",
"destination": "DAL",
"source": "docksystem",
"serviceDays": 2.0,
"serviceType": "Economy",
"earliestDepartureTime": "22:30",
"latestArrivalTime": "22:46",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"loadPlan": [
{
"sequence": 2.0,
"loadOrigin": "ATL",
"loadDestination": "DLS",
"loadOriginShift": "Hub",
"loadDestinationShift": "Hub",
"cutTime": "22:00",
"transitDays": 5
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ABC-DAL-Economy |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the event |
eventType |
UpdateService |
Y |
String |
Length: [1-50] |
It must be UpdateService. Event will be rejected if it is not provided. |
Type of the event |
origin |
ABC |
Y |
String |
Length: [1- 50] |
Any Terminal code that is present in the Terminals file. |
Origin location of the service. |
destination |
DAL |
Y |
String |
Length: [1- 50] |
Any Terminal code that is present in the Terminals file. |
Destination location of the manifest. |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
serviceDays |
2 |
Y |
Number |
Range: [0-Max] |
Should be a non-negative integer |
The number of days the service must be delivered once it has been picked up. Next day service has a value of 1. |
serviceType |
Economy |
N |
String |
Length: [1- 50] |
If not given, then default service type will be assumed |
Type of service provided for freight delivery. |
earliestDepartureTime |
10:30 |
N |
String |
hh:mm |
00:00 to "23:59 |
Time in the local timezone at which the service enters LTL network (time before which a shipment cannot be sent from origin). |
latestArrivalTime |
22:46 |
N |
String |
hh:mm |
00:00 to "23:59 |
Time in the local timezone at which the service exits from the LTL network (time after which a shipment will be marked late) |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
String YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when the UpdateService happened |
loadPlan |
|
Y |
String Array |
Array |
Check the loadPlan array in the table below. |
Path through valid break/rehandle terminals separated by hyphen. This path includes the origin and destination. |
loadPlan properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
sequence |
1 |
Y |
Number |
Range: [1-Max] |
|
Sequence of the load in the load plan. |
loadOrigin |
ATL |
Y |
String |
Length: [1- 50] |
Any Terminal code that is present in the Terminals file. |
Origin of the load. |
loadDestination |
DLS |
Y |
String |
Length: [1- 50] |
Any Terminal code that is present in the Terminals file. |
Destination of the load. |
loadOriginShift |
Hub, OB |
N |
String |
Length: [1- 50] |
Should be among the pre-defined values |
Shift in which the origin handling is happening for the service of the given load. |
loadDestinationShift |
HUB, OB |
N |
String |
Length: [1- 50] |
Should be among the pre-defined values |
Shift in which the destination handling is happening for the service of the given load. |
cutTime |
21:00 |
N |
String |
hh:mm |
00:00 to "23:59 |
Time in the local timezone at which the service needs to leave a load origin in the LTL network to fulfil the service per carrier |
transitDays |
3 |
N |
Integer |
Range: [0-Max] |
Should be a non-negative integer |
Number of midnights crossed from origin to destination. Crossing of Friday or Saturday midnight does not count towards this count. |
DeleteService
{
"entityId":"ALN-ABL-Priority",
"eventType":"DeleteService",
"eventDateTime":"2020-12-13T 18:39:13.023Z",
"source":"docksystem",
"origin":"ALN",
"destination":"ABL",
"serviceType":"Priority"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ALN-ABL-Priority",
"eventType": "DeleteService",
"eventDateTime": "2020-12-13T 18:39:13.023Z",
"source": "docksystem",
"origin": "ALN",
"destination": "ABL",
"serviceType": "Priority"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ALN-ABL-Priority |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the service |
eventType |
DeleteService |
Y |
String |
Length: [1-50] |
It must be DeleteService. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-12-13T 18:39:13.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when the Delete Service happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
origin |
ALN |
Y |
String |
Length: [1-50] |
Should be among locations defined in the locations data. Event will be rejected if it is not provided. |
Code of Origin Terminal for the service |
destination |
ABL |
Y |
String |
Length: [1-50] |
Should be among locations defined in the locations data and not same as origin. |
Code of Destination Terminal for the service |
serviceType |
Priority |
N |
String |
Length: [1- 50] |
One of Predefined values: Priority/Economy/Standard. If not given, then default service type assumed. |
Determines what kind of service is defined on the shipment. Usually defines service days. |
Resource Events
Driver
UpdateDriver
{
"entityId":"AB7423",
"eventType":"UpdateDriver",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"changeType":"Add",
"domicile":"ALN",
"driverId":"AB7423",
"shortName":"John",
"fullName":"John Welch",
"driverType":"Team",
"availabilityStatus":"AVL",
"seniorityDate":"2024-09-18",
"teamPartnerId":"CD5688",
"drivingType":"Solo",
"currentLocation":"ATL",
"currentActivity":"Enroute",
"dutyStatus":"OffDuty",
"nextAvailableDate":"2022-09-26",
"nextAvailableTime":"22:30",
"remainingDutyTime": 60,
"remainingDriveTime": 90,
"remainingWeeklyDutyTime": 90,
"tomorrowAvailableWeeklyDutyTime": 112,
"currentTractor":"ab1234",
"lastStatusTime":"2020-01-02T13:07:49.023Z",
"longTermDriverStatus":"OnLeave",
"assignedTractor":"abc1234",
"externalDriverId":"xyz1234",
"certifications": [
{
"name":"isLCVCertified",
"issued": true
}
],
"driverPreferences": [
{
"homeFrequency":"Daily"
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "AB7423",
"eventType": "UpdateDriver",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"changeType": "Add",
"domicile": "ALN",
"driverId": "AB7423",
"shortName": "John",
"fullName": "John Welch",
"driverType": "Team",
"availabilityStatus": "AVL",
"seniorityDate": "2024-09-18",
"teamPartnerId": "CD5688",
"drivingType": "Solo",
"currentLocation": "ATL",
"currentActivity": "Enroute",
"dutyStatus": "OffDuty",
"nextAvailableDate": "2022-09-26",
"nextAvailableTime": "22:30",
"remainingDutyTime": 60,
"remainingDriveTime": 90,
"remainingWeeklyDutyTime": 90,
"tomorrowAvailableWeeklyDutyTime": 112,
"currentTractor": "ab1234",
"lastStatusTime": "2020-01-02T13:07:49.023Z",
"longTermDriverStatus": "OnLeave",
"assignedTractor": "abc1234",
"externalDriverId": "xyz1234",
"certifications": [
{
"name": "isLCVCertified",
"issued": true
}
],
"driverPreferences": [
{
"homeFrequency": "Daily"
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
AB7423 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the Driver |
eventType |
UpdateDriver |
Y |
String |
Length: [1-50] |
It must be UpdateDriver. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
changeType |
Add, Update |
N |
String |
Length: [1-50] |
|
If the Driver is Added or Updated. |
domicile |
ALN |
Y |
String |
Length: [1-50] |
Should be a location code. Should be alphaNumeric. Event will be rejected if it is not provided. |
Domicile |
driverId |
AB7423 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Employee number |
shortName |
John |
N |
String |
Length: [1-50] |
|
Short Name |
fullName |
John Welch |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Full Name |
driverType |
Team, City, Contractor |
Y |
String |
Length: [1-50] |
Should be from pre-defined values. Event will be rejected if it is not provided. |
Driver Type |
availabilityStatus |
AVL, OTR, OUT, PUD |
N |
String |
Length: [1-50] |
Should be from pre-defined values |
Availability Status |
seniorityDate |
2024-09-18 |
N |
String |
YYYY-MM-DD |
|
Helps to determine seniority among the drivers |
teamPartnerId |
CD5688 |
N |
String |
Length: [1-50] |
|
Team Partner Number |
drivingType |
Solo |
N |
String |
Length: [1-50] |
Should be one of the predefined driving types. |
What kind of driving/routing can the driver do i.e., solo, team, sleeper. |
currentLocation |
ATL |
N |
String |
Length: [1-50] |
|
If the driver is at a location, then that location. If driver is enroute, then the new location where he/she is expected to be. |
currentActivity |
Enroute |
N |
String |
Length: [1-50] |
|
If working, then what is the driver currently doing. This is used for the planning and operations |
dutyStatus |
OffDuty |
N |
String |
Length: [1-50] |
Among the predefined list of values |
Tells the service status of driver like offDuty or the specific activity if on duty. This helps in ensuring govt regulations are complied with respect to driving and duty hours |
nextAvailableDate |
2022-09-26 |
N |
String |
YYYY-MM-DD |
|
What is the earliest date when the driver be available? Will be used for drivers that are on rest now and will be working after some time. |
nextAvailableTime |
22:30 |
N |
String |
hh:mm |
|
What is the earliest time in the local timezone when the driver be available? Will be used for drivers that are on rest now and will be working after some time |
remainingDutyTime |
60 |
N |
Integer |
Integer |
Should be a non-negative number |
For driver on duty, what is the remaining allowed duty time in minutes |
remainingDriveTime |
90 |
N |
Integer |
Integer |
Should be a non-negative number |
For driver on duty, what is the remaining allowed drive time in minutes |
remainingWeeklyDutyTime |
90 |
N |
Integer |
Integer |
Should be a non-negative number |
For driver what is the remaining allowed drive time for the weekly shift in minutes |
tomorrowAvailableWeeklyDutyTime |
112 |
N |
Integer |
Integer |
Should be a non-negative number |
For driver, what is the potential duty time available for tomorrow from the weekly shift in minutes |
currentTractor |
ab1234 |
N |
String |
Length: [1-50] |
Among the tractors in static tractor data |
Tractor pulled by the driver |
lastStatusTime |
2020-01-02T13:07:49.023Z |
N |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
|
Last time when the status of the driver was updated in UTC. |
longTermDriverStatus |
OnLeave |
N |
String |
Length: [1-50] |
|
Describes the status of the driver who will be unavailable for a long term due to leaves, termination, or any other reasons. |
assignedTractor |
abc1234 |
N |
String |
Length: [1-50] |
Among the tractors in static tractor data |
The dedicated tractor for the driver. This may or may not be the current tractor the driver is using. |
externalDriverId |
xyz1234 |
N |
String |
Length: [1-50] |
|
If the driver is from another company, then the code used for the driver in that company. Typically, this will be used when the driver is contracted. |
certifications |
An array of certificates |
N |
Array |
|
|
An array of Certificate objects. Refer to Certificate Properties in the below section. |
driverPreferences |
An array of driver preferences |
N |
Array |
|
|
Describes the specific preferences that driver has. This can be used for driver's preference for home return frequency, geographical direction to drive, etc. |
certifications properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
name |
isLCVCertified, isDockCertified |
N |
Stirng |
Length: [3-20] |
Should be one of the pre-defined type |
Name of the certificate |
issued |
true,false |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Is this certificate issued to driver |
driverPreferences properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
homeFrequency |
Daily |
N |
String |
Length: [1-50] |
|
Describes how often driver wants to come back home |
DeleteDriver
{
"entityId":"AB7423",
"eventType":"DeleteDriver",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"driverId":"AB7423"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "AB7423",
"eventType": "DeleteDriver",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"driverId": "AB7423"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
AB7423 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the Driver |
eventType |
DeleteDriver |
Y |
String |
Length: [1-50] |
It must be DeleteDriver. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
driverId |
AB7423 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Employee number |
Trailer
UpdateTrailer
{
"entityId":"ab2356",
"eventType":"UpdateTrailer",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"trailerId":"ab2356",
"equipmentType":"Pup",
"headloadLocation":"DLS",
"headloadShift":"Hub",
"tailloadLocation":"ATL",
"tailloadShift":"Hub",
"shipmentArray": [
"12345",
"12345"
],
"tractorNumber":"ab1234",
"trailerScac":"ABCD",
"PDRouteId":"ab1234",
"latitude": 40.66,
"longitude": -75.38,
"domicile":"ATL",
"description":"Used on Florida lanes",
"availabilityStatus":"Active",
"currentStatus":"En Route",
"owner": true,
"length": 48,
"weightCapacity": 10000,
"skidCapacity": 100,
"volumeCapacity": 1000,
"doorLocation":"15",
"yardLocation":"245",
"lastStatusTime":"2020-12-13T 18:39:13.023Z",
"hookedTo": [
"Trailer: 1234",
"Tractor: 1322"
],
"hasLiftGate": true,
"technology":"GPS"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab2356",
"eventType": "UpdateTrailer",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"trailerId": "ab2356",
"equipmentType": "Pup",
"headloadLocation": "DLS",
"headloadShift": "Hub",
"tailloadLocation": "ATL",
"tailloadShift": "Hub",
"shipmentArray": [
"12345",
"12345"
],
"tractorNumber": "ab1234",
"trailerScac": "ABCD",
"PDRouteId": "ab1234",
"latitude": 40.66,
"longitude": -75.38,
"domicile": "ATL",
"description": "Used on Florida lanes",
"availabilityStatus": "Active",
"currentStatus": "En Route",
"owner": true,
"length": 48,
"weightCapacity": 10000,
"skidCapacity": 100,
"volumeCapacity": 1000,
"doorLocation": "15",
"yardLocation": "245",
"lastStatusTime": "2020-12-13T 18:39:13.023Z",
"hookedTo": [
"Trailer: 1234",
"Tractor: 1322"
],
"hasLiftGate": true,
"technology": "GPS"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab2356 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the trailer |
eventType |
UpdateTrailer |
Y |
String |
Length: [1-50] |
It must be UpdateTrailer. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
trailerId |
ab2356 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identification of the trailer. |
equipmentType |
Pup, Short Van |
Y |
String |
Length: [1- 50] |
Should be one from the predefined values. Event will be rejected if it is not provided. |
The equipment used on a load (pup, van, short van, etc.). Defaults to pup. |
headloadLocation |
DLS |
N |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric |
If the trailer has a headload, then the Location to which the headload is destined to |
headloadShift |
Hub, OB |
N |
String |
Length: [1- 50] |
Should be one from the predefined values |
If the trailer has a headload, then the type of freight that the headload is composed of |
tailloadLocation |
ATL |
N |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric |
If the trailer has a tailload, then the Location to which the tailload is destined to |
tailloadShift |
Hub, OB |
N |
String |
Length: [1- 50] |
Should be one from the predefined values |
If the trailer has a tailload, then the type of freight that the tailload is composed of |
shipmentArray |
["12345", "12345"] |
N |
String Array |
Array of strings |
|
Array of shipment Ids (Preferred sorting of shipments is ascending order of loading datetime). Could be pickupId or proId |
tractorNumber |
ab1234 |
N |
String |
Length: [1- 50] |
|
Unique id of tractor |
trailerScac |
ABCD |
N |
String |
Length: [1- 50] |
|
SCAC of trailer |
PDRouteId |
ab1234 |
N |
String |
Length: [1- 50] |
|
If trailer is on a P&D route, what is the route? |
latitude |
40.66 |
N |
Number |
Number |
Minimum acceptable value: -90; Maximum acceptable value: 90 (For the continental US, this value is always negative.) |
Latitude of current location of trailer |
longitude |
-75.38 |
N |
Number |
Number |
Minimum acceptable value: -180; Maximum acceptable value: 180 (For the continental US, this value is always positive.) |
Longitude of current location of trailer |
domicile |
ATL |
N |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric |
Domicile of the trailer. |
description |
Used on Florida lanes |
N |
String |
Length: [1- 500] |
|
Additional information about the trailer. |
availabilityStatus |
Active |
N |
String |
Length: [1- 50] |
Should be one from the predefined values |
Availability status of the trailer, active or inactive. Defaults to active. |
currentStatus |
En Route |
N |
String |
Length: [1- 50] |
Should be one from the predefined values |
Status that provides the information of what the trailer is doing. Default value is taken as the active status. |
owner |
TRUE |
N |
Boolean |
True/False |
True or False only |
Does the trailer belong to the company? |
length |
48 |
N |
Integer |
Integer |
Non Negative |
Length of the trailer Default values are taken from parameters. |
weightCapacity |
10000 |
N |
Integer |
Integer |
Non Negative |
Weight capacity of the trailer. Default values are taken from parameters. |
skidCapacity |
100 |
N |
Integer |
Integer |
Non Negative |
Skid capacity of the trailer Default values are taken from parameters. |
volumeCapacity |
1000 |
N |
Integer |
Integer |
Non Negative |
Volume capacity of the trailer. Default values are taken from parameters. |
doorLocation |
15 |
N |
String |
Length: [1- 50] |
|
Identifier of the door at which trailer is parked |
yardLocation |
245 |
N |
String |
Length: [1- 50] |
|
Identifier of the yard at which trailer is parked |
lastStatusTime |
2020-12-13T 18:39:13.023Z |
N |
String |
YYYY-MMDDTHH:m m:ss.sssZ |
valid 24 hour date and time |
Last time in UTC when the status of the driver was updated |
hookedTo |
["Trailer: 1234", "Tractor: 1322"] |
N |
String Array |
Array of Key/Value Strings |
|
Array of equipment hooked to this trailer. Could be trailer, dolly, tractor. Trailer: 1234; Tractor: 1322 |
hasLiftGate |
True/False |
N |
Boolean |
Boolean |
True or False only |
Describes whether a trailer has a lift gate or not. |
technology |
GPS |
N |
String |
Length: [1- 500] |
|
object describing technology in the trailers. Cameras, GPS, Captive beam, etc |
DeleteTrailer
{
"entityId":"ab1234",
"eventType":"DeleteTrailer",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"trailerId":"ab1234"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "DeleteTrailer",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"trailerId": "ab1234"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
Length: [1-50] |
Y |
String |
ab1234 |
Event will be rejected if it is not provided. |
Unique indentifier of the trailer. |
eventType |
Length: [1-50] |
Y |
String |
DeleteTrailer |
It must be DeleteTrailer. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
Length: [1-50] |
Y |
String |
2020-01-02T13:07:49.023Z |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
Length: [1-50] |
N |
String |
docksystem |
|
The system name or code which is generating this event. |
trailerId |
Length: [1-50] |
Y |
String |
ab1234 |
Event will be rejected if it is not provided. |
Unique identifier of the trailer |
Tractor
UpdateTractor
{
"entityId":"ab1234",
"eventType":"UpdateTractor",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"changeType":"Update",
"tractorId":"ab1234",
"tractorClass":"ABC",
"domicile":"ATL",
"description":"Shared between drivers 12345 and 23857",
"availabilityStatus":"Active",
"currentStatus":"Enroute",
"currentLocation":"ATL",
"owner":"Company",
"canPullDoublePup": true,
"canPullLCV": true,
"cabType":"sleeper",
"lastStatusTime":"2020-12-13T18:39:13.023Z",
"operationalAssignment":"LineHaul",
"fuelType":"Electric"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "UpdateTractor",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"changeType": "Update",
"tractorId": "ab1234",
"tractorClass": "ABC",
"domicile": "ATL",
"description": "Shared between drivers 12345 and 23857",
"availabilityStatus": "Active",
"currentStatus": "Enroute",
"currentLocation": "ATL",
"owner": "Company",
"canPullDoublePup": true,
"canPullLCV": true,
"cabType": "sleeper",
"lastStatusTime": "2020-12-13T18:39:13.023Z",
"operationalAssignment": "LineHaul",
"fuelType": "Electric"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the tractor |
eventType |
UpdateTractor |
Y |
String |
Length: [1-50] |
It must be UpdateTractor. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
changeType |
Add, Update |
N |
String |
Length: [1-50] |
|
If the Tractor is Added or Updated. |
tractorId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique driver of tractor. |
tractorClass |
ABC |
N |
String |
Length: [1-100] |
|
Class of the tractor. Default value is taken from parameters. |
domicile |
ATL |
N |
String |
Length: [1-50] |
Should be among locations defined in the locations data |
Domicile of the tractor |
description |
Use only for ATL, Shared between drivers 12345 and 23857 |
N |
String |
Length: [1-500] |
|
Additional Information about the tractor |
availabilityStatus |
Active |
N |
String |
Length: [1-50] |
Active/Inactive |
Status that provides information of what the tractor is doing. Default is taken Active. |
currentStatus |
Enroute |
N |
String |
Length: [1-50] |
Should be one from the predefined values |
Status that provides information of what the tractor is doing. |
currentLocation |
ATL |
N |
String |
Length: [1-50] |
Should be among locations defined in the locations data |
Current location of the tractor. If at location, then provide location. If enroute, then provide the location where the tractor will be next. Default is taken as active location. |
owner |
Company |
N |
String |
Length: [1-50] |
|
Who is the owner of the tractor? |
canPullDoublePup |
false and true |
N |
Boolean |
Boolean |
|
Can 2 pups be pulled by the tractor. |
canPullLCV |
false and true |
N |
Boolean |
Boolean |
|
Can LCV be pulled by the tractor? |
cabType |
sleeper |
N |
String |
Length: [1-20] |
|
Type of cab for the tractor, ex. sleeper |
lastStatusTime |
2020-12-13T18:39:13.023Z |
N |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
|
Last time in UTC when the status of the driver was updated |
operationalAssignment |
LineHaul, P&D |
N |
String |
Length: [1-50] |
|
The primary allocation of the tractor |
fuelType |
Electric, Diesel |
N |
String |
Length: [1-50] |
|
Type of the fuel tractor is using |
DeleteTractor
{
"entityId":"ab1234",
"eventType":"DeleteTractor",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"tractorId":"ab1234"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "DeleteTractor",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"tractorId": "ab1234"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the tractor |
eventType |
DeleteTractor |
Y |
String |
Length: [1-50] |
It must be DeleteTractor. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
tractorId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique driver of tractor. |
Schedule Events
Schedule
UpdateSchedule
{
"entityId":"ATL001",
"eventType":"UpdateSchedule",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"changeType":"Add",
"scheduleId":"ATL001",
"runType":"TURN",
"domicile":"ATL",
"primaryDriverId":"AB232123",
"secondaryDriverId":"ABC232123",
"dispatchList": [
{
"dispatchOrigin":"ATL",
"dispatchDestination":"_BRK",
"dispatchType":"Travel",
"week": 1,
"dutyNumber": 2,
"dutyLegNumber": 1,
"departDow":"MON",
"plannedDepartureTime":"10:00",
"arriveDow":"MON",
"plannedArrivalTime":"15:00",
"legNumber": 1,
"meetSchedule":"ScheduleId",
"tourNumber": 1,
"tourLegNumber": 2,
"notes":"Coordinate with another driver",
"restAtDestination": true,
"transportMode":"City",
"plannedLoads": [
{
"loadId":"ABL-DLS-01-MO-1",
"equipmentType":"Pup",
"origin":"ABL",
"destination":"DLS",
"freightType":"All",
"readyDow":"MON",
"readyTime":"21:00",
"readyShift":"HUB",
"dueDow":"MON",
"dueTime":"23:50",
"dueShift":"OB",
"departureDay":"MON",
"intermediateManifestLocations":"GRL",
"plannedLoaded": true,
"notes":"Must go direct",
"loadType":"Empty",
"childLoads": [
{
"origin":"ABL",
"destination":"DLS",
"originShift":"OB",
"destinationShift":"OB",
"childLoadType":"Headload",
"sequenceNumber": 1,
"childLoadId":"ABL-DLS-Headload-01"
}
]
}
]
}
],
"tractorNumber":"ABCDE1234",
"thirdPartyReferenceId":"ABC-DEF-GGGG-1",
"ptCarrierId":"BCRA",
"extendedScheduleType":"TURN",
"drivingType":"Solo",
"counterpartSchedule":"ATL005",
"notes":"Break after 5 hours",
"lastChangeUser":"dpl_kharb",
"lastChangeTimeStamp":"2020-01-02T13:07:49.023Z",
"passThrough":"extrafield1",
"extraField1":"data1",
"extraField2":"data2"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ATL001",
"eventType": "UpdateSchedule",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"changeType": "Add",
"scheduleId": "ATL001",
"runType": "TURN",
"domicile": "ATL",
"primaryDriverId": "AB232123",
"secondaryDriverId": "ABC232123",
"dispatchList": [
{
"dispatchOrigin": "ATL",
"dispatchDestination": "_BRK",
"dispatchType": "Travel",
"week": 1,
"dutyNumber": 2,
"dutyLegNumber": 1,
"departDow": "MON",
"plannedDepartureTime": "10:00",
"arriveDow": "MON",
"plannedArrivalTime": "15:00",
"legNumber": 1,
"meetSchedule": "ScheduleId",
"tourNumber": 1,
"tourLegNumber": 2,
"notes": "Coordinate with another driver",
"restAtDestination": true,
"transportMode": "City",
"plannedLoads": [
{
"loadId": "ABL-DLS-01-MO-1",
"equipmentType": "Pup",
"origin": "ABL",
"destination": "DLS",
"freightType": "All",
"readyDow": "MON",
"readyTime": "21:00",
"readyShift": "HUB",
"dueDow": "MON",
"dueTime": "23:50",
"dueShift": "OB",
"departureDay": "MON",
"intermediateManifestLocations": "GRL",
"plannedLoaded": true,
"notes": "Must go direct",
"loadType": "Empty",
"childLoads": [
{
"origin": "ABL",
"destination": "DLS",
"originShift": "OB",
"destinationShift": "OB",
"childLoadType": "Headload",
"sequenceNumber": 1,
"childLoadId": "ABL-DLS-Headload-01"
}
]
}
]
}
],
"tractorNumber": "ABCDE1234",
"thirdPartyReferenceId": "ABC-DEF-GGGG-1",
"ptCarrierId": "BCRA",
"extendedScheduleType": "TURN",
"drivingType": "Solo",
"counterpartSchedule": "ATL005",
"notes": "Break after 5 hours",
"lastChangeUser": "dpl_kharb",
"lastChangeTimeStamp": "2020-01-02T13:07:49.023Z",
"passThrough": "extrafield1",
"extraField1": "data1",
"extraField2": "data2"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ATL001 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the schedule |
eventType |
UpdateSchedule |
Y |
String |
Length: [1-50] |
It must be UpdateSchedule. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
changeType |
Add, Update |
N |
String |
Length: [1-50] |
|
If the schedule is Added or Updated. |
scheduleId |
ATL001 |
Y |
String |
Length: [1-50] |
Should be a valid run ID. Event will be rejected if it is not provided. |
Unique identifier for schedule. |
runType |
TURN |
Y |
String |
Length: [1-50] |
Should be one from pre-defined values. Event will be rejected if it is not provided. |
Schedule Run Type. |
domicile |
ATL |
N |
String |
Length: [1-50] |
Should be a location code. Should beAlphanumeric |
The domicile of drivers eligible to be assigned to this schedule. (Which location the schedule is owned by). |
primaryDriverId |
AB232123 |
N |
String |
Length: [1-50] |
|
Unique identifier for the driver on schedule. |
secondaryDriverId |
ABC232123 |
N |
String |
Length: [1-50] |
|
Unique identifier for the driver on schedule. |
dispatchList |
An array of Dispatch objects |
Y |
Array |
|
Event will be rejected if it is not provided. |
Refer to Dispatch Properties in the section below. This is the list of scheduled dispatches. |
tractorNumber |
ABCDE1234 |
N |
String |
Length: [1-50] |
|
Field describing which tractor is assigned to this schedule. |
thirdPartyReferenceId |
ABC-DEF-GGGG-1 |
N |
String |
Length: [1-50] |
This should be either the purchaseLaneId or the railLinkId |
This is the unique identifier for rail links and PT Lanes, so that we can reference travel time, cost, and availability data in the rail and PT Lane tables. |
ptCarrierId |
BCRA |
N |
String |
Length: [1-50] |
|
PT Carrier Code. This should only be filled if the schedule is a PT or Rail schedule. It should match the carrier code in PT and Rail data. |
extendedScheduleType |
TURN |
N |
String |
Length: [1-50] |
Should be one from pre-defined values |
Schedule Standard Run Type. |
drivingType |
Solo, Team |
N |
String |
Length: [1-50] |
This field must be one from pre-defined driving types. |
Solo, Team |
counterpartSchedule |
ATL005 |
N |
String |
Length: [1-50] |
Should be a valid run ID. |
Unique identifier for schedule. |
notes |
Break after 5 hours |
N |
String |
Length: [1-50] |
|
String allowing for free text data at the schedule level. |
lastChangeUser |
dpl_kharb |
N |
String |
Length: [1-50] |
|
Username of the last person to make updates to the schedule. If the edit was made in DriverPlan then "dpl" will be the prefix before the username. |
lastChangeTimeStamp |
2020-01-02T13:07:49.023Z |
N |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
|
Timestamp for the last time the schedule has been updated in UTC |
passThrough |
comma-separated field names which are pass-through. Example extraField1, extraField2 |
N |
String |
Length: [1-50] |
|
These fields' values will be stored in Optym LTL Suite Events but not processed for any Business logic. It is returned to the customer when Published from Optym LTL Suite Events |
extraField1 |
data1 |
N |
String |
Length: [1-50] |
|
Example extra property that a client is welcome to send along with their schedule data. If you would like this data to be passed back with that scheduleID during publish, then the property name would need to be in the passThrough list for the Schedule entity. |
extraField2 |
data2 |
N |
String |
Length: [1-50] |
|
Example extra property that a client is welcome to send along with their schedule data. If you would like this data to be passed back with that scheduleID during publish, then the property name would need to be in the passThrough list for the Schedule entity.*Note: The Publish payload would have an array of level 1 Schedule objects. |
dispatchList properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
dispatchOrigin |
location Code: ATL |
Y |
String |
Length: [1-50] |
These codes should be either alphanumeric location codes OR be a special code defined.Event will be rejected if it is not provided. |
This is the location code for the origin of the dispatch. In the case where a break is defined as mid-dispatch, a _BKO code can be used to denote the driver is coming from a mid-dispatch break. |
dispatchDestination |
Special Codes: _BRK, _FLX |
Y |
String |
Length: [1-50] |
These codes should be either alphanumeric location codes OR be a special code defined.Event will be rejected if it is not provided. |
This is the location code for the destination of the dispatch. In the case where a break is being defined mid-dispatch, a _BKD code can be used to denote the driver is going to a mid-dispatch break. |
dispatchType |
Travel, Dock, Meal |
N |
String |
Length: [1-50] |
|
Dispatch type describes the type of dispatch being sent. A normal movement dispatch would be blank or say "Travel". If a dispatch says "Dock" then the dispatch is not conveying movement but conveying the length of time a driver is working the dock. In the case of "Dock" or "Meal" the origin and destination of the dispatch should be the same facility. |
week |
1,2 |
Y |
Integer |
Positive Integer |
Event will be rejected if it is not provided. |
The week of the dispatch (could be 1 or 2 only). |
dutyNumber |
1,2,3,... |
N |
Integer |
Positive Integer |
|
Number identifying which duty the dispatch is a part of. It is a sequence number from 1 to n, where n is the number of duties the driver completes in a week. |
dutyLegNumber |
1,2,3,4,... |
N |
Integer |
Positive Integer |
|
Integer identifying the sequence of legs (or dispatches) within a duty. The first dispatch of the duty will have a 1 here, and the second a 2. When the next duty starts, this number resets to 1. |
departDow |
MON |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT' |
plannedDepartureTime |
10:00 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
This is the departure time for traveling dispatches, and the start time for a dock work or break type of dispatch. |
arriveDow |
MON |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT' |
plannedArrivalTime |
15:00 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
This is the expected arrival time on the dispatch. |
legNumber |
1 |
N |
Integer |
Positive Integer |
|
This integer represents the sequence of the dispatches as they appear in a schedule across the entire week. If a driver does 10 dispatches in a week, then this number will range from 1 to 10, and will not reset. |
meetSchedule |
ScheduleId |
N |
String |
Length: [1-50] |
Should be a valid run ID. |
Meet schedule at the destination of the dispatch. This should be a valid schedule ID. The meet operation should be happening at the destination of the dispatch. |
tourNumber |
1,2,3,... |
N |
Integer |
Positive Integer |
|
Number identifying which tour the dispatch is a part of. It is a sequence number from 1 to n, where n is the number of tour the driver completes in aweek. |
tourLegNumber |
1,2,3,4,... |
N |
Integer |
Positive Integer |
|
Integer identifying the sequence of legs (or dispatches) within a tour. The first dispatch of the tour will have a 1 here, and the second a 2. When the next tour starts, this number resets to 1. |
notes |
Coordinate with another driver |
N |
String |
Length: [1-50] |
|
String field where comments or notes can be made about the dispatch. |
restAtDestination |
True/False |
N |
Boolean |
Boolean |
|
This field is true when the driver plans to take a 10+ hour rest after arriving at the dispatch destination. |
transportMode |
City, Linehaul, etc |
N |
String |
Length: [1-50] |
Should be one from pre-defined values |
If the dispatch is for city, linehaul, purchase, rail, etc |
plannedLoads |
|
N |
Array |
|
|
Array of loads/trailers that are planned to be moved on the dispatch. |
schedules properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
scheduleStatus |
Add |
N |
String |
Length: [1-50] |
|
Added/Modified or Deleted. The values are Add and Delete respectively. |
plannedLoads properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
loadId |
ABL-DLS-01-MO-1 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier for loads being carried on the schedule. Typically includes manifest origin, manifest destination, business day, load number. |
equipmentType |
Pup or Van or Rail Container |
N |
String |
Length: [1-50] |
|
This describes the type of equipment that the load is using. It should match one of the client equipment types shared by the customer |
origin |
ABL |
Y |
String |
Length: [1-50] |
This should be a location code. Should be Alphanumeric. Event will be rejected if it is not provided. |
Location code where the load is built. (Where the trailer was loaded). |
destination |
DLS |
Y |
String |
Length: [1-50] |
This should be a location code. Should be Alphanumeric. Event will be rejected if it is not provided. |
Location code where the load is stripped or unloaded. (Where the trailer will be opened). |
freightType |
All, Break, Proper, NextDay, MultiDay, Empty |
N |
String |
Length: [1-50] |
This field must be one from pre-defined type. |
Description of the type of freight to be carried on the manifest. The default value is "All". If this is a known scheduled empty you can put the value "Empty" |
readyDow |
MON |
N |
String |
Length: [1-50] |
|
SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT' |
readyTime |
21:00 |
N |
String |
Length: [1-50] |
|
Time that the trailer is ready to depart or is closed. |
readyShift |
OB, AM, HUB |
N |
String |
Length: [1-50] |
This field must be one from pre-defined type. |
Handling shift or cycle in which the trailer will be ready to depart or be closed. |
dueDow |
MON |
N |
String |
Length: [1-50] |
|
SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT' |
dueTime |
23:50 |
N |
String |
Length: [1-50] |
|
Time of the day that the trailer will be due to arrive at manifest destination. For example, if you want proper freight to arrive by 8 AM at destination and we are describing a trailer carrying proper freight, the due time would be 8 AM. |
dueShift |
OB, AM, HUB |
N |
String |
Length: [1-50] |
This field must be one from pre-defined type. |
Handling shift or cycle in which the trailer will be due to arrive at manifest destination. Values are pre-defined |
departureDay |
MON |
N |
String |
Length: [1-50] |
|
Specifies the expected departure day for the load. |
intermediateManifestLocations |
GRL, DFW |
N |
String |
Length: [1-50] |
|
This would be used for kick/pick locations. Always filled if trailer is undergoing kick/pick regardless of dispatch. It can be a list of location codes. |
plannedLoaded |
True/False |
N |
Boolean |
Boolean |
|
This field describes if a trailer is loaded (true) or empty (false) by plan. |
notes |
Must go direct |
N |
String |
Length: [1-50] |
|
Free text field to store additional notes about a trailer or load. |
loadType |
Empty |
N |
String |
Length: [1-50] |
Loaded, Empty or Bobtail |
Whether it is Loaded, Empty or Bobtail. |
childLoads |
|
N |
Array |
|
|
Array of child loads that are apart of the planned loads for the schedule. Can contain partials including headloads and kick and picks. |
childLoads properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
origin |
ABL |
Y |
String |
Length: [1-50] |
|
Location Code where the child load is built. (Where the trailer was loaded) |
destination |
DLS |
Y |
String |
Length: [1-50] |
|
Location Code where the child load is stripped or unloaded. (Where the trailer will be opened) |
originShift |
OB, AM, HUB |
N |
String |
Length: [1-50] |
Should be one from pre-defined values |
Handling shift or cycle in which the trailer is departing from origin. |
destinationShift |
OB, AM, HUB |
N |
String |
Length: [1-50] |
Should be one from pre-defined values |
Handling shift or cycle in which the trailer is handled at destination. |
childLoadType |
Kick, Pick, Kick and Pick, Headload |
Y |
String |
Length: [1-50] |
|
Designates the type of child load being built. This could be a Kick and Pick, |
sequenceNumber |
1,2,3 |
Y |
Integer |
Range: [1-Max] |
Must be a positive integer. |
Sequence of child loads in the network that share Origin, Destination, and Type. |
childLoadId |
ABL-DLS-Headload-01 |
N |
String |
Length: [1-50] |
|
Unique identifier for the child load that consists of Origin, Destination, Type, and Sequence Number. |
DeleteSchedule
{
"entityId":"ATL001",
"eventType":"DeleteSchedule",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"scheduleId":"ATL001"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ATL001",
"eventType": "DeleteSchedule",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"scheduleId": "ATL001"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ATL001 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the schedule |
eventType |
DeleteSchedule |
Y |
String |
Length: [1-50] |
It must be DeleteSchedule. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
scheduleId |
ATL001 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier for schedule |
PublishSchedule
{
"requestId":"123e4567-e89b-12d3-a456-426614174000",
"emailId":"AuthorizedEmailId@domain.com",
"currBatchNumber": 2,
"totalNumberOfBatches": 4,
"schedules": [
{
"scheduleId":"ATL001",
"runType":"Turn",
"domicile":"ATL",
"primaryDriverId":"AB232123",
"secondaryDriverId":"ABC232123",
"tractorNumber":"ABCDE1234",
"thirdPartyReferenceId":"ABCDEFGGGG1",
"ptCarrierId":"BCRA",
"extendedScheduleType":"TURN",
"drivingType":"Solo",
"counterpartSchedule":"ATL001",
"notes":"Break after 5 hours",
"scheduleStatus":"Add",
"lastChangeUser":"dpl_kharb",
"lastChangeTimestamp":"2020-01-02T13:07:49.023Z",
"passThrough":"extrafield1",
"extraField1":"data1",
"extraField2":"data2",
"dispatchList": [
{
"week": 1,
"dutyNumber": 2,
"dutyLegNumber": 1,
"departDow":"MON",
"plannedDepartureTime":"10:00",
"arriveDow":"MON",
"plannedArrivalTime":"15:00",
"legNumber": 1,
"dispatchOrigin":"ATL",
"dispatchDestination":"_BRK",
"type":"Travel",
"restAtDestination": true,
"tourNumber": 1,
"tourLegNumber": 2,
"plannedLoads": [
{
"loadId":"ABL-DLS-01-MO-1",
"departureDay":"MON",
"equipmentType":"Pup",
"origin":"ABL",
"destination":"DLS",
"freightType":"All",
"readyDow":"MON",
"readyTime":"21:00",
"readyShift":"HUB",
"dueDow":"MON",
"dueTime":"23:50",
"dueShift":"OB",
"plannedLoaded": true,
"intermediateManifestLocations":"GRL",
"childLoads": [
{
"origin":"ABL",
"destination":"DLS",
"originShift":"OB",
"destinationShift":"OB",
"childLoadType":"Headload",
"sequenceNumber": 1,
"childLoadId":"ABL-DLS-Headload-01"
}
]
}
],
"meetSchedule":"ScheduleId",
"notes":"Coordinate with another driver"
}
]
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"requestId": "123e4567-e89b-12d3-a456-426614174000",
"emailId": "AuthorizedEmailId@domain.com",
"currBatchNumber": 2,
"totalNumberOfBatches": 4,
"schedules": [
{
"scheduleId": "ATL001",
"runType": "Turn",
"domicile": "ATL",
"primaryDriverId": "AB232123",
"secondaryDriverId": "ABC232123",
"tractorNumber": "ABCDE1234",
"thirdPartyReferenceId": "ABCDEFGGGG1",
"ptCarrierId": "BCRA",
"extendedScheduleType": "TURN",
"drivingType": "Solo",
"counterpartSchedule": "ATL001",
"notes": "Break after 5 hours",
"scheduleStatus": "Add",
"lastChangeUser": "dpl_kharb",
"lastChangeTimestamp": "2020-01-02T13:07:49.023Z",
"passThrough": "extrafield1",
"extraField1": "data1",
"extraField2": "data2",
"dispatchList": [
{
"week": 1,
"dutyNumber": 2,
"dutyLegNumber": 1,
"departDow": "MON",
"plannedDepartureTime": "10:00",
"arriveDow": "MON",
"plannedArrivalTime": "15:00",
"legNumber": 1,
"dispatchOrigin": "ATL",
"dispatchDestination": "_BRK",
"type": "Travel",
"restAtDestination": true,
"tourNumber": 1,
"tourLegNumber": 2,
"plannedLoads": [
{
"loadId": "ABL-DLS-01-MO-1",
"departureDay": "MON",
"equipmentType": "Pup",
"origin": "ABL",
"destination": "DLS",
"freightType": "All",
"readyDow": "MON",
"readyTime": "21:00",
"readyShift": "HUB",
"dueDow": "MON",
"dueTime": "23:50",
"dueShift": "OB",
"plannedLoaded": true,
"intermediateManifestLocations": "GRL",
"childLoads": [
{
"origin": "ABL",
"destination": "DLS",
"originShift": "OB",
"destinationShift": "OB",
"childLoadType": "Headload",
"sequenceNumber": 1,
"childLoadId": "ABL-DLS-Headload-01"
}
]
}
],
"meetSchedule": "ScheduleId",
"notes": "Coordinate with another driver"
}
]
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Data Type |
Data Format |
Validation |
Description |
requestId |
123e4567-e89b-12d3-a456-426614174000 |
string (UUID) |
Length: [1-50] |
|
Request correlation ID |
emailId |
AuthorizedEmailId@domain.com |
string |
Length: [1-50] |
Must be authorized email to Publish. |
Authorized email ID to post schedules. |
currBatchNumber |
2 |
Integer |
Positive Integer |
Between 1 and totalNumberOfBatches (Both inclusive) |
Current Batch number of total number of batches |
totalNumberOfBatches |
4 |
Integer |
Positive Integer |
Must be greater than or equal to currBatchNumber |
Total number of batches the Publish records have been divided into. |
schedules |
|
Array |
Array of Schedule Objects |
|
Refer to Schedule Properties defined in UpdateSchedule |
schedules properties
FieldName |
Values |
Data Type |
Data Format |
Validation |
Description |
scheduleId |
ATL001 |
String |
Length: [1-50] |
Should be a valid run ID. Event will be rejected if it is not provided. |
Unique identifier for schedule. |
runType |
Turn |
String |
String |
Should be one from pre-defined values. Event will be rejected if it is not provided. |
Schedule Run Type. |
domicile |
ATL |
String |
Length: [1-50] |
Should be a location code. Should beAlphanumeric |
The domicile of drivers eligible to be assigned to this schedule. (Which location the schedule is owned by). |
primaryDriverId |
232123 |
String |
Length: [1-50] |
|
Unique identifier for the driver on schedule. |
secondaryDriverId |
232123 |
String |
Length: [1-50] |
|
Unique identifier for the driver on schedule. |
tractorNumber |
ABCDE1234 |
String |
Length: [1-50] |
|
Field describing which tractor is assigned to this schedule. |
thirdPartyReferenceId |
ABCDEFGGGG1 |
String |
Length: [1-50] |
This should be either the purchaseLaneId or the railLinkId |
This is the unique identifier for rail links and PT Lanes, so that we can reference travel time, cost, and availability data in the rail and PT Lane tables. |
ptCarrierId |
BCRA |
String |
Length: [1-50] |
|
PT Carrier Code. This should only be filled if the schedule is a PT or Rail schedule. It should match the carrier code in PT and Rail data. |
extendedScheduleType |
1 |
String |
Length: [1-50] |
Should be one from pre-defined values |
Schedule Standard Run Type. |
drivingType |
Solo |
String |
Length: [1-50] |
This field must be one from pre-defined driving types. |
Describes whether this a Solo or Team driver. |
counterpartSchedule |
ATL001 |
String |
Length: [1-50] |
Should be a valid run ID. |
Unique identifier for schedule. |
notes |
This schedule is awesome. |
String |
Length: [1-50] |
|
String allowing for free text data at the schedule level. |
scheduleStatus |
Add |
String |
Length: [1-50] |
|
Added/Modified or Deleted. The values are Add and Delete respectively. |
lastChangeUser |
dpl_kharb |
String |
Length: [1-50] |
|
Username of the last person to make updates to the schedule. If the edit was made in DriverPlan then "dpl" will be the prefix before the username. |
lastChangeTimestamp |
2020-01-02T13:07:49.023Z |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
|
Timestamp for the last time the schedule has been updated in UTC |
passThrough |
extraField1, extraField2 |
String |
Length: [1-50] |
|
These fields' values will be stored in Optym LTL Suite Events but not processed for any Business logic. It is returned to the customer when Published from Optym LTL Suite Events |
extraField1 |
data1 |
String |
Length: [1-50] |
|
Example extra property that a client is welcome to send along with their schedule data. If you would like this data to be passed back with that scheduleID during publish, then the property name would need to be in the passThrough list for the Schedule entity. |
extraField2 |
data2 |
String |
Length: [1-50] |
|
Example extra property that a client is welcome to send along with their schedule data. If you would like this data to be passed back with that scheduleID during publish, then the property name would need to be in the passThrough list for the Schedule entity.*Note: The Publish payload would have an array of level 1 Schedule objects. |
dispatchList |
An array of Dispatch objects |
Array |
0 |
Event will be rejected if it is not provided. |
Refer to Dispatch Properties in the section below. This is the list of scheduled dispatches. |
dispatchList properties
FieldName |
Values |
Data Type |
Data Format |
Validation |
Description |
week |
1,2 |
Integer |
Positive Integer |
Event will be rejected if it is not provided. |
The week of the dispatch (could be 1 or 2 only). |
dutyNumber |
1,2,3,... |
Integer |
Positive Integer |
|
Number identifying which duty the dispatch is a part of. It is a sequence number from 1 to n, where n is the number of duties the driver completes in a week. |
dutyLegNumber |
1,2,3,4,... |
Integer |
Positive Integer |
|
Integer identifying the sequence of legs (or dispatches) within a duty. The first dispatch of the duty will have a 1 here, and the second a 2. When the next duty starts, this number resets to 1. |
departDow |
MON |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT' |
plannedDepartureTime |
10:00 |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
This is the departure time for traveling dispatches, and the start time for a dock work or break type of dispatch. |
arriveDow |
MON |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT' |
plannedArrivalTime |
15:00 |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
This is the expected arrival time on the dispatch. |
legNumber |
1 |
Integer |
Positive Integer |
|
This integer represents the sequence of the dispatches as they appear in a schedule across the entire week. If a driver does 10 dispatches in a week, then this number will range from 1 to 10, and will not reset. |
dispatchOrigin |
location Code: ATL |
String |
Length: [1-50] |
These codes should be either alphanumeric location codes OR be a special code defined.Event will be rejected if it is not provided. |
This is the location code for the origin of the dispatch. In the case where a break is defined as mid-dispatch, a _BKO code can be used to denote the driver is coming from a mid-dispatch break. |
dispatchDestination |
Special Codes: _BRK, _FLX |
String |
Length: [1-50] |
These codes should be either alphanumeric location codes OR be a special code defined.Event will be rejected if it is not provided. |
This is the location code for the destination of the dispatch. In the case where a break is being defined mid-dispatch, a _BKD code can be used to denote the driver is going to a mid-dispatch break. |
type |
Travel, Dock, Meal |
String |
Length: [1-50] |
|
Dispatch type describes the type of dispatch being sent. A normal movement dispatch would be blank or say "Travel". If a dispatch says "Dock" then the dispatch is not conveying movement but conveying the length of time a driver is working the dock. In the case of "Dock" or "Meal" the origin and destination of the dispatch should be the same facility. |
restAtDestination |
True/False |
Boolean |
Boolean |
|
This field is true when the driver plans to take a 10+ hour rest after arriving at the dispatch destination. |
tourNumber |
1,2,3,... |
Integer |
Positive Integer |
|
Number identifying which tour the dispatch is a part of. It is a sequence number from 1 to n, where n is the number of tour the driver completes in aweek. |
tourLegNumber |
1,2,3,4,... |
Integer |
Positive Integer |
|
Integer identifying the sequence of legs (or dispatches) within a tour. The first dispatch of the tour will have a 1 here, and the second a 2. When the next tour starts, this number resets to 1. |
plannedLoads |
|
Array |
Array |
|
Array of loads/trailers that are planned to be moved on the dispatch. |
meetSchedule |
ScheduleId |
String |
Length: [1-50] |
Should be a valid run ID. |
Meet schedule at the destination of the dispatch. This should be a valid schedule ID. The meet operation should be happening at the destination of the dispatch. |
notes |
Coordinate with another driver |
String |
Length: [1-50] |
|
String field where comments or notes can be made about the dispatch. |
plannedLoads properties
FieldName |
Values |
Data Type |
Data Format |
Validation |
Description |
loadId |
ABL-ATL-01-M-1 |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier for loads being carried on the schedule. Typically includes manifest origin, manifest destination, business day, load number. |
departureDay |
MON |
String |
Length: [1-50] |
|
Specifies the expected departure day for the load. |
equipmentType |
Pup |
String |
Length: [1-50] |
|
This describes the type of equipment that the load is using. It should match one of the client equipment types shared by the customer |
origin |
ABL |
String |
Length: [1-50] |
This should be a location code. Should be Alphanumeric. Event will be rejected if it is not provided. |
Location code where the load is built. (Where the trailer was loaded). |
destination |
DLS |
String |
Length: [1-50] |
This should be a location code. Should be Alphanumeric. Event will be rejected if it is not provided. |
Location code where the load is stripped or unloaded. (Where the trailer will be opened). |
freightType |
Break |
String |
Length: [1-50] |
This field must be one from pre-defined type. |
Description of the type of freight to be carried on the manifest. The default value is "All". If this is a known scheduled empty you can put the value "Empty" |
readyDow |
MON |
String |
Length: [1-50] |
|
SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT' |
readyTime |
21:00 |
String |
Length: [1-50] |
|
Time that the trailer is ready to depart or is closed. |
readyShift |
OB |
String |
Length: [1-50] |
This field must be one from pre-defined type. |
Handling shift or cycle in which the trailer will be ready to depart or be closed. |
dueDow |
MON |
String |
Length: [1-50] |
|
SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT' |
dueTime |
23:50 |
String |
Length: [1-50] |
|
Time of the day that the trailer will be due to arrive at manifest destination. For example, if you want proper freight to arrive by 8 AM at destination and we are describing a trailer carrying proper freight, the due time would be 8 AM. |
dueShift |
OB |
String |
Length: [1-50] |
This field must be one from pre-defined type. |
Handling shift or cycle in which the trailer will be due to arrive at manifest destination. Values are pre-defined |
plannedLoaded |
TRUE |
Boolean |
Boolean |
|
This field describes if a trailer is loaded (true) or empty (false) by plan. |
intermediateManifestLocations |
GRL |
String |
Length: [1-50] |
|
This would be used for kick/pick locations. Always filled if trailer is undergoing kick/pick regardless of dispatch. It can be a list of location codes. |
childLoads |
|
Array |
|
|
Array of child loads that are apart of the planned loads for the schedule. Can contain partials including headloads and kick and picks. |
childLoads properties
FieldName |
Values |
Data Type |
Data Format |
Validation |
Description |
origin |
ABL |
String |
Length: [1-50] |
|
Location Code where the child load is built. (Where the trailer was loaded) |
destination |
DLS |
String |
Length: [1-50] |
|
Location Code where the child load is stripped or unloaded. (Where the trailer will be opened) |
originShift |
OB, AM, HUB |
String |
Length: [1-50] |
Should be one from pre-defined values |
Handling shift or cycle in which the trailer is departing from origin. |
destinationShift |
OB, AM, HUB |
String |
Length: [1-50] |
Should be one from pre-defined values |
Handling shift or cycle in which the trailer is handled at destination. |
childLoadType |
Kick, Pick, Kick and Pick, Headload |
String |
Length: [1-50] |
|
Designates the type of child load being built. This could be a Kick and Pick, |
sequenceNumber |
1, 2, 3 |
Integer |
Range: [1-Max] |
Must be a positive integer. |
Sequence of child loads in the network that share Origin, Destination, and Type. |
childLoadId |
ABL-DLS-Headload-01 |
String |
Length: [1-50] |
|
Unique identifier for the child load that consists of Origin, Destination, Type, and Sequence Number. |
Live Events
Shipment
UpdateShipment
{
"entityId":"P123456789",
"eventType":"UpdateShipment",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"proId":"P123456789",
"EDIProId":"555%123456789",
"EDIFlag": true,
"pickupId":"ab1234",
"subPickupId":"ab1234",
"origin":"ATL",
"destination":"DLS",
"shipper": {
"geoArea":"SW",
"code":"ab1234",
"name":"name",
"address1":"123 Main",
"address2":"ab, 1234",
"city":"Bethlehem",
"state":"TX",
"zip":"12345",
"country":"USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass":"abc",
"contactName":"Shipper 123",
"contactPhone":"123-456-7890",
"customerOpenHours":"10:00",
"customerCloseHours":"17:00"
},
"consignee": {
"geoArea":"SW",
"code":"ab1234",
"name":"name",
"address1":"123 Main",
"address2":"ab, 1234",
"city":"Bethlehem",
"state":"TX",
"zip":"12345",
"country":"USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass":"abc",
"contactName":"Shipper 123",
"contactPhone":"123-456-7890",
"customerOpenHours":"10:00",
"customerCloseHours":"17:00"
},
"thirdPartyCustomer": {
"geoArea":"SW",
"code":"ab1234",
"name":"name",
"address1":"123 Main",
"address2":"ab, 1234",
"city":"Bethlehem",
"state":"TX",
"zip":"12345",
"country":"USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass":"abc",
"contactName":"Shipper 123",
"contactPhone":"123-456-7890",
"customerOpenHours":"10:00",
"customerCloseHours":"17:00"
},
"serviceType":"Priority",
"serviceLevel": [
"Solutions",
"XA"
],
"cityPickupActualDate":"2018-10-16",
"cityPickupActualTime":"22:15",
"cityDueDate":"2018-10-16",
"deliveryDueStartTime":"22:15",
"deliveryDueEndTime":"22:15",
"cityDeliveryActualDate":"2018-10-16",
"cityDeliveryActualTime":"22:15",
"isAppointment": true,
"appointmentDueDate":"2024-04-01",
"appointmentDueTime":"22:15",
"freightClass": [
"50",
"55",
"400"
],
"OSDCode":"abc1231",
"packagingType":"3.2",
"isHazmat": true,
"isFreezable": true,
"isFood": true,
"isResidential": true,
"isLimited": true,
"isPoison": true,
"isStackable": true,
"isDimensioned": true,
"isReWeighed": true,
"isLong": true,
"status":"Picked Up",
"currentLocation":"ABC",
"extendedCurrentLocation":"Dock",
"weight": 40,
"volume": 50,
"handlingUnitCount": 60,
"skidCount": 70,
"pieceCount": 1200,
"totalLength": 100,
"totalWidth": 200,
"totalHeight": 20,
"palletSpaceEquivalent": 12.0,
"revenue": 1800.0,
"isLiftgateRequired": true,
"BOLImageLink":"www.carrierphotostorage.com/12345",
"cashOnDeliveryAmount": 100.0,
"freightAmount": 100.0,
"isCompanyCheck": true,
"isCashRequired": true,
"returnCode":"DC",
"upstreamInterlineCarrierId":"ab1234",
"downstreamInterlineCarrierId":"ab1234",
"specialInstructions":"do a specific thing with this shipment",
"PONumber": [
"NS"
],
"isInsideDelivery": true,
"requireSortingOnDelivery": true,
"shipperBOLNumber":"7739068",
"shipperOrderNumber":"197166",
"billingTerms":"PPD",
"isUnattendedDelivery": true,
"hazmatInfo": [
{
"unNumber":"1234",
"hazmatClass":"Class 1",
"hazmatPackagingType":"3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone":"123-456-7890"
}
],
"handlingUnits": [
{
"freightClass": [
"50",
"55",
"400"
],
"OSDCode":"abc1231",
"packagingType":"3.2",
"isHazmat": true,
"isFreezable": true,
"isFood": true,
"isResidential": true,
"isLimited": true,
"isPoison": true,
"isLong": true,
"palletSpaceEquivalent": 12.0,
"isStackable": true,
"isDimensioned": true,
"isReWeighed": true,
"pictureLink":"www.carrierphotostorage.com/12345",
"status":"Picked Up",
"currentLocation":"ABC",
"extendedCurrentLocation":"Dock",
"extendedCurrentLocationValue":"Dock Number 16",
"nextLocation":"DEF",
"lastStatusTime":"2020-12-13T18:39:13.023Z",
"handlingUnitId":"ab1234",
"handlingUnitLength": 40,
"handlingUnitWidth": 50,
"handlingUnitHeight": 60,
"handlingUnitPieces": 100,
"handlingUnitWeight": 10000,
"handlingUnitPackageCode":"SW",
"handlingUnitDescription":"Do not mix with food",
"hazmatInfo": [
{
"unNumber":"1234",
"hazmatClass":"Class 1",
"hazmatPackagingType":"3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone":"123-456-7890"
}
]
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "P123456789",
"eventType": "UpdateShipment",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"proId": "P123456789",
"EDIProId": "555%123456789",
"EDIFlag": true,
"pickupId": "ab1234",
"subPickupId": "ab1234",
"origin": "ATL",
"destination": "DLS",
"shipper": {
"geoArea": "SW",
"code": "ab1234",
"name": "name",
"address1": "123 Main",
"address2": "ab, 1234",
"city": "Bethlehem",
"state": "TX",
"zip": "12345",
"country": "USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass": "abc",
"contactName": "Shipper 123",
"contactPhone": "123-456-7890",
"customerOpenHours": "10:00",
"customerCloseHours": "17:00"
},
"consignee": {
"geoArea": "SW",
"code": "ab1234",
"name": "name",
"address1": "123 Main",
"address2": "ab, 1234",
"city": "Bethlehem",
"state": "TX",
"zip": "12345",
"country": "USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass": "abc",
"contactName": "Shipper 123",
"contactPhone": "123-456-7890",
"customerOpenHours": "10:00",
"customerCloseHours": "17:00"
},
"thirdPartyCustomer": {
"geoArea": "SW",
"code": "ab1234",
"name": "name",
"address1": "123 Main",
"address2": "ab, 1234",
"city": "Bethlehem",
"state": "TX",
"zip": "12345",
"country": "USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass": "abc",
"contactName": "Shipper 123",
"contactPhone": "123-456-7890",
"customerOpenHours": "10:00",
"customerCloseHours": "17:00"
},
"serviceType": "Priority",
"serviceLevel": [
"Solutions",
"XA"
],
"cityPickupActualDate": "2018-10-16",
"cityPickupActualTime": "22:15",
"cityDueDate": "2018-10-16",
"deliveryDueStartTime": "22:15",
"deliveryDueEndTime": "22:15",
"cityDeliveryActualDate": "2018-10-16",
"cityDeliveryActualTime": "22:15",
"isAppointment": true,
"appointmentDueDate": "2024-04-01",
"appointmentDueTime": "22:15",
"freightClass": [
"50",
"55",
"400"
],
"OSDCode": "abc1231",
"packagingType": "3.2",
"isHazmat": true,
"isFreezable": true,
"isFood": true,
"isResidential": true,
"isLimited": true,
"isPoison": true,
"isStackable": true,
"isDimensioned": true,
"isReWeighed": true,
"isLong": true,
"status": "Picked Up",
"currentLocation": "ABC",
"extendedCurrentLocation": "Dock",
"weight": 40,
"volume": 50,
"handlingUnitCount": 60,
"skidCount": 70,
"pieceCount": 1200,
"totalLength": 100,
"totalWidth": 200,
"totalHeight": 20,
"palletSpaceEquivalent": 12.0,
"revenue": 1800.0,
"isLiftgateRequired": true,
"BOLImageLink": "www.carrierphotostorage.com/12345",
"cashOnDeliveryAmount": 100.0,
"freightAmount": 100.0,
"isCompanyCheck": true,
"isCashRequired": true,
"returnCode": "DC",
"upstreamInterlineCarrierId": "ab1234",
"downstreamInterlineCarrierId": "ab1234",
"specialInstructions": "do a specific thing with this shipment",
"PONumber": [
"NS"
],
"isInsideDelivery": true,
"requireSortingOnDelivery": true,
"shipperBOLNumber": "7739068",
"shipperOrderNumber": "197166",
"billingTerms": "PPD",
"isUnattendedDelivery": true,
"hazmatInfo": [
{
"unNumber": "1234",
"hazmatClass": "Class 1",
"hazmatPackagingType": "3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone": "123-456-7890"
}
],
"handlingUnits": [
{
"freightClass": [
"50",
"55",
"400"
],
"OSDCode": "abc1231",
"packagingType": "3.2",
"isHazmat": true,
"isFreezable": true,
"isFood": true,
"isResidential": true,
"isLimited": true,
"isPoison": true,
"isLong": true,
"palletSpaceEquivalent": 12.0,
"isStackable": true,
"isDimensioned": true,
"isReWeighed": true,
"pictureLink": "www.carrierphotostorage.com/12345",
"status": "Picked Up",
"currentLocation": "ABC",
"extendedCurrentLocation": "Dock",
"extendedCurrentLocationValue": "Dock Number 16",
"nextLocation": "DEF",
"lastStatusTime": "2020-12-13T18:39:13.023Z",
"handlingUnitId": "ab1234",
"handlingUnitLength": 40,
"handlingUnitWidth": 50,
"handlingUnitHeight": 60,
"handlingUnitPieces": 100,
"handlingUnitWeight": 10000,
"handlingUnitPackageCode": "SW",
"handlingUnitDescription": "Do not mix with food",
"hazmatInfo": [
{
"unNumber": "1234",
"hazmatClass": "Class 1",
"hazmatPackagingType": "3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone": "123-456-7890"
}
]
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
P123456789 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique indentifier of the shipment |
eventType |
UpdateShipment |
Y |
String |
Length: [1-50] |
It must be UpdateShipment. Event will be rejected if it is not provided |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
proId |
P123456789 |
N |
String |
Length: [1- 50] |
|
Unique identifier of a billed shipment. |
EDIProId |
555%123456789 |
N |
String |
Length: [1- 50] |
|
Unique identifier of a temporary pro used when the shipper requests pickup. |
EDIFlag |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Helps identify if a Pro is an EDI pro or just a normal Pro. |
pickupId |
ab1234 |
N |
String |
Length: [1- 50] |
|
Pickup Id associated with the scheduled shipment. |
subPickupId |
ab1234 |
N |
String |
Length: [1- 50] |
|
To distinguish between different shipments of the same pickup. |
origin |
ATL |
Y |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric. Event will be rejected if it is not provided |
Service Origin of the shipment (Terminal/location code) |
destination |
DLS |
Y |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric. Event will be rejected if it is not provided |
Service Destination of the shipment (Terminal/location Code) |
shipper |
|
N |
Object |
|
|
Customer information like name, code, address, etc. for shipper as in Customer structure at the bottom (Can be received separated as multiple fields as well) |
consignee |
|
N |
Object |
|
|
Customer information like name, code, address, etc. for consignee as in Customer structure at the bottom (Can be received separated as multiple fields as well) |
thirdPartyCustomer |
|
N |
Object |
|
|
Customer information like name, code, address, etc. for thirdPartyCustomer as in Customer structure at the bottom (Can be received separated as multiple fields as well) |
serviceType |
Priority |
N |
String |
Length: [1- 50] |
Predefined: Priority/Economy/Standard |
Decide what kind of service is defined on the shipment. Default values can be taken from parameters |
serviceLevel |
["Solutions", "XA"] |
N |
String Array |
String Array |
Predefined |
This indicates what quality and speed of service the customer is paying for. They can purchase guaranteed service, or regular service. |
cityPickupActualDate |
2018-10-16 |
N |
Date |
YYYY-MM-DD |
|
Pickup made Date of the shipment. (LiveHaul currently has combined Scheduled and actual) (We can receive separate fields if there is a duration) |
cityPickupActualTime |
22:15 |
N |
String |
hh:mm |
valid 24 hour time |
Local time at which the shipment is picked up. (LiveHaul currently has combined Scheduled and actual) (We can receive separate fields if there is a duration) |
cityDueDate |
2018-10-16 |
N |
Date |
YYYY-MM-DD |
|
Due date of the shipment. |
deliveryDueStartTime |
22:15 |
N |
String |
hh:mm |
valid 24 hour time |
Local time at which the shipment's due time begins, if there is appt timing, we expect the appointment timing to be populated here. |
deliveryDueEndTime |
22:15 |
N |
String |
hh:mm |
valid 24 hour time |
Local time at which the shipment's due time ends, if there is appt timing, we expect the appointment timing to be populated here. |
cityDeliveryActualDate |
2018-10-16 |
N |
Date |
YYYY-MM-DD |
|
The actual delivery date of the shipment. |
cityDeliveryActualTime |
22:15 |
N |
String |
hh:mm |
valid 24 hour time |
The actual delivery time of the shipment. |
isAppointment |
True and False |
N |
Boolean |
Boolean |
|
If the shipment is appointment. Defaults to false. |
appointmentDueDate |
2024-04-01 |
N |
Date |
YYYY-MM-DD |
|
If shipment is a delivery appointment, then provide the appointment due date. |
appointmentDueTime |
22:15 |
N |
String |
hh:mm |
valid 24 hour time |
If shipment is a delivery appointment, then provide the appointment due time. |
freightClass |
["50" ,"55", "400"] |
N |
String Array |
String Array |
|
NMFC class of this line item |
OSDCode |
abc1231 |
N |
String |
Length: [1- 50] |
|
Code for Overage, Shortage and Damaged shipment. |
packagingType |
3.2 |
N |
String |
Length: [1- 50] |
|
Code for the packing type of the shipment. |
isHazmat |
True and False |
N |
Boolean |
Boolean |
|
Decide whether the shipment contains hazardous material. |
isFreezable |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains freezable material. Defaults to false. |
isFood |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains food material. Defaults to false. |
isResidential |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains any residential material. Defaults to false. |
isLimited |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment has any limited material. Defaults to false. |
isPoison |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains poisonous material. Defaults to false. |
isStackable |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is stackable or not. Defaults to false. |
isDimensioned |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is dimensioned for volume or not |
isReWeighed |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is reweighed at the location or not. |
isLong |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipments length is exceeding the acceptable limit or not. |
status |
Picked Up, Loaded, Delivered |
N |
String |
Length: [1- 50] |
Should be one from pre-defined values. |
Status of the shipment. For example: Picked Up -> Loaded -> Delivered |
currentLocation |
ABC |
N |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric |
Location at which the shipment is currently present. |
extendedCurrentLocation |
Dock |
N |
String |
Length: [1- 50] |
|
Whether the shipment is in dock, yard, city and if there is any specific name to it. |
weight |
40 |
Y |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Weight of the shipment in pounds. |
volume |
50 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. Event will be rejected if it is not provided |
Volume of the shipment in Cube feet. |
handlingUnitCount |
60 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Count of handling units in the shipment |
skidCount |
70 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Count of skid item in the shipment. |
pieceCount |
1200 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Count of pieces in the shipment. |
totalLength |
100 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Length of the shipment, in inches |
totalWidth |
200 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Width of the shipment, in inches |
totalHeight |
20 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Height of the shipment, in inches |
palletSpaceEquivalent |
12 |
N |
Number |
Range: [0-Max] |
Non Negative Integer. |
Pallet equivalent of the shipment. |
revenue |
1800 |
N |
Number |
Number |
Non Negative Integer. |
Revenue associated with the shipment |
isLiftgateRequired |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment requires a liftgate or not. |
BOLImageLink |
www.carrierphotostorage.com/12345 |
N |
String |
Length: [1- 500] |
|
Provides the link where shipment's Bill of Lading can be seen. |
cashOnDeliveryAmount |
100 |
N |
Number |
Range: [0-Max] |
Non Negative |
If COD, what is the COD amount? |
freightAmount |
100 |
N |
Number |
Range: [0-Max] |
Non Negative |
If the driver must collect freight charges, what is the amount? |
isCompanyCheck |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
If the driver must collect money, is a company check OK for payment? |
isCashRequired |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
If the driver must collect money, must the funds be cash or cash equivalent (certified or cashier's check)? |
returnCode |
DC, RCN |
N |
String |
Length: [1- 50] |
|
If shipment was previously out for delivery, what was the most recent return code? |
upstreamInterlineCarrierId |
ab1234 |
N |
String |
Length: [1- 50] |
|
SCAC code of upstream interline carrier who will receive the shipment (Advance Interline Carrier) |
downstreamInterlineCarrierId |
ab1234 |
N |
String |
Length: [1- 50] |
|
SCAC code of downstream interline carrier who will receive the shipment (Advance Interline Carrier) |
specialInstructions |
do a specific thing with this shipment |
N |
String |
Length: [1-Max] |
|
Freeform text special instructions for the shipment, if any |
PONumber |
["NS"] |
N |
String Array |
String Array |
|
String containing all the P.O. numbers associated with the shipment |
isInsideDelivery |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Does the shipment need to be brought inside a building--anything beyond the loading dock area. Examples would be down hallways or up elevators. |
requireSortingOnDelivery |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Does the consignee require the driver to remove the items from one pallet and sort them onto other pallets. |
shipperBOLNumber |
7739068 |
N |
String |
Length: [1-Max] |
|
Bill of lading document number used by the shipper (typically issued by their Shipping department). |
shipperOrderNumber |
197166 |
N |
String |
Length: [1-Max] |
|
Order number used by the shipper (typically issued by their Sales department). |
billingTerms |
PPD |
N |
String |
Length: [1-Max] |
|
Payment terms of shipment, with PPD and COL being the typical values. |
isUnattendedDelivery |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Can driver leave the shipment at a private residence without getting a signature? |
hazmatInfo |
|
N |
Array |
|
|
Contains info on the hazmat that composes the shipment |
handlingUnits |
|
N |
Array |
|
|
Provides the list of individual handling units within the shipment. These are the ones that can be handled by forklift individually. |
handlingUnits properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
freightClass |
["50" ,"55", "400"] |
N |
String Array |
String Array |
|
NMFC class of this line item |
OSDCode |
abc1231 |
N |
String |
Length: [1- 50] |
|
Code for Overage, Shortage and Damaged shipment. |
packagingType |
3.2 |
N |
String |
Length: [1- 50] |
|
Code for the packing type of the shipment. |
isHazmat |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains hazardous material. |
isFreezable |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains freezable material. Defaults to false. |
isFood |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains food material. Defaults to false. |
isResidential |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains any residential material. Defaults to false. |
isLimited |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment has any limited material. Defaults to false. |
isPoison |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains poisonous material. Defaults to false. |
isLong |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
If a single HU of the shipment is much longer than a normal 48 inch pallet (e.g., vinyl siding, pipes, etc.). Three possible values are C, N, Y (C - Can't see, N - No, Y - Yes). |
palletSpaceEquivalent |
12 |
N |
Number |
Range: [0-Max] |
Should be non-negative. |
Pallet equivalent of the shipment. |
isStackable |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is stackable or not. Defaults to false. |
isDimensioned |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is dimensioned for volume or not |
isReWeighed |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is reweighed at the location or not. |
pictureLink |
www.carrierphotostorage.com/12345 |
N |
String |
String Length: [1- 500] |
|
Provides the link where shipment's picture can be seen. |
status |
Picked Up, Loaded, Delivered |
N |
String |
Length: [1-50] |
Should be one from pre-defined values |
Status of the shipment. For example: Picked Up -> Loaded -> Delivered |
currentLocation |
ABC |
N |
String |
Length: [1-50] |
Should be a location code. Should be Alphanumeric |
Location at which the shipment is currently present. |
extendedCurrentLocation |
Dock |
N |
String |
Length: [1-50] |
|
Whether the shipment is in dock, yard, city and if there is any specific name to it. |
extendedCurrentLocationValue |
Dock Number 16 |
N |
String |
Length: [1-50] |
|
This will be the specific value or number to define where within the dock/yard/city the shipment is. Example is a dock number within the dock or a yard number/location if it is in the yard |
nextLocation |
DEF |
N |
String |
Length: [1- 50] |
|
Location at which the shipment is planned get handled next (Next break Location) |
lastStatusTime |
2020-12-13T18:39:13.023Z |
N |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
valid 24 hour time and date |
Datetime in UTC at which the last status was updated |
handlingUnitId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier of a handling unit. |
handlingUnitLength |
40 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
For this type of item, the length of each piece, in inches |
handlingUnitWidth |
50 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
For this type of item, the width of each piece, in inches |
handlingUnitHeight |
60 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
For this type of item, the height of each piece, in inches |
handlingUnitPieces |
100 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Number of pieces of this type of item on this line |
handlingUnitWeight |
10000 |
Y |
Integer |
Range: [1-Max] |
Non Negative Integer. Event will be rejected if it is not provided |
Total weight of the combined pieces on this line. If there are multiple line items, it will be less than the shipment weight. |
handlingUnitPackageCode |
SW, BX |
N |
String |
Length: [1-50] |
|
Package code of this line item. |
handlingUnitDescription |
Do not mix with food |
N |
String |
Length: [1-500] |
|
Description of this line item. Can be plain words, NMFC number, or hazmat description. If hazmat it must be the formal hazmat description. |
hazmatInfo |
|
N |
Array |
|
|
Contains info on the hazmat that composes the shipment |
hazmatInfo properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
unNumber |
1234 |
N |
String |
Length: [1-50] |
Valid UN number |
Number to identify dangerous goods. |
hazmatClass |
Class 1 |
Y |
String |
Length: [1-50] |
One of defined hazmat classes |
Describes the hazmat class of the shipment. |
hazmatPackagingType |
3.2 |
N |
String |
Length: [1-50] |
One of defined packaging types |
Code for the packing type of the hazmat pieces in the shipment. |
hazmatWeight |
150 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer |
Describes the weight of the shipment that is hazmat. |
hazmatPieceCount |
12 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer |
Count of pieces that are hazmat in the shipment |
isHazmatBulk |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decides whether the hazmat shipment is Bulk or not |
emergencyPhone |
123-456-7890 |
N |
String |
Length: [1-50] |
Valid phone number format |
Phone number to call in case of emergency with this hazmat shipment. |
customer properties (used in shipper, consignee and thirdPartyCustomer)
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
geoArea |
SW, NE, etc. |
N |
String |
Length: [1-5] |
valid geographic area |
Normal "pre-RouteMax" geographic area of consignee |
code |
ab1234 |
N |
String |
Length: [1-50] |
|
Customer code |
name |
name |
N |
String |
Length: [1-50] |
|
Customer name |
address1 |
123 Main |
N |
String |
Length: [1-500] |
|
First line in the address of the customer |
address2 |
ab, 1234 |
N |
String |
Length: [1-50] |
|
Second line in the address of the customer |
city |
Bethlehem |
N |
String |
Length: [1-100] |
|
City in wich the customer is located in |
state |
TX |
N |
String |
Length: [1-50] |
Valid State code |
Status in which the customer is located in |
zip |
12345 |
N |
String |
Valid Zip |
Valid Zip |
Zip code of the customer |
country |
USA |
N |
String |
Length: [1-50] |
Valid Country Code |
Country code of the customer |
latitude |
40.66 |
N |
Number |
Number |
Minimum acceptable value: -90; Maximum acceptable value: 90 (For the continental US, this value is always negative.) |
Latitude of the customer |
longitude |
-75.38 |
N |
Number |
Number |
Minimum acceptable value: -180; Maximum acceptable value: 180 (For the continental US, this value is always positive.) |
Longitude of the customer |
priorityClass |
abc |
N |
String |
Length: [1-50] |
predefined values |
Priority of the customer to be used in moving freight |
contactName |
Shipper 123 |
N |
String |
Length: [1-50] |
|
Contact name for the customer |
contactPhone |
123-456-7890 |
N |
String |
Length: [1-50] |
Valid phone number format |
Contact phone number for the customer |
customerOpenHours |
10:00 |
N |
String |
hh:mm |
Valid 24 hour time |
Time of day the customer can begin receiving shipments. |
customerCloseHours |
17:00 |
N |
String |
hh:mm |
Valid 24 hour time |
Time of day the customer stops being able to receive shipments. |
CancelShipment
{
"entityId":"98765",
"eventType":"CancelShipment",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"proId":"98765",
"pickupId":"ab1234",
"subPickupId":"ab1234"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "98765",
"eventType": "CancelShipment",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"proId": "98765",
"pickupId": "ab1234",
"subPickupId": "ab1234"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
98765 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the event |
eventType |
CancelShipment |
Y |
String |
Length: [1-50] |
It must be CancelShipment. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
proId |
98765 |
N |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier of a billed shipment. |
pickupId |
ab1234 |
N |
String |
Length: [1-50] |
|
Unique identification of the scheduled pickup. |
subPickupId |
ab1234 |
N |
String |
Length: [1-50] |
|
To distinguish between different shipments of the same pickup. |
ShipmentDelivery
{
"entityId":"98765",
"eventType":"ShipmentDelivery",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"proId":"P123456789",
"handlingUnitId":"ab1234",
"driverId":"AB232123",
"routeId":"ab1234",
"trailerId":"ab1235",
"manifestId":"ab1234",
"deliveryCode":"Clear",
"limitedCode":"Prison",
"accessorials": [
"HANDU",
"ISD",
"LIMIT"
],
"deliveryExceptionNumber": 0,
"excessiveLength": 0,
"isShrinkWrap": true,
"palletCount": 805,
"signature":"John Doe",
"receiverPhone":"352-999-9999",
"receiverEmail":"johndoe@gmail.com",
"deliveryDate":"2024-08-30",
"customerPhone":"352-999-9999",
"comments":"This is an important delivery.",
"codCash": 10.85,
"codCheck":"12345",
"freightCash": 15.07,
"freightCheck":"12345",
"dispatcherName":"John Doe",
"driverAllowedInsideDock": true,
"driverArrivalTime":"21:00",
"driverDepartureTime":"22:30",
"device": {
"deviceMACAddress":"vfg33y767xvdfbfs",
"ipAddress":"127.0.0.1",
"deviceModel":"POCO X2",
"deviceLatitude":"22.998",
"deviceLongitude":"-76.507",
"devicePhone":"123-456-7890"
}
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "98765",
"eventType": "ShipmentDelivery",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"proId": "P123456789",
"handlingUnitId": "ab1234",
"driverId": "AB232123",
"routeId": "ab1234",
"trailerId": "ab1235",
"manifestId": "ab1234",
"deliveryCode": "Clear",
"limitedCode": "Prison",
"accessorials": [
"HANDU",
"ISD",
"LIMIT"
],
"deliveryExceptionNumber": 0,
"excessiveLength": 0,
"isShrinkWrap": true,
"palletCount": 805,
"signature": "John Doe",
"receiverPhone": "352-999-9999",
"receiverEmail": "johndoe@gmail.com",
"deliveryDate": "2024-08-30",
"customerPhone": "352-999-9999",
"comments": "This is an important delivery.",
"codCash": 10.85,
"codCheck": "12345",
"freightCash": 15.07,
"freightCheck": "12345",
"dispatcherName": "John Doe",
"driverAllowedInsideDock": true,
"driverArrivalTime": "21:00",
"driverDepartureTime": "22:30",
"device": {
"deviceMACAddress": "vfg33y767xvdfbfs",
"ipAddress": "127.0.0.1",
"deviceModel": "POCO X2",
"deviceLatitude": "22.998",
"deviceLongitude": "-76.507",
"devicePhone": "123-456-7890"
}
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
98765 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
ShipmentDelivery |
Y |
String |
Length: [1-50] |
It must be ShipmentDelivery. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
proId |
P123456789 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier of a billed shipment. |
handlingUnitId |
ab1234 |
N |
String |
Length: [1-50] |
|
Unique identifier of a single handling unit. |
driverId |
AB232123 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier for the driver that performed the delivery of this shipment. |
routeId |
ab1234 |
N |
String |
Length: [1-50] |
|
What is the routeId for this delivery? |
trailerId |
ab1235 |
N |
String |
Length: [1-50] |
|
Unique identification of the trailerId associated with the delivery of this shipment. |
manifestId |
ab1234 |
N |
String |
Length: [1-50] |
Valid Manifest ID |
Unique identification of the manifest this shipment was delivered on. |
deliveryCode |
Clear, with Exception, Return |
N |
String |
Length: [1-50] |
|
Code to describe how shipment is delivered: Clear, with Exception, Return, to Agent, Spotted |
limitedCode |
Prison, Military |
N |
String |
Length: [1-50] |
|
Code to describe if entry to location is difficult: gated community, prison, military, mine, etc. |
accessorials |
["HANDU","ISD","LIMIT"] |
N |
String Array |
String Array |
|
Description of the extra services at delivery: Inside, Sort & Segregate, Liftgate, etc. |
deliveryExceptionNumber |
0 |
N |
Integer |
Range: [1-Max] |
|
Unique number issued by carrier at time of delivery if there is an exception |
excessiveLength |
0 |
N |
Integer |
Range: [1-Max] |
|
If the shipment is overlength, how long is it? |
isShrinkWrap |
TRUE |
N |
Boolean |
Boolean |
True or False values only. |
Describes whether or not the shipment being delivered is shrink wrapped. |
palletCount |
805 |
N |
Integer |
Range: [1-Max] |
|
Number of pallets that are apart of the shipment being delivered. |
signature |
John Doe |
N |
String |
Length: [1-50] |
|
Signature of the person receiving this shipment (consignee). |
receiverPhone |
352-999-9999 |
N |
String |
Length: [1-50] |
Valid Phone number format |
Phone number of the person receiving this shipment (consignee). |
receiverEmail |
johndoe@gmail.com |
N |
String |
Length: [1-50] |
Valid email address format |
Email of the person receiving this shipment (consignee). |
deliveryDate |
2024-08-30 |
N |
String |
yyyy-mm-dd |
Valid yyyy-mm-dd format |
Date on which shipment was delivered |
customerPhone |
352-999-9999 |
N |
String |
Length: [1-50] |
Valid Phone number format |
Phone number of consignee |
comments |
This is an important delivery. |
N |
String |
Length: [1-200] |
|
Driver added comments for dispatcher upon delivery of shipment. |
codCash |
10.85 |
N |
Number |
Range: [1-Max] |
|
Cash amount that will be paid upon delivery to release the shipment. |
codCheck |
12345 |
N |
String |
Length: [1-50] |
|
Check number of the check used to pay for shipment upon delivery. |
freightCash |
15.07 |
N |
Number |
Range: [1-Max] |
|
Amount of cash paid for freight charges |
freightCheck |
12345 |
N |
String |
Length: [1-50] |
|
Amout of freight charges paid by check |
dispatcherName |
John Doe |
N |
String |
Length: [1-50] |
|
The name of the dispatcher who triggered this event from the web application. |
driverAllowedInsideDock |
TRUE |
N |
Boolean |
Boolean |
True or False values only. |
Is Driver allowed inside to complete the delivery? |
driverArrivalTime |
21:00 |
N |
String |
hh:mm |
Valid 24 hour time |
The arrival time, in the local time of the arrival terminal, of the driver performing this delivery. |
driverDepartureTime |
22:30 |
N |
String |
hh:mm |
Valid 24 hour time |
The departure time, in the local time of the departure terminal, of the driver performing this delivery. |
device |
|
N |
object |
|
|
Object containing device information like ipAddress, model, lat/longs, and phone number. |
device properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
deviceMACAddress |
vfg33y767xvdfbfs |
N |
String |
Length: [1-50] |
Valid MAC Address |
MAC address of the device that is posts a shipment as picked up in the RouteMax Driver App or Dispatch web application. |
ipAddress |
127.0.0.1 |
N |
String |
Length: [1-50] |
Valid IP Address |
IP address of the device that is posts a shipment as picked up in the RouteMax Driver App or Dispatch web application. |
deviceModel |
POCO X2 |
N |
String |
Length: [1-50] |
|
Model Number of the device posting the shipment as picked up in RouteMax App or dispatch web app. |
deviceLatitude |
22.998 |
N |
String |
Length: [1-50] |
Valid Latitude |
Latitude of the device |
deviceLongitude |
-76.507 |
N |
String |
Length: [1-50] |
Valid Longitude |
Longitude of the device |
devicePhone |
123-456-7890 |
N |
String |
Length: [1-50] |
Valid Phone number format |
Device Phone number. |
Pickup
UpdatePickup
{
"entityId":"ab2356",
"eventType":"UpdatePickup",
"source":"docksystem",
"pickupId":"ab2356",
"shipper": {
"geoArea":"SW",
"code":"ab1234",
"name":"name",
"address1":"123 Main",
"address2":"ab, 1234",
"city":"Bethlehem",
"state":"TX",
"zip":"12345",
"country":"USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass":"abc",
"contactName":"Shipper 123",
"contactPhone":"123-456-7890",
"customerOpenHours":"10:00",
"customerCloseHours":"17:00"
},
"origin":"DLS",
"pickupCreatedDate":"2020-05-10",
"pickupCreatedTime":"12:34",
"plannedCityPickupDate":"2020-05-10",
"cityPickupWindowStartTime":"12:30",
"cityPickupWindowEndTime":"22:30",
"actualCityPickupDate":"2020-05-10",
"actualCityPickupTime":"12:30",
"status":"Picked Up",
"expectedTerminalArrivalDate":"2020-05-10",
"expectedTerminalArrivalTime":"10:30",
"isTrailerSwap": true,
"weight": 100,
"volume": 15,
"handlingUnitCount": 5,
"skidCount": 18,
"cityDriverId":"AB1234",
"trailerId":"ab123",
"manifestId":"ab123",
"sourceOfCreation":"DriverApp",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"referenceId":"ab1234",
"voidedDateTime":"2020-01-02T13:07:49.023Z",
"shipments": [
{
"proId":"ab1234",
"referenceId":"ab1234",
"subPickupId":"ab1234",
"volume": 50,
"handlingUnitCount": 60,
"isHazmat": true,
"isFreezable": true,
"isLiftgateRequired": true,
"isResidential": true,
"isLimited": true,
"isLong": true,
"isFood": true,
"isPoison": true,
"consignee": {
"geoArea":"SW",
"code":"ab1234",
"name":"name",
"address1":"123 Main",
"address2":"ab, 1234",
"city":"Bethlehem",
"state":"TX",
"zip":"12345",
"country":"USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass":"abc",
"contactName":"Shipper 123",
"contactPhone":"123-456-7890",
"customerOpenHours":"10:00",
"customerCloseHours":"17:00"
},
"weight": 100,
"pieceCount": 10,
"packagingType":"3.2",
"isPriority": true,
"hazmatInfo": [
{
"unNumber":"1234",
"hazmatClass":"Class 1",
"hazmatPackagingType":"3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone":"123-456-7890"
}
]
}
],
"comments": [
"Comment 1",
"Comment 2",
"Comment 3"
],
"isInsidePickup": true
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab2356",
"eventType": "UpdatePickup",
"source": "docksystem",
"pickupId": "ab2356",
"shipper": {
"geoArea": "SW",
"code": "ab1234",
"name": "name",
"address1": "123 Main",
"address2": "ab, 1234",
"city": "Bethlehem",
"state": "TX",
"zip": "12345",
"country": "USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass": "abc",
"contactName": "Shipper 123",
"contactPhone": "123-456-7890",
"customerOpenHours": "10:00",
"customerCloseHours": "17:00"
},
"origin": "DLS",
"pickupCreatedDate": "2020-05-10",
"pickupCreatedTime": "12:34",
"plannedCityPickupDate": "2020-05-10",
"cityPickupWindowStartTime": "12:30",
"cityPickupWindowEndTime": "22:30",
"actualCityPickupDate": "2020-05-10",
"actualCityPickupTime": "12:30",
"status": "Picked Up",
"expectedTerminalArrivalDate": "2020-05-10",
"expectedTerminalArrivalTime": "10:30",
"isTrailerSwap": true,
"weight": 100,
"volume": 15,
"handlingUnitCount": 5,
"skidCount": 18,
"cityDriverId": "AB1234",
"trailerId": "ab123",
"manifestId": "ab123",
"sourceOfCreation": "DriverApp",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"referenceId": "ab1234",
"voidedDateTime": "2020-01-02T13:07:49.023Z",
"shipments": [
{
"proId": "ab1234",
"referenceId": "ab1234",
"subPickupId": "ab1234",
"volume": 50,
"handlingUnitCount": 60,
"isHazmat": true,
"isFreezable": true,
"isLiftgateRequired": true,
"isResidential": true,
"isLimited": true,
"isLong": true,
"isFood": true,
"isPoison": true,
"consignee": {
"geoArea": "SW",
"code": "ab1234",
"name": "name",
"address1": "123 Main",
"address2": "ab, 1234",
"city": "Bethlehem",
"state": "TX",
"zip": "12345",
"country": "USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass": "abc",
"contactName": "Shipper 123",
"contactPhone": "123-456-7890",
"customerOpenHours": "10:00",
"customerCloseHours": "17:00"
},
"weight": 100,
"pieceCount": 10,
"packagingType": "3.2",
"isPriority": true,
"hazmatInfo": [
{
"unNumber": "1234",
"hazmatClass": "Class 1",
"hazmatPackagingType": "3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone": "123-456-7890"
}
]
}
],
"comments": [
"Comment 1",
"Comment 2",
"Comment 3"
],
"isInsidePickup": true
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab2356 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the event |
eventType |
UpdatePickup |
Y |
String |
Length: [1-50] |
It must be UpdatePickup. Event will be rejected if it is not provided. |
Type of the event |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
pickupId |
ab2356 |
Y |
String |
Length: [1- 50] |
Event will be rejected if it is not provided |
Unique identification of the scheduled pickup |
shipper |
|
N |
customer object |
|
|
Customer information like name, code, address, etc. for shipper as in Customer structure at the bottom (Can be received separated as multiple fields as well) |
origin |
DLS |
Y |
String |
Length: [1- 50] |
Should be a terminalcode. Should beAlphanumeric |
Origin Terminal of the pickup |
pickupCreatedDate |
2020-05-10 |
N |
String |
YYYY-MM-DD |
|
Date on which Pickup was created. Defaults to Today. |
pickupCreatedTime |
12:34 |
N |
String |
hh:mm |
|
Local time at which pickup was created. Defaults to current time. |
plannedCityPickupDate |
2020-05-10 |
Y |
String |
YYYY-MM-DD |
|
Planned Pickup Date of the shipment.If shipment is on pickup appointment, then provide the pickup appointment date. |
cityPickupWindowStartTime |
12:30 |
N |
String |
hh:mm |
|
The start time that pickups can be picked up in the city for this pickup |
cityPickupWindowEndTime |
22:30 |
N |
String |
hh:mm |
|
The end time that pickups can be picked up in the city for this pickup |
actualCityPickupDate |
2020-05-10 |
N |
String |
YYYY-MM-DD |
|
Actual date that the pickup occurs on |
actualCityPickupTime |
12:41:15 |
N |
String |
hh:mm |
|
Actual time that the pickup occurs in the city |
status |
Picked Up |
Y |
String |
Length: [1- 50] |
|
Status of the pickup. For example: Scheduled -> Picked Up -> Back to Terminal |
expectedTerminalArrivalDate |
2020-05-10 |
N |
String |
YYYY-MM-DD |
|
Date on which the pickup is expected to be at the terminal |
expectedTerminalArrivalTime |
10:30 |
N |
String |
hh:mm |
|
Local time at which the pickup is expected to be at the terminal |
isTrailerSwap |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
If the pickup is done by swapping trailers. Defaults to false. |
weight |
100 |
Y |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Weight for the entire pickup (All shipments of the pickup) |
volume |
15 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. |
Volume for the entire pickup (All shipments of the pickup) |
handlingUnitCount |
5 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. |
Handling unit count for the entire pickup (All shipments of the pickup) |
skidCount |
18 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. |
Skid count for the entire pickup (All shipments of the pickup). |
pieceCount |
3 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. |
Count of pieces for the pickup. |
cityDriverId |
AB1234 |
N |
String |
Length: [1- 50] |
Valid city driver ID. |
City driver associated with the pickup |
trailerId |
ab123 |
N |
String |
Length: [1- 50] |
One of carriers valid trailer ID's |
Trailer associated with the pickup |
manifestId |
ab123 |
N |
String |
Length: [1- 50] |
|
Manifest id related to the pickup |
sourceOfCreation |
DriverApp |
N |
String |
Length: [1- 50] |
From predefined options |
Source of the pickup creation |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
UTC time when this event happened |
referenceId |
ab1234 |
N |
String |
Length: [1- 50] |
|
Reference used to match the pickups received from different sources like EDIs and Internet |
voidedDateTime |
2020-01-02T13:07:49.023Z |
N |
String |
Length: [1- 50] |
|
Date and time the pickup is voided. |
shipments |
|
N |
array |
Array |
|
Array of shipments associated with this pickup. |
comments |
["Comment 1, "Comment 2", "Comment 3"] |
N |
String Array |
String array |
|
Array of comments associated with this pickup. |
isInsidePickup |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the pickup requires an insidePickup or not. Defaults to false. |
shipments properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
proId |
ab1234 |
N |
String |
Length: [1-50] |
|
Unique identifier of a billed shipment. |
referenceId |
ab1234 |
N |
String |
Length: [1-50] |
|
Reference used to match the shipments received from different sources like EDIs and Internet |
subPickupId |
ab1234 |
Y |
String |
Length: [1-50] |
|
To distinguish between different shipments of the same pickup. |
volume |
50 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. Event will be rejected if it is not provided |
Volume of the shipment in Cubic feet. |
handlingUnitCount |
60 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. |
Count of handling units in the shipment |
isHazmat |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains hazardous material. |
isFreezable |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains freezable material. Defaults to false. |
isLiftgateRequired |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether a liftgate is required for this shipment. Defaults to false. |
isResidential |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains any residential material. Defaults to false. |
isLimited |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment has any limited material. Defaults to false. |
isLong |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment has exceeding length. Defaults to false. |
isFood |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains food material. Defaults to false. |
isPoison |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains poisonous material. Defaults to false. |
consignee |
|
N |
customer object |
|
|
Customer information like name, code, address, etc. for consignee as in Customer structure at the bottom (Can be received separated as multiple fields as well) |
weight |
100 |
Y |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Weight of the shipment in pounds. |
pieceCount |
10 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. |
Count of pieces in the shipment. |
packagingType |
3.2 |
N |
String |
Length: [1-50] |
|
Code for the packing type of the shipment. |
isPriority |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment is a priority shipment or not. Defaults to False. |
hazmatInfo |
|
N |
array |
|
|
Contains hazmat info on the hazmat that composes the shipment. |
hazmatInfo properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
unNumber |
1234 |
N |
String |
Length: [1-50] |
Valid UN number |
Number to identify dangerous goods. |
hazmatClass |
Class 1 |
Y |
String |
Length: [1-50] |
One of defined hazmat classes. |
Describes the hazmat class of the shipment. |
hazmatPackagingType |
3.2 |
N |
String |
Length: [1-50] |
One of defined packaging types |
Code for the packing type of thehazmat pieces in the shipment. |
hazmatWeight |
150 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Describes the weight of the shipment that is hazmat. |
hazmatPieceCount |
12 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. |
Count of pieces that are hazmat in the shipment |
isHazmatBulk |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decides whether the hazmat shipment is Bulk or not |
emergencyPhone |
123-456-7890 |
N |
String |
Length: [1-50] |
Valid phone number format |
Phone number to call in case of emergency with this hazmat shipment. |
customer properties (used in shipper and consignee)
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
geoArea |
SW, NE, etc. |
N |
String |
Length: [1-50] |
valid geographic area |
Normal "pre-RouteMax" geographic area of consignee |
code |
ab1234 |
N |
String |
Length: [1-50] |
|
Customer code |
name |
name |
N |
String |
Length: [1-50] |
|
Customer name |
address1 |
123 Main |
N |
String |
Length: [1-500] |
|
First line in the address of the customer |
address2 |
ab, 1234 |
N |
String |
Length: [1- 50] |
|
Second line in the address of the customer |
city |
Bethlehem |
N |
String |
Length: [1-100] |
|
City in wich the customer is located in |
state |
TX |
N |
String |
Length: [1-50] |
Valid State code |
Status in which the customer is located in |
zip |
12345 |
N |
String |
Valid Zip |
Valid Zip |
Zip code of the customer |
country |
USA |
N |
String |
Length: [1-50] |
Valid Country Code |
Country code of the customer |
latitude |
40.66 |
N |
Number |
Decimal |
Minimum acceptable value: -90; Maximum acceptable value: 90 (For the continental US, this value is always negative.) |
Latitude of the customer |
longitude |
-75.38 |
N |
Number |
Decimal |
Minimum acceptable value: -180; Maximum acceptable value: 180 (For the continental US, this value is always positive.) |
Longitude of the customer |
priorityClass |
abc |
N |
String |
Length: [1-50] |
predefined values |
Priority of the customer to be used in moving freight |
contactName |
Shipper 123 |
N |
String |
Length: [1-50] |
|
Contact name for the customer |
contactPhone |
123-456-7890 |
N |
String |
Length: [1-50] |
Valid phone number format |
Contact phone number for the customer. |
customerOpenHours |
10:00 |
N |
String |
hh:mm |
Valid 24 hour time |
Time of day the customer can begin handling pickups. |
customerCloseHours |
17:00 |
N |
String |
hh:mm |
Valid 24 hour time |
Time of day the customer stops being able to handle pickups |
CancelPickup
{
"entityId":"ab1234",
"eventType":"CancelPickup",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"pickupId":"ab1234",
"subPickupId":"xyz1234"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "CancelPickup",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"pickupId": "ab1234",
"subPickupId": "xyz1234"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
CancelPickup |
Y |
String |
Length: [1-50] |
It must be CancelPickup. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
pickupId |
ab1234 |
Y |
String |
Length: [1- 50] |
Event will be rejected if it is not provided |
Unique identification of the scheduled pickup |
subPickupId |
xyz1234 |
N |
String |
Length: [1-50] |
|
To distinguish between different shipments of the same pickup. |
PickedUp
{
"entityId":"ab2356",
"eventType":"PickedUp",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"driverId":"AB232123",
"pickupId":"ab2356",
"routeId":"ab1234",
"trailerId":"ab1235",
"manifestId":"ab1234",
"proId":"P123456789",
"EDIProId":"555%123456789",
"EDIFlag": true,
"subPickupId":"ef12",
"origin":"ATL",
"destination":"DLS",
"shipper": {
"geoArea":"SW",
"code":"ab1234",
"name":"name",
"address1":"123 Main",
"address2":"ab, 1234",
"city":"Bethlehem",
"state":"TX",
"zip":"12345",
"country":"USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass":"abc",
"contactName":"Shipper 123",
"contactPhone":"123-456-7890",
"customerOpenHours":"10:00",
"customerCloseHours":"17:00"
},
"consignee": {
"geoArea":"SW",
"code":"ab1234",
"name":"name",
"address1":"123 Main",
"address2":"ab, 1234",
"city":"Bethlehem",
"state":"TX",
"zip":"12345",
"country":"USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass":"abc",
"contactName":"Shipper 123",
"contactPhone":"123-456-7890",
"customerOpenHours":"10:00",
"customerCloseHours":"17:00"
},
"thirdPartyCustomer": {
"geoArea":"SW",
"code":"ab1234",
"name":"name",
"address1":"123 Main",
"address2":"ab, 1234",
"city":"Bethlehem",
"state":"TX",
"zip":"12345",
"country":"USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass":"abc",
"contactName":"Shipper 123",
"contactPhone":"123-456-7890",
"customerOpenHours":"10:00",
"customerCloseHours":"17:00"
},
"serviceType":"Priority",
"serviceLevel": [
"Solutions",
"XA"
],
"cityPickupActualDate":"2018-10-16",
"cityPickupActualTime":"22:15:05",
"cityDueDate":"2018-10-16",
"deliveryDueStartTime":"22:15:05",
"deliveryDueEndTime":"22:15:06",
"cityDeliveryActualDate":"2018-10-16",
"cityDeliveryActualTime":"22:15:05",
"isAppointment": true,
"appointmentDueDate":"2024-04-01",
"appointmentDueTime":"22:15",
"freightClass": [
"50",
"55",
"400"
],
"OSDCode":"abc1231",
"packagingType":"3.2",
"isHazmat": true,
"isFreezable": true,
"isFood": true,
"isResidential": true,
"isLimited": true,
"isPoison": true,
"isStackable": true,
"isDimensioned": true,
"isReWeighed": true,
"isLong": true,
"status":"Picked Up",
"currentLocation":"ABC",
"extendedCurrentLocation":"Dock",
"weight": 40,
"volume": 50,
"handlingUnitCount": 60,
"skidCount": 70,
"pieceCount": 1200,
"totalLength": 200,
"totalWidth": 100,
"totalHeight": 20,
"palletSpaceEquivalent": 12.0,
"revenue": 1800.0,
"isLiftgateRequired": true,
"BOLImageLink":"www.carrierphotostorage.com/12345",
"cashOnDeliveryAmount": 100.0,
"freightAmount": 100.0,
"isCompanyCheck": true,
"isCashRequired": true,
"returnCode":"DC",
"upstreamInterlineCarrierId":"ab1234",
"downstreamInterlineCarrierId":"ab1234",
"specialInstructions":"do a specific thing with this shipment",
"PONumber": [
"NS"
],
"isInsideDelivery": true,
"requireSortingOnDelivery": true,
"shipperBOLNumber":"7739068",
"shipperOrderNumber":"197166",
"billingTerms":"PPD",
"isUnattendedDelivery": true,
"hazmatInfo": [
{
"unNumber":"1234",
"hazmatClass":"Class 1",
"hazmatPackagingType":"3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone":"123-456-7890"
}
],
"handlingUnits": [
{
"freightClass": [
"50",
"55",
"400"
],
"OSDCode":"abc1231",
"packagingType":"3.2",
"isHazmat": true,
"isFreezable": true,
"isFood": true,
"isResidential": true,
"isLimited": true,
"isPoison": true,
"isLong": true,
"palletSpaceEquivalent": 12.0,
"isStackable": true,
"isDimensioned": true,
"isReWeighed": true,
"pictureLink":"www.carrierphotostorage.com/12345",
"status":"Picked Up",
"currentLocation":"ABC",
"extendedCurrentLocation":"Dock",
"extendedCurrentLocationValue":"Dock Number 16",
"nextLocation":"DEF",
"lastStatusTime":"2020-12-13T 18:39:13.023Z",
"handlingUnitId":"ab1234",
"handlingUnitLength": 40,
"handlingUnitWidth": 50,
"handlingUnitHeight": 60,
"handlingUnitPieces": 100,
"handlingUnitWeight": 10000,
"handlingUnitPackageCode":"SW",
"handlingUnitDescription":"Do not mix with food",
"hazmatInfo": [
{
"unNumber":"1234",
"hazmatClass":"Class 1",
"hazmatPackagingType":"3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone":"123-456-7890"
}
]
}
],
"limitedCode":"1234",
"accessorials": [
"Liftgate",
"Limit",
"ISD"
],
"isSLC": true,
"isAmmunition": true,
"isGuaranteed": true,
"receivedCanadianDocumentation": true,
"driverAllowedInsideDock": true,
"dispatcherName":"Justin R",
"driverArrivalTime":"10:15",
"driverDepartureTime":"11:15",
"device": {
"deviceMACAddress":"vfg33y767xvdfbfs",
"ipAddress":"127.0.0.1",
"deviceModel":"POCO X2",
"deviceLatitude":"22.998",
"deviceLongitude":"-76.507",
"devicePhone":"123-456-7890"
},
"unNumber":"1234",
"hazmatClass":"Class 1",
"hazmatPackagingType":"3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone":"123-456-7890"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab2356",
"eventType": "PickedUp",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"driverId": "AB232123",
"pickupId": "ab2356",
"routeId": "ab1234",
"trailerId": "ab1235",
"manifestId": "ab1234",
"proId": "P123456789",
"EDIProId": "555%123456789",
"EDIFlag": true,
"subPickupId": "ef12",
"origin": "ATL",
"destination": "DLS",
"shipper": {
"geoArea": "SW",
"code": "ab1234",
"name": "name",
"address1": "123 Main",
"address2": "ab, 1234",
"city": "Bethlehem",
"state": "TX",
"zip": "12345",
"country": "USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass": "abc",
"contactName": "Shipper 123",
"contactPhone": "123-456-7890",
"customerOpenHours": "10:00",
"customerCloseHours": "17:00"
},
"consignee": {
"geoArea": "SW",
"code": "ab1234",
"name": "name",
"address1": "123 Main",
"address2": "ab, 1234",
"city": "Bethlehem",
"state": "TX",
"zip": "12345",
"country": "USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass": "abc",
"contactName": "Shipper 123",
"contactPhone": "123-456-7890",
"customerOpenHours": "10:00",
"customerCloseHours": "17:00"
},
"thirdPartyCustomer": {
"geoArea": "SW",
"code": "ab1234",
"name": "name",
"address1": "123 Main",
"address2": "ab, 1234",
"city": "Bethlehem",
"state": "TX",
"zip": "12345",
"country": "USA",
"latitude": 40.66,
"longitude": -75.38,
"priorityClass": "abc",
"contactName": "Shipper 123",
"contactPhone": "123-456-7890",
"customerOpenHours": "10:00",
"customerCloseHours": "17:00"
},
"serviceType": "Priority",
"serviceLevel": [
"Solutions",
"XA"
],
"cityPickupActualDate": "2018-10-16",
"cityPickupActualTime": "22:15:05",
"cityDueDate": "2018-10-16",
"deliveryDueStartTime": "22:15:05",
"deliveryDueEndTime": "22:15:06",
"cityDeliveryActualDate": "2018-10-16",
"cityDeliveryActualTime": "22:15:05",
"isAppointment": true,
"appointmentDueDate": "2024-04-01",
"appointmentDueTime": "22:15",
"freightClass": [
"50",
"55",
"400"
],
"OSDCode": "abc1231",
"packagingType": "3.2",
"isHazmat": true,
"isFreezable": true,
"isFood": true,
"isResidential": true,
"isLimited": true,
"isPoison": true,
"isStackable": true,
"isDimensioned": true,
"isReWeighed": true,
"isLong": true,
"status": "Picked Up",
"currentLocation": "ABC",
"extendedCurrentLocation": "Dock",
"weight": 40,
"volume": 50,
"handlingUnitCount": 60,
"skidCount": 70,
"pieceCount": 1200,
"totalLength": 200,
"totalWidth": 100,
"totalHeight": 20,
"palletSpaceEquivalent": 12.0,
"revenue": 1800.0,
"isLiftgateRequired": true,
"BOLImageLink": "www.carrierphotostorage.com/12345",
"cashOnDeliveryAmount": 100.0,
"freightAmount": 100.0,
"isCompanyCheck": true,
"isCashRequired": true,
"returnCode": "DC",
"upstreamInterlineCarrierId": "ab1234",
"downstreamInterlineCarrierId": "ab1234",
"specialInstructions": "do a specific thing with this shipment",
"PONumber": [
"NS"
],
"isInsideDelivery": true,
"requireSortingOnDelivery": true,
"shipperBOLNumber": "7739068",
"shipperOrderNumber": "197166",
"billingTerms": "PPD",
"isUnattendedDelivery": true,
"hazmatInfo": [
{
"unNumber": "1234",
"hazmatClass": "Class 1",
"hazmatPackagingType": "3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone": "123-456-7890"
}
],
"handlingUnits": [
{
"freightClass": [
"50",
"55",
"400"
],
"OSDCode": "abc1231",
"packagingType": "3.2",
"isHazmat": true,
"isFreezable": true,
"isFood": true,
"isResidential": true,
"isLimited": true,
"isPoison": true,
"isLong": true,
"palletSpaceEquivalent": 12.0,
"isStackable": true,
"isDimensioned": true,
"isReWeighed": true,
"pictureLink": "www.carrierphotostorage.com/12345",
"status": "Picked Up",
"currentLocation": "ABC",
"extendedCurrentLocation": "Dock",
"extendedCurrentLocationValue": "Dock Number 16",
"nextLocation": "DEF",
"lastStatusTime": "2020-12-13T 18:39:13.023Z",
"handlingUnitId": "ab1234",
"handlingUnitLength": 40,
"handlingUnitWidth": 50,
"handlingUnitHeight": 60,
"handlingUnitPieces": 100,
"handlingUnitWeight": 10000,
"handlingUnitPackageCode": "SW",
"handlingUnitDescription": "Do not mix with food",
"hazmatInfo": [
{
"unNumber": "1234",
"hazmatClass": "Class 1",
"hazmatPackagingType": "3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone": "123-456-7890"
}
]
}
],
"limitedCode": "1234",
"accessorials": [
"Liftgate",
"Limit",
"ISD"
],
"isSLC": true,
"isAmmunition": true,
"isGuaranteed": true,
"receivedCanadianDocumentation": true,
"driverAllowedInsideDock": true,
"dispatcherName": "Justin R",
"driverArrivalTime": "10:15",
"driverDepartureTime": "11:15",
"device": {
"deviceMACAddress": "vfg33y767xvdfbfs",
"ipAddress": "127.0.0.1",
"deviceModel": "POCO X2",
"deviceLatitude": "22.998",
"deviceLongitude": "-76.507",
"devicePhone": "123-456-7890"
},
"unNumber": "1234",
"hazmatClass": "Class 1",
"hazmatPackagingType": "3.2",
"hazmatWeight": 150,
"hazmatPieceCount": 12,
"isHazmatBulk": true,
"emergencyPhone": "123-456-7890"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab2356 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique indentifier of the shipment |
eventType |
PickedUp |
Y |
String |
Length: [1-50] |
It must be PickedUp. Event will be rejected if it is not provided |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
driverId |
AB232123 |
Y |
String |
Length: [1-50] |
|
Unique identifier for the driver performing this pickup. |
pickupId |
ab2356 |
Y |
String |
Length: [1- 50] |
Event will be rejected if it is not provided |
Unique identification of the scheduled pickup |
routeId |
ab1234 |
N |
String |
Length:[1-50] |
|
What is the routeId for this pickup? |
trailerId |
ab1235 |
N |
String |
Length: [1- 50] |
|
Unique identification of the trailerId associated with the pickup. |
manifestId |
ab1234 |
N |
String |
Length: [1- 50] |
Unique identification of the manifest.Event will be rejected if it is not provided. |
Unique identification of the manifest. |
proId |
P123456789 |
N |
String |
Length: [1- 50] |
|
Unique identifier of a billed shipment. |
EDIProId |
555%123456789 |
N |
String |
Length: [1- 50] |
|
Unique identifier of a temporary pro used when the shipper requests pickup. |
EDIFlag |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Helps identify if a Pro is an EDI pro or just a normal Pro. |
subPickupId |
ef12 |
N |
String |
Length: [1- 50] |
|
To distinguish between different shipments of the same pickup. |
origin |
ATL |
Y |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric. Event will be rejected if it is not provided |
Service Origin of the shipment that is being picked up. (Location/location code) |
destination |
DLS |
Y |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric. Event will be rejected if it is not provided |
Service Destination of the shipment that is being picked up. (Location/location Code) |
shipper |
|
N |
Object |
|
|
Customer information like name, code, address, etc. for shipper as in Customer structure at the bottom (Can be received separated as multiple fields as well) |
consignee |
|
N |
Object |
|
|
Customer information like name, code, address, etc. for consignee as in Customer structure at the bottom (Can be received separated as multiple fields as well) |
thirdPartyCustomer |
|
N |
Object |
|
|
Customer information like name, code, address, etc. for thirdPartyCustomer as in Customer structure at the bottom (Can be received separated as multiple fields as well) |
serviceType |
Priority |
N |
String |
Length: [1- 50] |
Predefined: Priority/Economy/Standard |
Decide what kind of service is defined on the shipment. Default values can be taken from parameters |
serviceLevel |
["Solutions", "XA"] |
N |
String Array |
String Array |
Predefined |
This indicates what quality and speed of service the customer is paying for. They can purchase guaranteed service, or regular service. |
cityPickupActualDate |
2018-10-16 |
N |
Date |
YYYY-MM-DD |
|
Pickup made Date of the shipment. (LiveHaul currently has combined Scheduled and actual) (We can receive separate fields if there is a duration) |
cityPickupActualTime |
10:15 |
N |
String |
hh:mm |
valid 24 hour time |
Local time at which the shipment is picked up. (LiveHaul currently has combined Scheduled and actual) (We can receive separate fields if there is a duration) |
cityDueDate |
2018-10-16 |
N |
Date |
YYYY-MM-DD |
|
Due date of the shipment. |
deliveryDueStartTime |
22:15 |
N |
String |
hh:mm |
valid 24 hour time |
Local time at which the shipment's due time begins, if there is appt timing, we expect the appointment timing to be populated here. |
deliveryDueEndTime |
22:15 |
N |
String |
hh:mm |
valid 24 hour time |
Local time at which the shipment's due time ends, if there is appt timing, we expect the appointment timing to be populated here. |
cityDeliveryActualDate |
2018-10-16 |
N |
Date |
YYYY-MM-DD |
|
The actual delivery date of the shipment. |
cityDeliveryActualTime |
22:15 |
N |
String |
hh:mm |
valid 24 hour time |
The actual delivery time of the shipment. |
isAppointment |
True and False |
N |
Boolean |
Boolean |
|
If the shipment is appointment. Defaults to false. |
appointmentDueDate |
2024-04-01 |
N |
Date |
YYYY-MM-DD |
|
If shipment is a delivery appointment, then provide the appointment due date. |
appointmentDueTime |
22:15 |
N |
String |
hh:mm |
valid 24 hour time |
If shipment is a delivery appointment, then provide the appointment due time. |
freightClass |
["50" ,"55", "400"] |
N |
String Array |
String Array |
|
NMFC class of this line item |
OSDCode |
abc1231 |
N |
String |
Length: [1- 50] |
|
Code for Overage, Shortage and Damaged shipment. |
packagingType |
3.2 |
N |
String |
Length: [1- 50] |
|
Code for the packing type of the shipment. |
isHazmat |
True and False |
N |
Boolean |
Boolean |
|
Decide whether the shipment contains hazardous material. |
isFreezable |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains freezable material. Defaults to false. |
isFood |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains food material. Defaults to false. |
isResidential |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains any residential material. Defaults to false. |
isLimited |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment has any limited material. Defaults to false. |
isPoison |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains poisonous material. Defaults to false. |
isStackable |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is stackable or not. Defaults to false. |
isDimensioned |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is dimensioned for volume or not |
isReWeighed |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is reweighed at the location or not. |
isLong |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipments length is exceeding the acceptable limit or not. |
status |
Picked Up, Loaded, Delivered |
N |
String |
Length: [1- 50] |
Should be one from pre-defined values |
Status of the shipment. For example: Picked Up -> Loaded -> Delivered |
currentLocation |
ABC |
N |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric |
Location at which the shipment is currently present. |
extendedCurrentLocation |
Dock |
N |
String |
Length: [1- 50] |
|
Whether the shipment is in dock, yard, city and if there is any specific name to it. |
weight |
40 |
Y |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Weight of the shipment in pounds. |
volume |
50 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. Event will be rejected if it is not provided |
Volume of the shipment in Cube feet. |
handlingUnitCount |
60 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Count of handling units in the shipment |
skidCount |
70 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Count of skid item in the shipment. |
pieceCount |
1200 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Count of pieces in the shipment. |
totalLength |
100 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Length of the shipment, in inches |
totalWidth |
200 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Width of the shipment, in inches |
totalHeight |
20 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Height of the shipment, in inches |
palletSpaceEquivalent |
12 |
N |
Number |
Range: [0-Max] |
Non Negative Integer. |
Pallet equivalent of the shipment. |
revenue |
1800 |
N |
Number |
Number |
Non Negative Integer. |
Revenue associated with the shipment |
isLiftgateRequired |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment requires a liftgate or not. |
BOLImageLink |
www.carrierphotostorage.com/12345 |
N |
String |
Length: [1- 500] |
|
Provides the link where shipments Bill of Lading can be seen. |
cashOnDeliveryAmount |
100 |
N |
Number |
Range: [0-Max] |
Non Negative |
If COD, what is the COD amount? |
freightAmount |
100 |
N |
Number |
Range: [0-Max] |
Non Negative |
If the driver must collect freight charges, what is the amount? |
isCompanyCheck |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
If the driver must collect money, is a company check OK for payment? |
isCashRequired |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
If the driver must collect money, must the funds be cash or cash equivalent (certified or cashier's check)? |
returnCode |
DC, RCN |
N |
String |
Length: [1- 50] |
|
If shipment was previously out for delivery, what was the most recent return code? |
upstreamInterlineCarrierId |
ab1234 |
N |
String |
Length: [1- 50] |
|
SCAC code of upstream interline carrier who will receive the shipment (Advance Interline Carrier) |
downstreamInterlineCarrierId |
ab1234 |
N |
String |
Length: [1- 50] |
|
SCAC code of downstream interline carrier who will receive the shipment (Advance Interline Carrier) |
specialInstructions |
do a specific thing with this shipment |
N |
String |
Length: [1-Max] |
|
Freeform text special instructions for the shipment, if any |
PONumber |
["NS"] |
N |
String Array |
String Array |
|
String containing all the P.O. numbers associated with the shipment |
isInsideDelivery |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Does the shipment need to be brought inside a building--anything beyond the loading dock area. Examples would be down hallways or up elevators. |
requireSortingOnDelivery |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Does the consignee require the driver to remove the items from one pallet and sort them onto other pallets. |
shipperBOLNumber |
7739068 |
N |
String |
Length: [1-Max] |
|
Bill of lading document number used by the shipper (typically issued by their Shipping department). |
shipperOrderNumber |
197166 |
N |
String |
Length: [1-Max] |
|
Order number used by the shipper (typically issued by their Sales department). |
billingTerms |
PPD |
N |
String |
Length: [1-Max] |
|
Payment terms of shipment, with PPD and COL being the typical values. |
isUnattendedDelivery |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Can driver leave the shipment at a private residence without getting a signature? |
hazmatInfo |
|
N |
Array |
|
|
Contains info on the hazmat that composes the shipment. |
handlingUnits |
|
N |
Array |
|
|
Provides the list of individual handling units within the shipment. These are the ones that can be handled by forklift individually. |
limitedCode |
1234 |
N |
String |
Length: [1- 50] |
|
Code describing this pickups limited access. |
accessorials |
["Liftgate", "Limit", "ISD"] |
N |
String Array |
String Array |
|
Description of accessorials used for delivering |
isSLC |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Describes whether or not the shipper will load and count this shipment. SLC= ShipperLoadAndCount |
isAmmunition |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Whether or not the shipment being picked up contains ammunition |
isGuaranteed |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Whether or not the shipment being picked up is guarenteed |
receivedCanadianDocumentation |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Whether or not the shipment being pickup up has received Canadian documentation or not. |
driverAllowedInsideDock |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Whether or not the Driver doing the pickup is allowed inside the dock. |
dispatcherName |
Justin R |
N |
String |
String Length: [1- 50] |
|
Name of the dispatcher if this event is being triggered from the web application. |
driverArrivalTime |
10:15 |
N |
String |
hh:mm |
Must be valid 24 hour time |
Arrival time of the driver performing the pickup of this shipment. |
driverDepartureTime |
11:15 |
N |
String |
hh:mm |
Must be valid 24 hour time |
Departure time of the driver performing the pickup of this shipment. |
device |
|
N |
Object |
|
|
Object containing device information like ipAddress, model, lat/longs, and phone number. |
unNumber |
1234 |
N |
String |
Length: [1-50] |
Valid UN number |
Number to identify dangerous goods. |
hazmatClass |
Class 1 |
Y |
String |
Length: [1-50] |
One of defined hazmat classes. |
Describes the hazmat class of the shipment. |
hazmatPackagingType |
3.2 |
N |
String |
Length: [1-50] |
One of defined packaging types |
Code for the packing type of the hazmat pieces in the shipment. |
hazmatWeight |
150 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Describes the weight of the shipment that is hazmat. |
hazmatPieceCount |
12 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. |
Count of pieces that are hazmat in the shipment |
isHazmatBulk |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decides whether the hazmat shipment is Bulk or not |
emergencyPhone |
123-456-7890 |
N |
String |
Length: [1-50] |
Valid phone number format |
Phone number to call in case of emergency with this hazmat shipment. |
handlingUnits properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
freightClass |
["50" ,"55", "400"] |
N |
String Array |
String Array |
|
NMFC class of this line item |
OSDCode |
abc1231 |
N |
String |
Length: [1- 50] |
|
Code for Overage, Shortage and Damaged shipment. |
packagingType |
3.2 |
N |
String |
Length: [1- 50] |
|
Code for the packing type of the shipment. |
isHazmat |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains hazardous material. |
isFreezable |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains freezable material. Defaults to false. |
isFood |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains food material. Defaults to false. |
isResidential |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains any residential material. Defaults to false. |
isLimited |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment has any limited material. Defaults to false. |
isPoison |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decide whether the shipment contains poisonous material. Defaults to false. |
isLong |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
If a single HU of the shipment is much longer than a normal 48 inch pallet (e.g., vinyl siding, pipes, etc.). Three possible values are C, N, Y (C - Can't see, N - No, Y - Yes). |
palletSpaceEquivalent |
12 |
N |
Number |
Range: [0-Max] |
Should be non-negative. |
Pallet equivalent of the shipment. |
isStackable |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is stackable or not. Defaults to false. |
isDimensioned |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is dimensioned for volume or not |
isReWeighed |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Mentions if the shipment is reweighed at the location or not. |
pictureLink |
www.carrierphotostorage.com/12345 |
N |
String |
String Length: [1- 500] |
|
Provides the link where shipment's picture can be seen. |
status |
Picked Up, Loaded, Delivered |
N |
String |
Length: [1- 50] |
Should be one from pre-defined values |
Status of the shipment. For example: Picked Up -> Loaded -> Delivered |
currentLocation |
ABC |
N |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric |
Location at which the shipment is currently present. |
extendedCurrentLocation |
Dock |
N |
String |
Length: [1- 50] |
|
Whether the shipment is in dock, yard, city and if there is any specific name to it. |
extendedCurrentLocationValue |
Dock Number 16 |
N |
String |
Length: [1- 50] |
|
This will be the specific value or number to define where within the dock/yard/city the shipment is. Example is a dock number within the dock or a yard number/location if it is in the yard |
nextLocation |
DEF |
N |
String |
Length: [1- 50] |
|
Location at which the shipment is planned get handled next (Next break Location) |
lastStatusTime |
2020-12-13T 18:39:13.023Z |
N |
String |
YYYYMMDDTHH:mm:ss.sssZ |
valid 24 hour time and date |
Datetime in UTC at which the last status was updated |
handlingUnitId |
ab1234 |
Y |
String |
Length: [1- 50] |
Event will be rejected if it is not provided. |
Unique identifier of a handling unit. |
handlingUnitLength |
40 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
For this type of item, the length of each piece, in inches |
handlingUnitWidth |
50 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
For this type of item, the width of each piece, in inches |
handlingUnitHeight |
60 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
For this type of item, the height of each piece, in inches |
handlingUnitPieces |
100 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Number of pieces of this type of item on this line |
handlingUnitWeight |
10000 |
Y |
Integer |
Range: [1-Max] |
Non Negative Integer. Event will be rejected if it is not provided |
Total weight of the combined pieces on this line. If there are multiple line items, it will be less than the shipment weight. |
handlingUnitPackageCode |
SW, BX |
N |
String |
Length: [1-50] |
|
Package code of this line item. |
handlingUnitDescription |
Do not mix with food |
N |
String |
Length: [1-500] |
|
Description of this line item. Can be plain words, NMFC number, or hazmat description. If hazmat it must be the formal hazmat description. |
hazmatInfo |
|
N |
Array |
|
|
Contains info on the hazmat that composes the handling unit. |
device properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
deviceMACAddress |
vfg33y767xvdfbfs |
N |
String |
Length: [1-50] |
Valid MAC Address |
MAC address of the device that is posts a shipment as picked up in the RouteMax Driver App or Dispatch web application. |
ipAddress |
127.0.0.1 |
N |
String |
Length: [1-50] |
Valid IP Address |
IP address of the device that is posts a shipment as picked up in the RouteMax Driver App or Dispatch web application. |
deviceModel |
POCO X2 |
N |
String |
Length: [1-50] |
|
Model Number of the device posting the shipment as picked up in RouteMax App or dispatch web app. |
deviceLatitude |
22.998 |
N |
String |
Length: [1-50] |
Valid Latitude |
Latitude of the device |
deviceLongitude |
-76.507 |
N |
String |
Length: [1-50] |
Valid Longitude |
Longitude of the device |
devicePhone |
123-456-7890 |
N |
String |
Length: [1-50] |
Valid Phone number format |
Device Phone number. |
customer properties (used in shipper, consignee and thirdPartyCustomer)
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
geoArea |
SW, NE, etc. |
N |
String |
Length: [1-5] |
valid geographic area |
Normal "pre-RouteMax" geographic area of consignee |
code |
ab1234 |
N |
String |
Length: [1-50] |
|
Customer code |
name |
name |
N |
String |
Length: [1-50] |
|
Customer name |
address1 |
123 Main |
N |
String |
Length: [1-500] |
|
First line in the address of the customer |
address2 |
ab, 1234 |
N |
String |
Length: [1- 50] |
|
Second line in the address of the customer |
city |
Bethlehem |
N |
String |
Length: [1-100] |
|
City in wich the customer is located in |
state |
TX |
N |
String |
Length: [1-50] |
Valid State code |
Status in which the customer is located in |
zip |
12345 |
N |
String |
Valid Zip |
Valid Zip |
Zip code of the customer |
country |
USA |
N |
String |
Length: [1-50] |
Valid Country Code |
Country code of the customer |
latitude |
40.66 |
N |
Decimal |
Number |
Minimum acceptable value: -90; Maximum acceptable value: 90 (For the continental US, this value is always negative.) |
Latitude of the customer |
longitude |
-75.38 |
N |
Decimal |
Number |
Minimum acceptable value: -180; Maximum acceptable value: 180 (For the continental US, this value is always positive.) |
Longitude of the customer |
priorityClass |
abc |
N |
String |
Length: [1-20] |
predefined values |
Priority of the customer to be used in moving freight |
contactName |
Shipper 123 |
N |
String |
Length: [1-50] |
|
Contact name for the customer |
contactPhone |
123-456-7890 |
N |
String |
Length: [1-50] |
Valid phone number format |
Contact phone number for the customer. |
customerOpenHours |
10:00 |
N |
String |
hh:mm |
Valid 24 hour time |
Time of day the customer can begin receiving shipments |
customerCloseHours |
17:00 |
N |
String |
hh:mm |
Valid 24 hour time |
Time of day the customer stops being able to receive shipments. |
hazmatInfo properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
unNumber |
1234 |
N |
String |
Length: [1-50] |
Valid UN number |
Number to identify dangerous goods. |
hazmatClass |
Class 1 |
Y |
String |
Length: [1-50] |
One of defined hazmat classes. |
Describes the hazmat class of the shipment. |
hazmatPackagingType |
3.2 |
N |
String |
Length: [1-50] |
One of defined packaging types |
Code for the packing type of the hazmat pieces in the shipment.� |
hazmatWeight |
150 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Describes the weight of the shipment that is hazmat. |
hazmatPieceCount |
12 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. |
Count of pieces that are hazmat in the shipment |
isHazmatBulk |
True and False |
N |
Boolean |
Boolean |
Should be TRUE or FALSE |
Decides whether the hazmat shipment is Bulk or not |
emergencyPhone |
123-456-7890 |
N |
String |
Length: [1-50] |
Valid phone number format |
Phone number to call in case of emergency with this hazmat shipment. |
CityDriverArrival
{
"entityId":"AB7423",
"eventType":"CityDriverArrival",
"source":"docksystem",
"driverId":"AB7423",
"locationCode":"ALN",
"routeId":"ab1234",
"trailerId":"ab1234",
"manifestId":"ab1234",
"eventDateTime":"2020-01-02T13:07:49.023Z"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "AB7423",
"eventType": "CityDriverArrival",
"source": "docksystem",
"driverId": "AB7423",
"locationCode": "ALN",
"routeId": "ab1234",
"trailerId": "ab1234",
"manifestId": "ab1234",
"eventDateTime": "2020-01-02T13:07:49.023Z"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
AB7423 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the event |
eventType |
CityDriverArrival |
Y |
String |
Length: [1-50] |
It must be CityDriverArrival. Event will be rejected if it is not provided. |
Type of the event |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
driverId |
AB7423 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Employee number of the driver. |
locationCode |
ALN |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique alphabetical code for location. |
routeId |
ab1234 |
N |
String |
Length: [1-50] |
|
Unique identification of the route. |
trailerId |
ab1234 |
N |
String |
Length: [1-50] |
|
Unique identifier of the trailer |
manifestId |
ab1234 |
N |
String |
Length: [1- 50] |
|
Unique identification of the manifest. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
|
UTC time when this event happened |
Manifest
UpdateManifest
{
"entityId":"ab1234",
"eventType":"UpdateManifest",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"manifestId":"ab1234",
"trailerId":"ab1235",
"origin":"DLS",
"destination":"ATL",
"manifestType":"City",
"originShift":"OB",
"destinationShift":"OB",
"closeDate":"2022-11-06",
"closeTime":"22:30",
"equipmentType":"Pup",
"isBobtail": true,
"manifestStatus":"Delayed",
"headloadLocation":"DLS",
"headloadShift":"Hub",
"tailloadLocation":"DLS",
"tailloadShift":"Hub",
"shipmentArray": [
"12345",
"12345"
],
"PDRouteId":"xyz1234",
"plannedDeliveryDate":"2023-12-25",
"lastStatusTime":"2020-01-02T13:07:49.023Z",
"childManifests": [
{
"origin":"DLS",
"originShift":"Hub",
"destination":"ATL",
"destinationShift":"Hub",
"childManifestId":"xyz1234",
"sequence": 5
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "UpdateManifest",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"manifestId": "ab1234",
"trailerId": "ab1235",
"origin": "DLS",
"destination": "ATL",
"manifestType": "City",
"originShift": "OB",
"destinationShift": "OB",
"closeDate": "2022-11-06",
"closeTime": "22:30",
"equipmentType": "Pup",
"isBobtail": true,
"manifestStatus": "Delayed",
"headloadLocation": "DLS",
"headloadShift": "Hub",
"tailloadLocation": "DLS",
"tailloadShift": "Hub",
"shipmentArray": [
"12345",
"12345"
],
"PDRouteId": "xyz1234",
"plannedDeliveryDate": "2023-12-25",
"lastStatusTime": "2020-01-02T13:07:49.023Z",
"childManifests": [
{
"origin": "DLS",
"originShift": "Hub",
"destination": "ATL",
"destinationShift": "Hub",
"childManifestId": "xyz1234",
"sequence": 5
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the manifest |
eventType |
UpdateManifest |
Y |
String |
Length: [1-50] |
It must be UpdateManifest. Event will be rejected if it is not provided. |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
manifestId |
ab1234 |
Y |
String |
Length: [1- 50] |
Unique identification of the manifest.Event will be rejected if it is not provided. |
Unique identification of the manifest. |
trailerId |
ab1235 |
N |
String |
Length: [1-50] |
|
Unique identification of the trailerId associated with the manifest. |
origin |
DLS |
Y |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric.Event will be rejected if it is not provided. |
Origin of the manifest. |
destination |
ATL |
Y |
String |
Length: [1- 50] |
Should be a location code. Should beAlphanumeric. Event will be rejected if it is not provided. |
Destination of the manifest. |
manifestType |
City and Linehaul |
N |
String |
Length: [1- 50] |
either linehaul or city |
If the manifest is a city manifest or the linehaul manifest. Or trap manifest |
originShift |
OB, IB, Night, Day |
N |
String |
Length: [1- 50] |
Should be one from the predefined values |
Represents the shift during which the manifest's trailer or load was built. |
destinationShift |
OB, IB, Night, Day |
N |
String |
Length: [1- 50] |
Should be one from the predefined values |
Represents the shift during which the manifest's trailer or load is targeted to arrive at the destination terminal. Should help the user determine when they need to strip the manifest as its destination terminal. |
closeDate |
2022-11-06 |
N |
String |
YYYY-MM-DD |
|
Date on which the trailer associated with this manifest is closed. |
closeTime |
22:30 |
N |
String |
hh:mm |
valid 24 hour time |
Local time (of the terminal where the closure is occuring) at which the trailer associated with the manifest is closed. |
equipmentType |
Pup |
N |
String |
Length: [1-50] |
Should be one from the predefined values |
The equipment used on a load (pup, van, short van, etc.). Defaults to pup. |
isBobtail |
false and true |
N |
Boolean |
True/False |
Should be TRUE or FALSE |
Flag mentioning if the manifest should be considered as Bobtail. Defaults to false. |
manifestStatus |
Delayed |
N |
String |
Length: [1-50] |
one of predefined values |
Status of the manifest. |
headloadLocation |
DLS |
N |
String |
Length: [1-50] |
Location code present in the Locations file. |
If the trailer has a headload, then the Location to which the headload is destined to |
headloadShift |
Hub, OB |
N |
String |
Length: [1-50] |
Should be one from the predefined values |
If the trailer has a headload, then the type of freight that the headload is composed of |
tailloadLocation |
DLS |
N |
String |
Length: [1-50] |
Location code present in the Locations file. |
If the trailer has a tailload, then the Location to which the tailload is destined to |
tailloadShift |
Hub, OB |
N |
String |
Length: [1-50] |
Should be one from the predefined values |
If the trailer has a tailload, then the type of freight that the tailload is composed of |
shipmentArray |
["12345", "12345"] |
N |
String Array |
String Array |
|
Array of shipment Ids (Preferred sorting of shipments is ascending order of loading datetime). Could be pickupId or proId |
PDRouteId |
xyz1234 |
N |
String |
Length:[1-50] |
Unique identification of the route. |
If trailer is on a P&D route, what is the route? |
plannedDeliveryDate |
2023-12-25 |
N |
String |
YYYY-MM-DD |
|
Date of P&D operation -- when does freight on the trailed need to deliver? |
lastStatusTime |
2020-01-02T13:07:49.023Z |
N |
String |
YYYY-MMDDTHH:mm:ss.sssZ |
|
Last time in UTC when the status of the manifest was updated. This updates anytime the manifestStatus field changes. |
childManifests |
|
N |
Array |
|
|
Provides the list of child manifests that make up the larger manifest. |
childManifests properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
origin |
DLS |
Y |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric. |
Origin of the child manifest. |
originShift |
Hub, OB |
N |
String |
Length: [1- 50] |
Should be one from the predefined values. |
Type of freight for origin of child manifest. For example: Proper Load, Break Load, etc. |
destination |
ATL |
Y |
String |
Length: [1- 50] |
Should be a location code. Should be Alphanumeric. |
Destination of the child manifest. |
destinationShift |
Hub, OB |
N |
String |
Length: [1- 50] |
Should be one from the predefined values. |
Type of freight for destination of child manifest. For example: Proper Load, Break Load, etc. |
childManifestId |
xyz1234 |
Y |
String |
Length: [1- 50] |
Unique identification of the child manifest. Event will be rejected if it is not provided. |
Unique identification of the child manifest. |
sequence |
1, 2, 3, 20 |
N |
Integer |
Range: [1-Max] |
Should be positive integer. |
This is the sequence of a trailer. 1 being at the head of the trailer and n being at the tail of the trailer. |
CompleteManifest
{
"entityId":"98765",
"eventType":"CompleteManifest",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"manifestId":"98765"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "98765",
"eventType": "CompleteManifest",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"manifestId": "98765"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
98765 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
CompleteManifest |
Y |
String |
Length: [1-50] |
It must be CompleteManifest. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
manifestId |
98765 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier of a manifest. |
CancelManifest
{
"entityId":"98765",
"eventType":"CancelManifest",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"manifestId":"98765"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "98765",
"eventType": "CancelManifest",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"manifestId": "98765"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
98765 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
CancelManifest |
Y |
String |
Length: [1-50] |
It must be CancelManifest. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
manifestId |
98765 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier of a manifest. |
OpenTrailer
{
"entityId":"ab1234",
"eventType":"OpenTrailer",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"trailerId":"xyz1234",
"manifestId":"ab1234",
"locationCode":"DLS",
"routeId":"xyz1234",
"tractorId":"xyz1234",
"dispatchDate":"2022-09-26",
"doorLocation":"15",
"employeeId":"ABC1235",
"employeeName":"John Welch"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "OpenTrailer",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"trailerId": "xyz1234",
"manifestId": "ab1234",
"locationCode": "DLS",
"routeId": "xyz1234",
"tractorId": "xyz1234",
"dispatchDate": "2022-09-26",
"doorLocation": "15",
"employeeId": "ABC1235",
"employeeName": "John Welch"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
OpenTrailer |
Y |
String |
Length: [1-50] |
It must be OpenTrailer. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
trailerId |
xyz1234 |
Y |
String |
Length: [1- 50] |
Event will be rejected if it is not provided. |
Unique identification of the trailer. |
manifestId |
ab1234 |
Y |
String |
Length: [1- 50] |
Event will be rejected if it is not provided. |
Unique identification of the manifest. |
locationCode |
DLS |
Y |
String |
Length: [1- 50] |
Should be a locationcode. Should beAlphanumeric.Event will be rejected if it is not provided. |
The location at which the operation has taken place. |
routeId |
xyz1234 |
N |
String |
Length:[1-50] |
Unique identification of the route |
If trailer is on a P&D route, what is the route? |
tractorId |
xyz1234 |
N |
String |
Length:[1-50] |
Among the tractors in static tractor data |
Unique identification of the tractor being used by the city driver during their dispatch with this trailer. |
dispatchDate |
2022-09-26 |
N |
String |
YYYY-MM-DD |
|
Date the city driver is supposed to be making the trip with this trailer. Dispatch Date is not always equal to day the trailer is opened. |
doorLocation |
15 |
N |
String |
Length: [1- 50] |
|
Identifier of the door at which trailer is parked |
employeeId |
ABC1235 |
N |
String |
Length: [1- 50] |
Among the employees in static data |
Identifier of the employee who is doing the operation |
employeeName |
John Welch |
N |
String |
Length: [1- 50] |
Among the employees in static data |
Name of the employee who is doing the operation |
CloseTrailer
{
"entityId":"ab1234",
"eventType":"CloseTrailer",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"trailerId":"xyz1234",
"manifestId":"ab1234",
"locationCode":"DLS",
"routeId":"xyz1234",
"tractorId":"xyz1234",
"dispatchDate":"2022-09-26",
"doorLocation":"15",
"employeeId":"ABC1235",
"employeeName":"John Welch"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "CloseTrailer",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"trailerId": "xyz1234",
"manifestId": "ab1234",
"locationCode": "DLS",
"routeId": "xyz1234",
"tractorId": "xyz1234",
"dispatchDate": "2022-09-26",
"doorLocation": "15",
"employeeId": "ABC1235",
"employeeName": "John Welch"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by the event |
eventType |
CloseTrailer |
Y |
String |
Length: [1-50] |
It must be CloseTrailer. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
trailerId |
xyz1234 |
Y |
String |
Length: [1- 50] |
Event will be rejected if it is not provided. |
Unique identification of the trailer. |
manifestId |
ab1234 |
Y |
String |
Length: [1- 50] |
Event will be rejected if it is not provided. |
Unique identification of the manifest. |
locationCode |
DLS |
Y |
String |
Length: [1- 50] |
Should be a locationcode. Should beAlphanumeric.Event will be rejected if it is not provided. |
The location at which the operation has taken place. |
routeId |
xyz1234 |
N |
String |
Length:[1-50] |
Unique identification of the route |
If trailer is on a P&D route, what is the route? |
tractorId |
xyz1234 |
N |
String |
Length:[1-50] |
Among the tractors in static tractor data |
Unique identification of the tractor being used by the city driver during his dispatch. |
dispatchDate |
2022-09-26 |
N |
String |
YYYY-MM-DD |
|
Date the city driver is supposed to be making the trip with this trailer. Dispatch Date is not always equal to day the trailer is closed. |
doorLocation |
15 |
N |
String |
Length: [1- 50] |
|
Identifier of the door at which trailer is parked |
employeeId |
ABC1235 |
N |
String |
Length: [1- 50] |
Among the employees in static data |
Identifier of the employee who is doing the operation |
employeeName |
John Welch |
N |
String |
Length: [1- 50] |
Among the employees in static data |
Name of the employee who is doing the operation |
Dock
ForkliftPickup
{
"entityId":"P123456789",
"eventType":"ForkliftPickup",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"forkliftId":"ABC1235",
"dockWorkerId":"ABC1235",
"dockWorkerName":"John Welch",
"locationCode":"DLS",
"proId":"P123456789",
"trailerId":"ab1234",
"manifestId":"ab1234",
"handlingUnitId":"ab1234",
"handlingUnitCount": 20,
"dockZone":"ab1234",
"weight": 50,
"volume": 100,
"toManifestId":"ab1234",
"toTrailerId":"ab1234",
"toDockZone":"ab1234"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "P123456789",
"eventType": "ForkliftPickup",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"forkliftId": "ABC1235",
"dockWorkerId": "ABC1235",
"dockWorkerName": "John Welch",
"locationCode": "DLS",
"proId": "P123456789",
"trailerId": "ab1234",
"manifestId": "ab1234",
"handlingUnitId": "ab1234",
"handlingUnitCount": 20,
"dockZone": "ab1234",
"weight": 50,
"volume": 100,
"toManifestId": "ab1234",
"toTrailerId": "ab1234",
"toDockZone": "ab1234"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
P123456789 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
ForkliftPickup |
Y |
String |
Length: [1-50] |
It must be ForkliftPickup. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
forkliftId |
ABC1235 |
N |
String |
Length: [1- 50] |
|
Identifier of the fork lift used for the operation |
dockWorkerId |
ABC1235 |
N |
String |
Length: [1- 50] |
Among the dock workers in static data |
Identifier of the dock worker who is doing the operation |
dockWorkerName |
John Welch |
N |
String |
Length: [1- 50] |
Among the dock workers in static data |
Name of the dock worker who is doing the operation |
locationCode |
DLS |
Y |
String |
Length: [1- 50] |
Should be a location code. Should beAlphanumeric. Event will be rejected if it is not provided. |
The location at which the operation has taken place. |
proId |
P123456789 |
Y |
String |
Length: [1- 50] |
Should be associated to a valid shipment |
Unique identifier of a billed shipment. |
trailerId |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid trailer Id |
Unique identification of the trailer from which the fork lift pick has happened |
manifestId |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid manifest Id |
Unique identification of the manifest from which the fork lift pick has happened |
handlingUnitId |
ab1234 |
N |
String |
Length: [1- 50] |
|
If the shipment has multiple handling units, then this field provides the unique identifier for the handling unit. |
handlingUnitCount |
10 |
N |
Integer |
Range: [0-Max] |
Non-negative integer. |
Count of the handling unit(s) being picked up by the fork lift in this event. |
dockZone |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid dock zone location |
Unique identification of the dock zone from which the fork lift pick has happened |
weight |
40 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Weight of the freight picked up by the forklift in pounds. |
volume |
50 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer |
Volume of the freight picked up by the forklift in Cubic feet. |
toManifestId |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid trailer Id |
Unique identification of the manifest to which the shipment is going. |
toTrailerId |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid manifest Id |
Unique identification of the trailer to which the shipment is going. |
toDockZone |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid dock zone location |
Unique identification of the dock zone to which the fork the shipment is going. |
ForkliftDrop
{
"entityId":"P123456789",
"eventType":"ForkliftDrop",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"forkliftId":"ABC1235",
"dockWorkerId":"ABC1235",
"dockWorkerName":"John Welch",
"locationCode":"DLS",
"proId":"P123456789",
"trailerId":"ab1234",
"manifestId":"ab1234",
"handlingUnitId":"ab1234",
"handlingUnitCount": 20,
"dockZone":"ab1234",
"weight": 50,
"volume": 100,
"fromTrailerId":"ab1234",
"fromManifestId":"ab1234",
"fromDockZone":"ab1234"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "P123456789",
"eventType": "ForkliftDrop",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"forkliftId": "ABC1235",
"dockWorkerId": "ABC1235",
"dockWorkerName": "John Welch",
"locationCode": "DLS",
"proId": "P123456789",
"trailerId": "ab1234",
"manifestId": "ab1234",
"handlingUnitId": "ab1234",
"handlingUnitCount": 20,
"dockZone": "ab1234",
"weight": 50,
"volume": 100,
"fromTrailerId": "ab1234",
"fromManifestId": "ab1234",
"fromDockZone": "ab1234"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
P123456789 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
ForkliftDrop |
Y |
String |
Length: [1-50] |
It must be ForkliftDrop. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
forkliftId |
ABC1235 |
N |
String |
Length: [1- 50] |
|
Identifier of the fork lift used for the operation |
dockWorkerId |
ABC1235 |
N |
String |
Length: [1- 50] |
Among the dock workers in static data |
Identifier of the dock worker who is doing the operation |
dockWorkerName |
John Welch |
N |
String |
Length: [1- 50] |
Among the dock workers in static data |
Name of the dock worker who is doing the operation |
locationCode |
DLS |
Y |
String |
Length: [1- 50] |
Should be a location code. Should beAlphanumeric. Event will be rejected if it is not provided. |
The location at which the operation has taken place. |
proId |
P123456789 |
Y |
String |
Length: [1- 50] |
Should be associated to a valid shipment |
Unique identifier of a billed shipment. |
trailerId |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid trailer Id |
Unique identification of the trailer to which the fork lift drop happened. |
manifestId |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid manifest Id |
Unique identification of the manifest to which the fork lift drop happened. |
handlingUnitId |
ab1234 |
N |
String |
Length: [1- 50] |
|
If the shipment has multiple handling units, then this field provides the unique identifier for the handling unit. |
handlingUnitCount |
10 |
N |
Integer |
Range: [0-Max] |
Non-negative integer. |
Count of the handling unit(s) being dropped by the fork lift in this event. |
dockZone |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid dock zone location |
Unique identification of the dock zone to which the fork lift drop happened. |
weight |
40 |
N |
Integer |
Range: [1-Max] |
Non Negative Integer. |
Weight of the freight dropped by the forklift in pounds. |
volume |
50 |
N |
Integer |
Range: [0-Max] |
Non Negative Integer. Event will be rejected if it is not provided |
Volume of the freight dropped by the forklift in Cubic feet. |
fromTrailerId |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid trailer Id |
Unique identification of the trailer from which the shipment is coming. |
fromManifestId |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid manifest Id |
Unique identification of the manifest from which the shipment is coming. |
fromDockZone |
ab1234 |
N |
String |
Length: [1- 50] |
Should be a valid dock zone location |
Unique identification of the dock zone from which the shipment is coming. |
ShipmentToManifestAssignment
{
"entityId":"ab1234",
"eventType":"ShipmentToManifestAssignment",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"proId":"P123456789",
"locationCode":"DLS",
"manifestId":"ab1234",
"handlingUnitId":"xyz1234"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "ShipmentToManifestAssignment",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"proId": "P123456789",
"locationCode": "DLS",
"manifestId": "ab1234",
"handlingUnitId": "xyz1234"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
ShipmentToManifestAssignment |
Y |
String |
Length: [1-50] |
It must be ShipmentToManifestAssignment. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
proId |
P123456789 |
Y |
String |
Length: [1- 50] |
Should be associated to a valid shipment |
Unique identifier of a billed shipment. |
locationCode |
DLS |
Y |
String |
Length: [1- 50] |
Should be a location code. Should beAlphanumeric. Event will be rejected if it is not provided. |
The location at which the operation has taken place. |
manifestId |
ab1234 |
Y |
String |
Length: [1- 50] |
Should be a valid manifest Id |
Unique identification of the manifest to which the shipment is getting assigned to. |
handlingUnitId |
xyz1234 |
N |
String |
Length: [1- 50] |
|
If the shipment has multiple handling units, then this field provides the unique identifier for the handling unit. |
ShipmentToManifestUnassignment
{
"entityId":"ab1234",
"eventType":"ShipmentToManifestUnassignment",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"proId":"P123456789",
"locationCode":"DLS",
"manifestId":"ab1234",
"handlingUnitId":"xyz1234"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "ShipmentToManifestUnassignment",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"proId": "P123456789",
"locationCode": "DLS",
"manifestId": "ab1234",
"handlingUnitId": "xyz1234"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
ShipmentToManifestUnassignment |
Y |
String |
Length: [1-50] |
It must be ShipmentToManifestUnassignment. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
proId |
P123456789 |
Y |
String |
Length: [1- 50] |
Should be associated to a valid shipment |
Unique identifier of a billed shipment. |
locationCode |
DLS |
Y |
String |
Length: [1- 50] |
Should be a location code. Should beAlphanumeric. Event will be rejected if it is not provided. |
The location at which the operation has taken place. |
manifestId |
ab1234 |
Y |
String |
Length: [1- 50] |
Should be a valid manifest Id |
Unique identification of the manifest to which the shipment is getting assigned to. |
handlingUnitId |
xyz1234 |
N |
String |
Length: [1- 50] |
|
If the shipment has multiple handling units, then this field provides the unique identifier for the handling unit. |
ChangeTrailerLocationInTerminal
{
"entityId":"ab1234",
"eventType":"ChangeTrailerLocationInTerminal",
"trailerId":"ab1234",
"manifestId":"xyz1234",
"source":"docksystem",
"locationCode":"ALN",
"section":"Yard",
"sectionId":"xyz1234",
"eventDateTime":"2020-12-13T18:39:13.023Z"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ab1234",
"eventType": "ChangeTrailerLocationInTerminal",
"trailerId": "ab1234",
"manifestId": "xyz1234",
"source": "docksystem",
"locationCode": "ALN",
"section": "Yard",
"sectionId": "xyz1234",
"eventDateTime": "2020-12-13T18:39:13.023Z"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ab1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique indentifier of the event |
eventType |
ChangeTrailerLocationInTerminal |
Y |
String |
Length: [1-50] |
It must be ChangeTrailerLocationInTerminal. Event will be rejected if it is not provided. |
Type of the event |
trailerId |
ab1234 |
Y |
String |
Length: [1- 50] |
Event will be rejected if it is not provided. |
Unique identification of the trailer. |
manifestId |
xyz1234 |
Y |
String |
Length: [1- 50] |
Unique identification of the manifest.Event will be rejected if it is not provided. |
Unique identification of the manifest. |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
locationCode |
ALN |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique alphabetical code for location. |
section |
Door, Yard |
Y |
String |
Length: [1-50] |
Should be one of the predefined values. |
Describes the location of the trailer at the terminal. Can be at a door or in the yard. |
sectionId |
xyz1234 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identification of the section the trailer is located at the terminal. |
eventDateTime |
2020-12-13T18:39:13.023Z |
Y |
String |
String YYYY-MM-DDTHH:mm:ss.sssZ |
Event will be rejected if it is not provided. |
UTC time when this event happened. |
Dispatch
UpdatePlannedLHDispatch
{
"entityId":"ATL-CLT-01-5",
"eventType":"UpdatePlannedDispatch",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"plannedDispatchId":"ATL-CLT-01-5",
"scheduleId":"ATL001",
"dispatchOrigin":"ATL",
"dispatchDestination":"DLS",
"plannedDepartureDate":"2022-09-26",
"plannedDepartureTime":"22:30",
"plannedArrivalDate":"2022-09-26",
"plannedArrivalTime":"22:30",
"runType":"TURN",
"dispatchType":"Travel",
"transportMode":"City",
"routeType":"NoHazmat",
"primaryDriverId":"ab1234",
"secondaryDriverId":"ab1234",
"thirdPartyReferenceId":"ABCDEFGGGG1",
"ptCarrierId":"BCRA",
"tractorId":"ab1234",
"notes":"This is the best planned dispatch.",
"loads": {
"loadId":"ab1234",
"origin":"ATL",
"destination":"DLS",
"readyShift":"Hub",
"dueShift":"OB",
"plannedCloseDate":"2022-09-26",
"plannedCloseTime":"22:30",
"manifestId":"ab1234",
"trailerId":"289082",
"equipmentType":"Pup",
"loadType":"Empty",
"childManifests": {
"origin":"DLS",
"originShift":"Hub, OB",
"destination":"ATL",
"destinationShift":"Hub, OB",
"childManifestId":"ab1234",
"sequence": 3
}
},
"actualDispatchId":"ab1234",
"meetScheduleId":"ATL001",
"restAtDestination": true
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ATL-CLT-01-5",
"eventType": "UpdatePlannedDispatch",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"plannedDispatchId": "ATL-CLT-01-5",
"scheduleId": "ATL001",
"dispatchOrigin": "ATL",
"dispatchDestination": "DLS",
"plannedDepartureDate": "2022-09-26",
"plannedDepartureTime": "22:30",
"plannedArrivalDate": "2022-09-26",
"plannedArrivalTime": "22:30",
"runType": "TURN",
"dispatchType": "Travel",
"transportMode": "City",
"routeType": "NoHazmat",
"primaryDriverId": "ab1234",
"secondaryDriverId": "ab1234",
"thirdPartyReferenceId": "ABCDEFGGGG1",
"ptCarrierId": "BCRA",
"tractorId": "ab1234",
"notes": "This is the best planned dispatch.",
"loads": {
"loadId": "ab1234",
"origin": "ATL",
"destination": "DLS",
"readyShift": "Hub",
"dueShift": "OB",
"plannedCloseDate": "2022-09-26",
"plannedCloseTime": "22:30",
"manifestId": "ab1234",
"trailerId": "289082",
"equipmentType": "Pup",
"loadType": "Empty",
"childManifests": {
"origin": "DLS",
"originShift": "Hub, OB",
"destination": "ATL",
"destinationShift": "Hub, OB",
"childManifestId": "ab1234",
"sequence": 3
}
},
"actualDispatchId": "ab1234",
"meetScheduleId": "ATL001",
"restAtDestination": true
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ATL-CLT-01-5 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
UpdatePlannedLHDispatch |
Y |
String |
Length: [1-50] |
It must be UpdatePlannedLHDispatch. Event will be rejected if it is not provided |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
plannedDispatchId |
ATL-CLT-01-5 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Used as a primary key for the planned dispatches. |
scheduleId |
ATL001 |
N |
String |
Length: [1-50] |
Should be a valid run ID. Event will be rejected if it is not provided. |
Unique identifier for schedule. |
dispatchOrigin |
ATL, DLS |
Y |
String |
Length: [1-50] |
These codes should be either alphanumeric location codes OR be a special code defined.Event will be rejected if it is not provided. |
Origin of the dispatch |
dispatchDestination |
ATL, DLS |
Y |
String |
Length: [1-50] |
These codes should be either alphanumeric location codes OR be a special code defined.Event will be rejected if it is not provided. |
Destination of the dispatch |
plannedDepartureDate |
2022-09-26 |
Y |
String |
YYYY-MM-DD |
Event will be rejected if it is not provided. |
Planned Date for departure. |
plannedDepartureTime |
22:30 |
Y |
String |
hh:mm |
Event will be rejected if it is not provided. Valid 24 hour time |
Planned time for the departure in local timezone |
plannedArrivalDate |
2022-09-26 |
N |
String |
YYYY-MM-DD |
|
Planned Date for Arrival. |
plannedArrivalTime |
22:30 |
N |
String |
hh:mm |
Valid 24 hour time |
Planned time for the arrival in local timezone |
runType |
TURN |
N |
String |
Length: [1-50] |
Should be one from pre-defined values. Event will be rejected if it is not provided. |
Schedule Run Type. |
dispatchType |
Travel, Dock, Meal |
N |
String |
Length: [1-50] |
Should be one from pre-defined values. |
Dispatch type describes the type of dispatch being sent. A normal movement dispatch would be blank or say "Travel". If a dispatch says "Dock" then the dispatch is not conveying movement but conveying the length of time a driver is working the dock. In the case of "Dock" or "Meal" the origin and destination of the dispatch should be the same facility.? |
transportMode |
City, LineHaul, Purchase |
N |
String |
Length: [1-50] |
Should be one from pre-defined values. |
If the dispatch is for city, linehaul, purchase, rail etc. |
routeType |
NoHazmat |
N |
String |
Length: [1-50] |
Should be one from pre-defined values. |
Route type defines if the dispatch happened on regular road or road allowing hazmat freight. It is used to decide the distance. Defaults to regular type road. |
primaryDriverId |
ab1234 |
N |
String |
Length: [1-50] |
Valid and existing Driver ID. |
Code of the primary Driver |
secondaryDriverId |
ab1234 |
N |
String |
Length: [1-50] |
Valid and existing Driver ID. |
Code of the secondary driver if the dispatch is taken by team drivers |
thirdPartyReferenceId |
ABCDEFGGGG1 |
N |
String |
Length: [1-50] |
This should be either the purchaseLaneId or the railLinkId |
This is the unique identifier for rail links and PT Lanes, so that we can reference travel time, cost, and availability data in the rail and PT Lane tables. |
ptCarrierId |
BCRA |
N |
String |
Length: [1-50] |
|
PT Carrier Code. This should only be filled if the schedule is a PT or Rail schedule. It should match the carrier code in PT and Rail data. |
tractorId |
ab1234 |
N |
String |
Length: [1-50] |
|
Tractor Id associated with the dispatch. |
notes |
This is the best planned dispatch. |
N |
String |
Length: [1-500] |
|
String field where comments or notes can be made about the dispatch. |
loads |
|
N |
Array |
|
|
A list of planned loads (planned or actual manifests) associated with the dispatch |
actualDispatchId |
ab1234 |
N |
String |
Length: [1-50] |
|
When actual dispatch occurs, this Id maps it back to the plan |
meetScheduleId |
ATL001 |
N |
String |
Length: [1-50] |
Valid and existing Schedule ID. |
Schedule Id of a meet schedule to which this dispatch will be meeting |
restAtDestination |
True/False |
N |
Boolean |
Boolean |
|
This field is true when the driver plans to take a 10+ hour rest after arriving at the dispatch destination. |
loads properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
loadId |
ab1234 |
N |
String |
Length: [1-50] |
|
Unique identification of the load that is planned to move. |
origin |
ATL |
Y |
String |
Length: [1-50] |
Should be a location code. Should beAlphanumeric. |
Origin of the planned load |
destination |
DLS |
Y |
String |
Length: [1-50] |
Should be a location code. Should beAlphanumeric. |
Destination of the load. |
readyShift |
Hub, OB |
N |
String |
Length: [1-50] |
Should be one from pre-defined values. |
Type of the origin freight planned on the load. For example: Proper Load, Break Load, etc. |
dueShift |
Hub, OB |
N |
String |
Length: [1-50] |
Should be one from pre-defined values. |
Type of the dest freight planned on the load. For example: Proper Load, Break Load, etc. |
plannedCloseDate |
2022-09-26 |
N |
String |
YYYY-MM-DD |
Valid Date Format. |
Planned close date of the load. |
plannedCloseTime |
22:30 |
N |
String |
hh:mm |
Valid 24 hour time |
Planned close time of the load in local timezone |
manifestId |
ab1234 |
N |
String |
Length: [1-50] |
|
Manifest Id associated with the load. |
trailerId |
289082 |
N |
String |
Length: [1-50] |
|
Trailer Id associated with the load. |
equipmentType |
Pup, ShortVan, LongVan |
N |
String |
Length: [1-50] |
Should be one from pre-defined values. |
The equipment used on a load (pup, van, short van, etc.) Default value is taken from parameter. |
loadType |
Empty, Loaded |
N |
String |
Length: [1-50] |
Should be one from pre-defined values. |
Whether it is Loaded, Empty or Bobtail. |
childManifests |
|
N |
Array |
|
|
Array of child manifests that create the greater manifest. |
childManifests properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
origin |
DLS |
Y |
String |
Length: [1-50] |
Should be a location code. Should beAlphanumeric. |
Origin Terminal of the child manifest |
originShift |
Hub, OB |
N |
String |
Length: [1-50] |
Should be one from the predefined values |
Shift in which the child manifest will depart from its origin. |
destination |
ATL |
Y |
String |
Length: [1-50] |
Should be a location code. Should beAlphanumeric. |
Destination Terminal of the child manifest |
destinationShift |
Hub, OB |
N |
String |
Length: [1-50] |
Should be one from the predefined values |
Shift in which the child manifest will arrive at its destination. |
childManifestId |
ab1234 |
N |
String |
Length: [1-50] |
Unique identification of the child manifest.Event will be rejected if it is not provided. |
Unique identification of the child manifest. |
sequence |
3 |
N |
Integer |
Range: [1- Max] |
Non negative and non zero integer. |
Order that the child manifest is in the overall manifest. |
DeletePlannedLHDispatch
{
"entityId":"ABC-XYZ-123",
"eventType":"DeletePlannedLHDispatch",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"plannedDispatchId":"ABC-XYZ-123"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "ABC-XYZ-123",
"eventType": "DeletePlannedLHDispatch",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"plannedDispatchId": "ABC-XYZ-123"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
ABC-XYZ-123 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique identifier of the shipment |
eventType |
DeletePlannedLHDispatch |
Y |
String |
Length: [1-50] |
It must be DeletePlannedLHDispatch. Event will be rejected if it is not provided |
Type of the event |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
plannedDispatchId |
ABC-XYZ-123 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided |
Unique identifier of the dispatch being planned upon. |
LHDispatchUpdate
{
"entityId":"123456",
"eventType":"LHDispatchUpdate",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"source":"docksystem",
"dispatchId":"123456",
"plannedDispatchId":"ATL-CLT-01-5",
"dispatchOrigin":"ATL",
"dispatchDestination":"DLS",
"dispatchStatus":"Enroute",
"routeType":"NoHazmat",
"primaryDriverId":"AB232123",
"secondaryDriverId":"ABC232123",
"tractorId":"abc1234",
"dispatchDate":"2022-09-26",
"dispatchTime":"22:30",
"estimatedArriveDate":"2022-09-26",
"estimatedArriveTime":"22:30",
"actualArriveDate":"2022-09-26",
"actualArriveTime":"22:30",
"transportMode":"Linehaul",
"thirdPartyReferenceId":"ABCDEFGGGG1",
"ptCarrierId":"BCRA",
"scheduleId":"ATL001",
"scheduleType":"TURN",
"restAtDestination": true,
"notes":"Break after 5 hours",
"manifestArray": [
{
"manifestId":"ABC12351",
"sequence": 2
}
]
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "123456",
"eventType": "LHDispatchUpdate",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"source": "docksystem",
"dispatchId": "123456",
"plannedDispatchId": "ATL-CLT-01-5",
"dispatchOrigin": "ATL",
"dispatchDestination": "DLS",
"dispatchStatus": "Enroute",
"routeType": "NoHazmat",
"primaryDriverId": "AB232123",
"secondaryDriverId": "ABC232123",
"tractorId": "abc1234",
"dispatchDate": "2022-09-26",
"dispatchTime": "22:30",
"estimatedArriveDate": "2022-09-26",
"estimatedArriveTime": "22:30",
"actualArriveDate": "2022-09-26",
"actualArriveTime": "22:30",
"transportMode": "Linehaul",
"thirdPartyReferenceId": "ABCDEFGGGG1",
"ptCarrierId": "BCRA",
"scheduleId": "ATL001",
"scheduleType": "TURN",
"restAtDestination": true,
"notes": "Break after 5 hours",
"manifestArray": [
{
"manifestId": "ABC12351",
"sequence": 2
}
]
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
123456 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
LHDispatchUpdate |
Y |
String |
Length: [1-50] |
It must be LHDispatchUpdate. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
dispatchId |
123456 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier for the actual dispatch. |
plannedDispatchId |
ATL-CLT-01-5 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier for the related planned dispatch. |
dispatchOrigin |
ATL, DLS |
Y |
String |
Length: [1-50] |
These codes should be either alphanumeric location codes OR be a special code defined.Event will be rejected if it is not provided. |
This is the location code for the origin of the dispatch. In the case where a break is defined as mid-dispatch, a _BKO code can be used to denote the driver is coming from a mid-dispatch break. |
dispatchDestination |
ATL, DLS |
Y |
String |
Length: [1-50] |
These codes should be either alphanumeric location codes OR be a special code defined.Event will be rejected if it is not provided. |
This is the location code for the destination of the dispatch. In the case where a break is being defined mid-dispatch, a _BKD code can be used to denote the driver is going to a mid-dispatch break. |
dispatchStatus |
AVL, ENR, DOC |
N |
String |
Length: [1-50] |
From predefined values |
Current status of the dispatch |
routeType |
NoHazmat |
N |
String |
Length: [1-50] |
From predefined values |
Describes restrictions or abilities about link supporting hazmat or other special properties. |
primaryDriverId |
AB232123 |
N |
String |
Length: [1-50] |
|
Unique identifier for the primary driver on schedule. |
secondaryDriverId |
ABC232123 |
N |
String |
Length: [1-50] |
|
If team, then unique identifier for the secondary driver on schedule. |
tractorId |
abc1234 |
N |
String |
Length: [1-50] |
Among the tractors in static tractor data |
The dedicated tractor for the driver. This may or may not be the current tractor the driver is using. |
dispatchDate |
2022-09-26 |
Y |
String |
YYYY-MM-DD |
Event will be rejected if it is not provided. |
The date on which the dispatch started |
dispatchTime |
22:30 |
Y |
String |
hh:mm |
Event will be rejected if it is not provided. |
The time at which the dispatch started |
estimatedArriveDate |
2022-09-26 |
N |
String |
YYYY-MM-DD |
|
What is the estimated date on which the dispatch will reach the destination? |
estimatedArriveTime |
22:30 |
N |
String |
hh:mm |
|
What is the estimated time at which the dispatch will reach the destination? |
actualArriveDate |
2022-09-26 |
N |
String |
YYYY-MM-DD |
|
Actual arrival date of the dispatch at the destination |
actualArriveTime |
22:30 |
N |
String |
hh:mm |
|
Actual arrival time of the dispatch at the destination |
transportMode |
City, Linehaul, etc |
N |
String |
Length: [1-50] |
Should be one from pre-defined values |
If the dispatch is for city, linehaul, purchase, rail, etc |
thirdPartyReferenceId |
ABCDEFGGGG1 |
N |
String |
Length: [1-50] |
This should be either the purchaseLaneId or the railLinkId |
This is the unique identifier for rail links and PT Lanes, so that we can reference travel time, cost, and availability data in the rail and PT Lane tables. |
ptCarrierId |
BCRA |
N |
String |
Length: [1-50] |
|
PT Carrier Code. This should only be filled if the schedule is a PT or Rail schedule. It should match the carrier code in PT and Rail data. |
scheduleId |
ATL001 |
N |
String |
Length: [1-50] |
Should be a valid run ID. Event will be rejected if it is not provided. |
Unique identifier for schedule. |
scheduleType |
TURN |
N |
String |
Length: [1-50] |
Should be one from pre-defined values. Event will be rejected if it is not provided. |
Schedule Run Type. |
restAtDestination |
True/False |
N |
Boolean |
Boolean |
|
This field is true when the driver plans to take a 10+ hour rest after arriving at the dispatch destination. |
notes |
Break after 5 hours |
N |
String |
Length: [1-50] |
|
String allowing for free text data at the dispatch level. |
manifestArray |
|
N |
Array |
|
|
Array of the actual manifests associated with the dispatch. |
manifestArray properties
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
manifestId |
ABC12351 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided but the manifest exists. |
Manifest Id associated with the dispatch. |
sequence |
1,2,3 |
Y |
Integer |
Length: [1-Max] |
Event will be rejected if it is not provided but the manifest exists. |
Sequence of the manifest in the dispatch. |
LHDispatchEnd
{
"entityId":"123456",
"eventType":"LHDispatchEnd",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"dispatchId":"123456",
"source":"docksystem"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "123456",
"eventType": "LHDispatchEnd",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"dispatchId": "123456",
"source": "docksystem"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
123456 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
LHDispatchEnd |
Y |
String |
Length: [1-50] |
It must be LHDispatchEnd. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
dispatchId |
123456 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier for the actual dispatch. |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |
LHDispatchCancel
{
"entityId":"123456",
"eventType":"LHDispatchCancel",
"eventDateTime":"2020-01-02T13:07:49.023Z",
"dispatchId":"123456",
"source":"docksystem"
}
curl --location -g --request POST 'https://{EVENTHUB_NAMESPACE}.servicebus.windows.net/{EVENTHUB_NAME}/messages' \
--header 'token: Bearer <Token>' \
--header 'Content-Type: application/atom+xml;type=entry;charset=utf-8' \
--data-raw '{
"entityId": "123456",
"eventType": "LHDispatchCancel",
"eventDateTime": "2020-01-02T13:07:49.023Z",
"dispatchId": "123456",
"source": "docksystem"
}'
// KEYS REQUIRED: TENANT_ID, CLIENT_ID, CLIENT_SECRET
// Using: System.Text, System.Text.Json
// resource : "https://eventhubs.azure.net"
public async Task<string> GetToken(string resource)
{
var uri = new Uri($"https://login.microsoftonline.com/{TENANT_ID}/oauth2/token");
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "client_credentials",
["client_id"] = CLIENT_ID,
["client_secret"] = CLIENT_SECRET,
["resource"] = resource
});
var response = await this.httpClient.PostAsync(uri, requestContent);
string responseContent = await response.Content.ReadAsStringAsync();
var responseData = JsonSerializer.Deserialize<JsonElement>(responseContent);
return responseData.GetProperty("access_token").GetString()!;
}
// KEYS REQUIRED: EVENT_HUB_NAMEPSPACE, EVENT_HUB_NAME, CLIENT_SECRET
// Using: System.Text
public async Task Publish(string message, string token)
{
var eventHubUrl = $"https://{EVENT_HUB_NAMEPSPACE}.servicebus.windows.net/{EVENT_HUB_NAME}/messages";
var request = new HttpRequestMessage(HttpMethod.Post, eventHubUrl);
string mediaType = "application/atom+xml;type=entry;charset=utf-8";
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {token}");
request.Headers.TryAddWithoutValidation("Content-Type", mediaType);
request.Content = new StringContent(message, Encoding.UTF8);
var response = await this.httpClient.SendAsync(request);
}
Payload Field Description
FieldName |
Values |
Mandatory Status |
Data Type |
Data Format |
Validation |
Description |
entityId |
123456 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Domain ID which uniquely identifies the Domain Entity affected by any Event |
eventType |
LHDispatchCancel |
Y |
String |
Length: [1-50] |
It must be LHDispatchCancel. Event will be rejected if it is not provided. |
Type of the event. Helpful to identify the payload that is received. |
eventDateTime |
2020-01-02T13:07:49.023Z |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
UTC time when this event happened |
dispatchId |
123456 |
Y |
String |
Length: [1-50] |
Event will be rejected if it is not provided. |
Unique identifier for the actual dispatch. |
source |
docksystem |
N |
String |
Length: [1-50] |
|
The system name or code which is generating this event. |