Most abnormalities can be captured manually by launching a new Dispatch in L2L. L2L provides a way to create, update, and complete Dispatches through the API in order to automate for efficiency. Here are a few use cases when automating the creation and completion of Dispatches can be helpful:
- Launching a Dispatch to notify technicians when a Machine throws a specific fault
- Launching a process in L2L from another application, such as a QMS
- Closing a Dispatch when a fault condition is no longer active
- Using hardware devices to launch Dispatches
Launching a Dispatch
Objective: Automate the creation of a Dispatch to improve efficiency and accuracy of Dispatch data.
Suggested Interval: On Demand
Process Outline:
- (Optional) Identify if a Dispatch has already been launched for the affected Machine with the same Dispatch Type. This can be used to prevent the duplication of data. If a Dispatch is found with the same Machine and Dispatch Type, a new Dispatch may not be needed.
GET https://[customer].leading2lean.com/api/1.0/dispatches/?auth=[api key]&site=[site id]&machinecode=[machine code]&dispatchtypecode=[dispatch type code]&open=T&order_by=-reported&limit=1
- Create a new Dispatch. There are two methods to create a Dispatch:
- Add. This creates a completed and closed Dispatch. This method is used if you want to simply capture an occurrence or downtime without any human interaction needed.
POST https://[customer].leading2lean.com/api/1.0/dispatches/add/?auth=[api key]
- POST Parameters:
site=[site id]&dispatchtypecode=[dispatch type code]&description=[description]&machinecode=[machine code]&tradecode=[trade code]
- See the official API documentation for a full list of POST Parameters.
- POST Parameters:
- Open. This is used to launch an open Dispatch. This is just like launching a Dispatch using the New Dispatch form in the UI.
-
POST https://[customer].leading2lean.com/api/1.0/dispatches/open/?auth=[api key]
- POST Parameters:
site=[site id]&dispatchtypecode=[dispatch type code]&description=[description]&machinecode=[machine code]&tradecode=[trade code]
- See the official API documentation for a full list of POST Parameters.
- POST Parameters:
- Add. This creates a completed and closed Dispatch. This method is used if you want to simply capture an occurrence or downtime without any human interaction needed.
Closing a Dispatch
Objective: Close a Dispatch programmatically
Suggested Interval: On Demand
Process Outline:
- Look up the Dispatch to find the Dispatch ID. This step can be skipped if the Dispatch ID is already known.
GET https://[customer].leading2lean.com/api/1.0/dispatches/?auth=[api key]&site=[site id]&dispatchnumber=[dispatch number]
- Close the Dispatch
POST https://[customer].leading2lean.com/api/1.0/dispatches/close/[dispatch id]/?auth=[api key]
Completing a Dispatch
Objective: Complete a Dispatch programmatically
Suggested Interval: On Demand
Process Outline:
- Look up the Dispatch to find the Dispatch ID. This step can be skipped if the Dispatch ID is already known.
GET https://[customer].leading2lean.com/api/1.0/dispatches/?auth=[api key]&site=[site id]&dispatchnumber=[dispatch number]
- Complete the Dispatch
POST https://[customer].leading2lean.com/api/1.0/dispatches/complete/[dispatch id]/?auth=[api key]