As a rule, if a Dispatch is open for a line, and the impact of the Dispatch Type is "Down," the line is considered down. This makes it simple to query the L2L API to see if a line is down. Here is a sample API call checking for all open Code Red Dispatches for an entire site:
https://acme.leading2lean.com/api/1.0/dispatches/?auth=1234&site=1&completed__isnull=True&order_by=-created&dispatchtypecode=Code%20Red&areacode=acme
It is strongly encouraged that you filter this list of Dispatches by areacode
or linecode
.
The above API call can only pull a list of Dispatches one Dispatch Type at a time. If you want to find all "down" Dispatches, you can pull a list of "down" Dispatch Types, and query the /dispatches/
API for each "down" Dispatch Type. You can use the /dispatchtypes/
API to gather a list of dispatch types with a "down" impact like this:
https://acme.leading2lean.com/api/1.0/dispatchetypes/?auth=1234&site=1&impact=0