NOTE: For the most recent and updated version of this documentation, please see the API Documentation link under the Support menu when you log in to L2L Dispatch.
Leading2Lean API 1.0 Documentation
The API is based on HTTP REST (Intro to RESTful API Design) with the data returned in json (default) or xml format.
To access the API you'll need the correct endpoint:
https://<company>.leading2lean.com
The <company> value is the name of your LES deployment, and will typically be your company name. All API access is via SSL/HTTPS.
You will also need an API Key to authenticate each API HTTP request. This API Key can only be created by Leading2Lean Support and must be used by your API client programs. You may also need to cryptographically sign requests for certain API calls. For more information on authentication methods, please see the section on Authentication.
Here are the following documentation sections:
- Integration Options and Best Practices White Paper
- Sample API Code
- API Best Practices
- API Properties
- HTTP GET - View Records
- HTTP POST - Create / Update Records
- HTTP PUT - Update Records
- HTTP DELETE - Delete Records
- Authentication - How to use your API Key and signed requests
- Record Areas - List of record areas with API functionality
- Detailed Method Documentation - Additional details of selected method call functionality
- Reporting API Documentation - Reporting API with access to summarized reporting data useful for external reporting solutions
- Supported Barcode Formats - List of supported barcode formats
L2L Integration Options and Best Practices White Paper
The Leading2Lean LES solution can be integrated to a wide range of external 3rd party systems. These include Enterprise Resource Planning (ERP), Computerized Maintenance Management Systems (CMMS), Manufacturing Execution Systems (MES), Time & Attendance, Document Control, Traceability, and Training solutions. This document describes the most common integrations methods and data (application areas) and for integrating 3rd party applications to the Leading2Lean LES application. You should use it as a planning tool to help identify the areas of integration and the methods/scenarios that most closely correspond to the business process you are trying to support.
Sample Code
For more information on API code examples please see the following resources:
- API Code Examples
- Leading2Lead on GitHub (https://github.com/leading2lean)
API Best Practices
- Error Handling
- Log and review your error messages. Each API call will return a response object with success field (True/False) and if False an Error or Errors field. Don't rely on the HTTP status code for the success or failure of your API request, since the request might successfully make it to us, but still fail on field validation or backend errors. In these cases, we will return an HTTP status code of 200, but with success=False and error="Problem with...".
- Review the Documentation and Test First
- With the APIs we've set up, you have a lot of power. Be careful, test in the sandbox, make sure you know what you are attempting before you do it in a production site. Read the API documentation carefully so you understand the ramifications of your actions. Feel free to contact Support if you have any questions.
- Tread Lightly, Don't DOS your Servers
- It's very possible to create a Denial Of Service (DOS) attack against your L2L servers. A simple error in your integration code can spawn hundreds or thousands of API requests per second effectively bringing the servers to their knees. Be considerate and put a delay between your API calls to spread them out over time, smoothing the impact on the service.
- Create a Separate User / API Auth Key per Integration
- By creating a separate User / Auth Key per Integration, you can more easily track down problems to the specific offending integration. It also protects your other integrations from being shutoff if one integration fails in some spectacular way that triggers our support team to disable it remotely by disabling the API key.
Intelligence Throttling and Exponential Backoff
If you start to see HTTP timeouts, HTTP 500 errors, or Rate Limiting Errors from your API calls, it probably means the service is under significant load. Your integration code should be smart enough to throttle itself and start adding delays between API calls to try to lighten the traffic to the server until it recovers. For more information regarding the concept of Exponential Backoff, see https://en.wikipedia.org/wiki/Exponential_backoff
Use Pagination when Syncing Data
We have recently enforced a 2000 item limit when using the record area APIs. This is to ensure performance of the service when doing syncing operations. Get to know how the limit, offset, and order_by parameters work. This will make your code much more efficient and scalable when working with large datasets. It will also help with the overall performance of the service. For more information, see the HTTP GET section below.
Do Not Assume Data Record Field Ordering Is Guaranteed
When parsing records, never assume that the order of fields within an individual record will be consistent. For data sequences that represent key/value style dictionaries, in either xml or json formats, the sequences of fields can and will change from time to time. Use intelligent parsing algorithms that use key names to find values instead of field indexes - these data records must be treated as dictionaries, not arrays.
API Properties
L2L allows administrators to customize label names inside the app. This makes it possible to customize the software to match the terminology used at a site. We do not change property names in the API, however. The API is, in a sense, a contract that cannot change with system settings. In order to help the developers building integration code, here is a list of localized terms and how they are represented in the API.
Generic Label | Customized Label | API Property |
---|---|---|
Area | Area | area |
Line | Line | line |
Machine | Machine | machine |
Tooling | Tooling | tooling |
Dispatch | Dispatch | dispatch |
Dispatch Type | Dispatch Type | dispatch_type |
Value Stream | Value Stream | valuestream |
Technology | Technology | technology |
Trade | Trade | trade |
Name | Name | name |
Description | Description | description |
Scrap | Scrap Defect | scrap |
HTTP GET
To retrieve record(s), use an HTTP GET request using a URL that looks like this:
https://<company>.leading2lean.com/api/1.0/<record_area>/<id>/?<query arguments>
The URL Query arguments must follow the URL Path and start with a '?', and are <key>=<value> pairs separated with a '&'.
URL Path Parameters:
- company (Required) - This is most likely the name of your company.
- record_area (Required) - This is the record area data you're requesting. (See above)
- id (Optional) - If you want to filter the results to retrieve a single record, specify this optional id value.
URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- Optional Query Arguments - You can also filter/limit/order the list by adding key/value query parameters to the end of the url.
- Proxy User
- realuser=<loginid> - Specify a username for a user that this api call is being made for. This allows the api client to make changes on behalf of the given user. If not specified, the api client user is the one tracked as the user making changes.
- Formatting
- format=xml - returns the results in xml format instead of json (default).
- l2lfmt_microseconds=true - returns datetime fields formatted to a precision of microseconds rather than milliseconds when using the default JSON format.
- Filtering
- field=<value> - You can specify a field/value pair to list only results where the field is equal to the value. eg. site=1
- field__lt=<value> - Less Than filtering: add "__lt" to the end of the field name. eg. description__lt=Sandbox
- field__lte=<value> - Less Than or Equal filtering: add "__lte" to the end of the field name. eg. description__lte=Sandbox
- field__gt=<value> - Greater Than filtering: add "__gt" to the end of the field name. eg. description__gt=Sandbox
- field__gte=<value> - Greater Than or Equal filtering: add "__gte" to the end of the field name. eg. description__gte=Sandbox
- field__isnull=<value> - Is Null filtering: add "__isnull" to the end of the field name, and value must be 'True' or 'False'. eg. completed__isnull=False
- NOTE: If using datetime values for lt/gt comparisons (i.e. with DateTimeField's), you should use a UTC date/time in ISO 8601 format like: 2016-05-05T22:39:47 that is url encoded. When using a date value for comparison with a DateField, use a date encoded in ISO 8601 format like: 2016-05-05. You can compare DateTimeField's to plain date strings as well.
- Pagination
- limit=<value> - Limit the number of records returned. eg. limit=100. Note that there is a max limit for this that varies by the API area, but defaults to 2000. If this value exceeds the max, the api call will fail.
- offset=<value> - Starting point for the records to be returned. eg. offset=0 (default)
- Results Customization
- order_by=<field> - Order the results (ascending) by the specified field. Placing "-" before the field name will order the results in descending order.
- fields=fieldname1,fieldname2,... - Allows you to specify the fields to return as a comma delimited list. The API will display all fields if you don't provide this parameter.
- Proxy User
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success it will be a list of records or an individual record.
- error (Optional) - Error message if success is false.
- errors (Optional) - A list of error messages if success is false. Used when submitting data.
- offset (Optional) - If the requested data results in a list, then the current pagination offset (starting count of current page) is provided.
- limit (Optional) - If the requested data results in a list, then the current pagination limit (page size) is provided.
Examples:
Retrieve a list of all Site records (assuming there are 5 total) using the curl utility, using paging logic. Using paging logic is important when retrieving more records than the default maximum limits, and this pattern can be reused with all record areas (but note that you can use a much bigger limit than 2).
First you would run a get with your limit set and the offset set to 0:
$ curl https://example.leading2lean.com/api/1.0/sites/?auth=1234567890&limit=2&offset=0
Which returns:
{ "limit": 2, "data": [ { "description": "Sandbox", "created": null, "site": 1, "lastupdated": null, "timezone": "America/Los_Angeles", "id": 3 }, { "description": "Site 1", "created": "2010-12-30 11:52:50", "site": 43, "lastupdated": "2011-01-10 17:26:47", "timezone": "GMT+4", "id": 8 }, ], "success": true, "offset": 0 }
Since the number of records returned matches the limit, there is more data to retrieve. Make another get call with the same limit and your offset set to the number of records returned in the previous call:
$ curl https://example.leading2lean.com/api/1.0/sites/?auth=1234567890&limit=2&offset=2
Which returns:
{ "limit": 2, "data": [ { "description": "Site 2", "created": null, "site": 1, "lastupdated": null, "timezone": "America/Los_Angeles", "id": 5 }, { "description": "Site 3", "created": "2010-12-30 11:52:50", "site": 43, "lastupdated": "2011-01-10 17:26:47", "timezone": "GMT+4", "id": 6 }, ], "success": true, "offset": 2 }
Finally make another get call with the same limit and the total number of records retrieved so far:
$ curl https://example.leading2lean.com/api/1.0/sites/?auth=1234567890&limit=2&offset=4
Which returns:
{ "limit": 2, "data": [ { "description": "Site 4", "created": null, "site": 1, "lastupdated": null, "timezone": "America/Los_Angeles", "id": 9 } ], "success": true, "offset": 4 }
Since fewer records than the limit were returned, you know that you have iterated over all records and can stop iterating.
To retrieve an single Site record:
$ curl https://example.leading2lean.com/api/1.0/sites/3/?auth=1234567890
{ "data": { "description": "Sandbox", "created": null, "site": 1, "lastupdated": null, "timezone": "America/Los_Angeles", "id": 3 }, "success": true }
XML Examples:
Retrieve a list of Sites in XML format:
curl https://example.leading2lean.com/api/1.0/sites/?auth=1234567890&format=xml
<?xml version="1.0" encoding="utf-8"?> <response> <limit>100</limit> <data> <resource> <description>Sandbox</description> <created>None</created> <site>1</site> <lastupdated>None</lastupdated> <timezone>America/Los_Angeles</timezone> <id>3</id> </resource> <resource> <description>Production Plant 43</description> <created>2010-12-30 11:52:50</created> <site>43</site> <lastupdated>2011-01-10 17:26:47</lastupdated> <timezone>GMT+4</timezone> <id>8</id> </resource> </data> <success>True</success> <offset>0</offset> </response>
or an individual Site record:
curl https://example.leading2lean.com/api/1.0/sites/3/?auth=1234567890&format=xml
<?xml version="1.0" encoding="utf-8"?> <response> <data> <description>Sandbox</description> <created>None</created> <site>1</site> <lastupdated>None</lastupdated> <timezone>America/Los_Angeles</timezone> <id>3</id> </data> <success>True</success> </response>
Python example for paging through data
To retrieve a list of all machines, here's some python 2.7 code that uses the requests library to do that paging using the max limit of 2000.
import requests finished = False machines = [] url = 'https://example.leading2lean.com/api/1.0/machines/' apikey = 'fakeapikey' limit = 2000 site = 1 while not finished: resp = requests.get(url, {'auth': apikey, 'site': site, 'limit': limit, 'offset': len(machines)}, timeout=60) if resp.ok: resp_js = resp.json() if not resp_js['success']: raise Exception("api call failed with error: %s" % resp_js['error']) machines.extend(resp_js['data']) if len(resp_js['data']) < limit: finished = True else: raise Exception("Failed request, error: %d" % resp.status_code)
HTTP POST
Use an HTTP POST to create, update, and delete data in the LES system. Due to some clients not being able to submit HTTP PUT and DELETE requests, this method has the ability to Create or Update records depending on whether an ID field is passed as a parameter. For example, if an id is specified, an existing record will be updated. If an id is not specified, then a new record will be created. You can also delete records by passing the parameter "_action=delete" and including the record id as a query argument or a post body argument.
The API uses HTTP POST method standards. Arguments in a POST request will be sent in the body of the request. Similar to HTTP GET requests, arguments in a POST request must be URL Encoded, and the "Content-Type" header will be set to "application/x-www-form-urlencoded." In many cases you can interface directly with the Record Area to add or update records:
URL: https://<company>.leading2lean.com/api/1.0/<record_area>/<id>/?<query arguments>
URL Parameters:
- company (Required) - Your LES deployment name (most likely the name of your company).
- record_area (Required) - The name of the Record Area you are accessing.
- id (Optional) - The id of the Record you are modifying. May also be a POST argument.
URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - Returns the results in xml format instead of json.
- _action=delete (Optional) - You can optionally delete a record by passing this parameter. This is useful when your client is unable to perform an HTTP DELETE call (I.e. via browser javascript).
- realuser=<loginid> (Optional) - Specify a username for a user that this api call is being made for. This allows the api client to make changes on behalf of the given user. If not specified, the api client user is the one tracked as the user making changes.
POST Arguments
- id=<id> (Optional) - The individual record to update.
- <field>=<value> (Optional) - specify field/value pairs to set on the record. i.e. site=1
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - If success if will return either a list of records or an individual record.
- error (Optional) - Error message if success is false.
- errors (Optional) - A list of error messages if success is false. Used when submitting data to provide validation errors.
Python Example
import requests url = 'https://example.leading2lean.com/api/1.0/machines/' apikey = 'fakeapikey' site = 1 resp = requests.post(url, {'auth': apikey, 'site': site, 'code': 'WLD0001', 'description': 'Welder for line 1', 'shortdescription': 'Welder 1', 'linecode': 'Line1'}, timeout=60) if resp.ok: resp_js = resp.json() if not resp_js['success']: raise Exception("api call failed with error: %s" % resp_js['error']) else: raise Exception("Failed request, error: %d" % resp.status_code)
HTTP PUT
Using an HTTP PUT you can update data using the same format/parameters as an HTTP POST request.
HTTP DELETE
Using an HTTP DELETE you can delete data by passing in the ID of the record as described by the HTTP POST documentation.
Authentication
You will need an API Key to authenticate each API HTTP request. Depending on the API, you may also need a Secret Key to cryptographically sign your API requests to ensure it wasn't tampered with. API Keys are linked to user accounts and are subject to the security access of that account. Any actions taken using the API are tracked by that username. The best practice is to create a separate API user for each integration, to make it easier to track down problems with individual integrations.
How to request an API Key
API Keys are created by Leading2Lean support. To request an API Key, first setup the associated API user account under the setup menu. Then submit a request to support@leading2lean.com including the username of the API user and a description of the integration project you are working on.
How to use an API Key
All API requests need to include the API Key. This API Key can be set in an HTTP Header called "L2LAUTH", in an url query parameter called "auth", or in a POST argument called "auth", with the value set to your API Key. For example, if my API Key was "key123" and I wanted to pull a list of areas from the Area API I could use the following URL:
- https://company.leading2lean.com/api/1.0/areas/?auth=key123
What is a Secret Key?
For most normal API access, your API Key is sufficient. But, for specific more security-sensitive API calls, you will need a Secret Key to sign requests as an added security measure to ensure the request came from you. Unlike an API Key, a Secret Key is linked to a server name. Your Secret Key should never be passed in an API request. Your Secret Key is used to cryptographically sign an API request. Secret Keys are issued by Leading2lean support. Please contact support@leading2lean.com for more details.
How do I use Secret Key to sign an API request?
For most normal API access, your API Key is sufficient. But for specific API calls, you will need a Secret Key to sign requests as an added security measure to ensure the request came from you.
Leading2Lean uses a custom HTTP scheme based on a keyed-HMAC (Hash Message Authentication Code) for authentication. To authenticate a request, you first concatenate selected elements of the request to form a string. You then use your Secret Key to calculate the HMAC of that string. The output of the HMAC algorithm is the signature. You add this signature as a parameter of the request along with the server name identifying which Secret Key you are using.
When the system receives an authenticated request, it fetches the Secret Key that you specify using the supplied Server name. It then uses it's own copy of the Secret Key in the same way to compute a RFC 2104 HMAC-SHA512 signature of selected elements from the request it received. The system then compares the signature it calculated against the signature passed in the request. If the two signatures match, the system concludes that you must have the Secret Key and the request is valid. If the two signatures do not match, the request is dropped and the system responds with an error message.
For each API call there will be an ordered list of parameters that are used to calculate the signature. This list always starts with the server name (parameter name: _server) associated with the Secret Key you are using, followed by the expiration date in UTC (parameter name: _expiration) of the request in the following format: "YYYY-MM-DD HH:MM:SS". For example: "2016-03-31 13:59:59". Generally, the best practice is to set the expiration to now in UTC plus 15 minutes to ensure the request can't be reused in the future. You must concatenate the values of those parameters, separated by a "\n" or newline, in order to build the StringToSign. Then next step is to calculate the HMAC-SHA512 of the StringToSign to produce a message digest. The message digest is then converted to a Base64 string to produce the signature (parameter name: _signature).
The following is pseudocode that shows the construction of the signature. (In the example, \n means the Unicode code point U+000A, commonly called newline).
SecretKey = "Your-Secret-Key-Goes-Here" server = "Corporate HR Server" expiration = "2016-03-31 13:00:00" username = "johnsmith" active = "True" StringToSign = server + "\n" + expiration + "\n" + username + "\n" + active Signature = base64(hmac_sha512(SecretKey, UTF-8-Encoding-Of(StringToSign)))
HMAC-SHA512 is an algorithm defined by RFC 2104 - Keyed-Hashing for Message Authentication using the SHA512 algorithm instead of SHA1. The algorithm takes as input two byte-strings, a key and a message. Use your Secret Key as the key, and the UTF-8 encoding of the StringToSign as the message. The output of HMAC-SHA512 is also a byte string, called the digest. The Signature is constructed by Base64 encoding this digest.
How can I proxy API calls for other users?
If you want to make API calls on behalf of other users (i.e. the other user is the one who actually makes the changes to records), you can use the realuser parameter. This is available on all API calls, but only when using the auth parameter. Currently, the realuser user must have site access that is equal to or a subset of the api user's site access, and the api user must have admin access in order to use the realuser parameter.
Record Areas with API functionality
These record areas have HTTP API functionality as documented above. Additional record areas are available but currently undocumented. Contact us for details.
The following documentation for each Record Area lists the base URL path to use in either HTTP POST or GET operations, as well as the available fields that can be read and modified for each Record Area.
Actions
-
URL:
- /api/1.0/actions/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- code: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=255)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField()
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
- site_default: BooleanField()
Areas
-
Description:
- Read only interface to view Area information.
-
URL:
- /api/1.0/areas/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- code: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- default_dispatchtype: ForeignKey(Dispatch Type, null=True, blank=True)
- description: CharField(max_length=255)
- enable_kaizen: BooleanField()
- enable_workorders: BooleanField()
- externalid: CharField(null=True, blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- label_printer: ForeignKey(Label Printer, null=True, blank=True)
- labor_efficiency_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- labor_efficiency_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- lhpu_green_yellow: DecimalField(max_digits=19, decimal_places=4)
- lhpu_yellow_red: DecimalField(max_digits=19, decimal_places=4)
- lmpu_green_yellow: DecimalField(max_digits=19, decimal_places=3)
- lmpu_yellow_red: DecimalField(max_digits=19, decimal_places=3)
- machinehistory: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- npm_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- npm_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- oa_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- oa_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- oee_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- oee_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- peff_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- peff_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- peff_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- peff_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- pitch_pace_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- pitch_pace_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- pitch_pace_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- pitch_pace_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- pph_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- pph_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- pph_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- pph_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- ppp_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- ppp_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- restrict_to_warehouses: BooleanField()
- scrap_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- scrap_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- site: ForeignKey(Site)
- teff_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- teff_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- tpu_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- tpu_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- warehouse: ForeignKey(Warehouse, null=True, blank=True)
- yield_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- yield_yellow_green: DecimalField(max_digits=19, decimal_places=2)
-
Methods:
URL Example: /api/1.0/areas/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Bill of Materials
-
URL:
- /api/1.0/billofmaterials/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- cost: DecimalField(max_digits=19, decimal_places=4)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- critical: BooleanField()
- date_to_order: DateField(null=True, blank=True)
- description: CharField(max_length=1024)
- external_master: BooleanField()
- externalid: BigIntegerField(null=True, blank=True) NOTE: values can range from -9223372036854775808 to 9223372036854775807
- id: AutoField( primary_key=True, blank=True, readonly=True)
- image: ForeignKey(Part Image, null=True, blank=True)
- info: CharField(null=True, blank=True, max_length=1024)
- lastordered: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- manufacturer: CharField(null=True, blank=True, max_length=1024)
- manufacturer_partnumber: CharField(null=True, blank=True, max_length=100)
- minimum: DecimalField(max_digits=19, decimal_places=4)
- obsolete: BooleanField()
- optimum: DecimalField(max_digits=19, decimal_places=4)
- part_category: ForeignKey(Part Category, null=True, blank=True)
- partnumber: CharField(max_length=100)
- po_unit_of_measure: ForeignKey(Unit of Measure, null=True, blank=True)
- quantity: DecimalField(max_digits=19, decimal_places=4)
- refresh: BooleanField()
- shortpartnumber: CharField(null=True, blank=True, max_length=20)
- site: ForeignKey(Site)
- synchronized: BooleanField()
- taxable: BooleanField()
- unit_of_measure: ForeignKey(Unit of Measure, null=True, blank=True)
- units_per_unit_of_measure: DecimalField(max_digits=19, decimal_places=4)
-
Methods:
URL Example: /api/1.0/billofmaterials/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
-
- bulk_set_images - /api/1.0/billofmaterials/bulk_set_images/
- inbound_location_quantity_sync - /api/1.0/billofmaterials/inbound_location_quantity_sync/
- inbound_sync - /api/1.0/billofmaterials/inbound_sync/
- outbound_sync - /api/1.0/billofmaterials/outbound_sync/
- synchronize - /api/1.0/billofmaterials/synchronize/
Bill Of Materials Machines
-
URL:
- /api/1.0/billofmaterialsmachine/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- billofmaterials: ForeignKey(Bill of Material)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- machine: ForeignKey(Machine)
Bill Of Materials Vendors
-
URL:
- /api/1.0/billofmaterialsvendor/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- billofmaterials: ForeignKey(Bill of Material)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- partnumber: CharField(max_length=50)
- primary: BooleanField()
- vendors: ForeignKey(Vendor)
Bin Locations
-
Description:
- Read only interface to view Bin Location information. Bin Locations are added via the BillOfMaterials inbound_sync method.
-
URL:
- /api/1.0/binlocation/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- billofmaterials: ForeignKey(Bill of Material)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- quantity: DecimalField(max_digits=19, decimal_places=4)
- warehouse: ForeignKey(Warehouse)
Build Sequences
-
Description:
- Read only interface to view Build Sequences.
-
URL:
- /api/1.0/buildsequence/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- barcode_data: TextField(null=True, blank=True)
- barcode_format: CharField(null=True, blank=True, max_length=50)
- built_quantity: DecimalField(null=True, blank=True, max_digits=19, decimal_places=2)
- changeover_actual: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- changeover_duration: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- cycle_time_seconds: DecimalField(max_digits=19, decimal_places=4)
- description: TextField(null=True, blank=True)
- due_date: DateTimeField(null=True, blank=True)
- end_date: DateTimeField(null=True, blank=True)
- externalid: CharField(null=True, blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- labor_duration: IntegerField(blank=True) NOTE: values can range from -2147483648 to 2147483647
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line: ForeignKey(Line, null=True, blank=True)
- name: CharField(max_length=50)
- operator_count: DecimalField(null=True, blank=True, max_digits=19, decimal_places=2)
- order_quantity: DecimalField(null=True, max_digits=19, decimal_places=2)
- planned_operator_count: DecimalField(null=True, blank=True, max_digits=19, decimal_places=2)
- product: ForeignKey(Products and Components)
- product_order: ForeignKey(Product Order)
- production_duration: IntegerField(blank=True) NOTE: values can range from -2147483648 to 2147483647
- schedule_end_date: DateTimeField(null=True, blank=True)
- schedule_start_date: DateTimeField(null=True, blank=True)
- scrap_quantity: DecimalField(null=True, blank=True, max_digits=19, decimal_places=2)
- sequence: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- site: ForeignKey(Site)
- start_date: DateTimeField(null=True, blank=True)
- status: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- status_date: DateTimeField(null=True, blank=True) NOTE: value is in UTC
- takt_time_seconds: DecimalField(null=True, blank=True, max_digits=19, decimal_places=4)
-
Methods:
URL Example: /api/1.0/buildsequence/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
-
- complete_order - /api/1.0/buildsequence/complete_order/
- finish_change_over - /api/1.0/buildsequence/finish_change_over/
- get_current_order_on_line - /api/1.0/buildsequence/get_current_order_on_line/
- put_order_on_hold - /api/1.0/buildsequence/put_order_on_hold/
- start_change_over - /api/1.0/buildsequence/start_change_over/
- sync_order_details - /api/1.0/buildsequence/sync_order_details/
Checklist Answers
-
Description:
- DEPRECATED API - This API will be removed at a future date. Use the answers field in the checklists api to access answers.
-
URL:
- /api/1.0/checklistsanswers/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- answer: TextField(null=True, blank=True)
- checklist: ForeignKey(Checklist)
- control_limit_high: DecimalField(null=True, max_digits=19, decimal_places=6)
- control_limit_low: DecimalField(null=True, max_digits=19, decimal_places=6)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- dispatch: ForeignKey(Dispatch, null=True, blank=True)
- history: JSONField(null=True, blank=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(null=True, blank=True, readonly=True)
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- na: BooleanField()
- reject_limit_high: DecimalField(null=True, max_digits=19, decimal_places=6)
- reject_limit_low: DecimalField(null=True, max_digits=19, decimal_places=6)
- site: ForeignKey(Site)
- table_column_number: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- table_row_number: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- task_hash: CharField(max_length=32)
- task_number: IntegerField() NOTE: values can range from -2147483648 to 2147483647
Checklists
-
Description:
- BETA API - FUNCTIONALITY MAY CHANGE. This API interface is READ ONLY. Each checklist contains a list of tasks and the list of answers for the checklist.
-
URL:
- /api/1.0/checklists/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- area: ForeignKey(Area, null=True, blank=True)
- build_sequence: ForeignKey(Build Sequence, null=True, blank=True)
- closed: BooleanField()
- closeddate: DateTimeField(null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=255)
- dispatch: ForeignKey(Dispatch, null=True, blank=True)
- document: ForeignKey(document)
- earned_time: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- externalid: CharField(null=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- initial_ui_fields: ArrayField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line: ForeignKey(Line, null=True, blank=True)
- machine: ForeignKey(Machine, null=True, blank=True)
- name: CharField(max_length=100)
- notes: TextField(null=True, blank=True)
- number: CharField(null=True, max_length=50)
- postwork_revision: ForeignKey(document revision, null=True, blank=True)
- prework_revision: ForeignKey(document revision, null=True, blank=True)
- product: ForeignKey(Products and Components, null=True, blank=True)
- product_order: ForeignKey(Product Order, null=True, blank=True)
- reject_limits_dispatch: ForeignKey(Dispatch, null=True, blank=True)
- require_complete_all: BooleanField()
- require_dispatch_close: BooleanField()
- require_password_save: BooleanField()
- revision: ForeignKey(document revision)
- site: ForeignKey(Site)
- tasks: [List of Task Objects]
- technology: ForeignKey(Technology, null=True, blank=True)
- user: ForeignKey(User, null=True, blank=True)
-
Notes for Query API:
-
- The 'externalid' is deprecated and property will be removed in a future version of this API.
-
Methods:
URL Example: /api/1.0/checklists/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Components
-
URL:
- /api/1.0/components/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- code: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=255)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField()
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
- site_default: BooleanField()
Consumption Categories
-
URL:
- /api/1.0/consumptioncategory/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- default: BooleanField()
- description: CharField(blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
Contacts
-
URL:
- /api/1.0/contact/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- cell: CharField(null=True, blank=True, max_length=15)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- email: EmailField(null=True, blank=True, max_length=254)
- fax: CharField(null=True, blank=True, max_length=15)
- firstname: CharField(null=True, blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- lastname: CharField(max_length=50)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
- work: CharField(null=True, blank=True, max_length=15)
Cost Centers
-
Description:
- Read only interface to view CostCenter information.
-
URL:
- /api/1.0/costcenters/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- code: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(null=True, blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactive: BooleanField()
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
-
Methods:
URL Example: /api/1.0/costcenters/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Dispatch Action Components
-
Description:
- View DispatchActionComponent records. These can only be created via the add method.
-
URL:
- /api/1.0/dispatchactioncomponents/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- action: ForeignKey(Action, null=True, blank=True)
- actioncode: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- actiondescription: CharField(max_length=255)
- comment: CharField(max_length=1024)
- component: ForeignKey(Component, null=True, blank=True)
- componentcode: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- componentdescription: CharField(max_length=255)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- datecreated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- datelastupdated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- dispatch: ForeignKey(Dispatch, null=True, blank=True)
- dispatchnumber: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- dispatchtype: CharField(max_length=50)
- externalid: CharField(null=True, blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- itemnumber: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- percentoftime: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- site: ForeignKey(Site)
- timecreated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- timelastupdated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- why: ForeignKey(Why, null=True, blank=True)
- whycode: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- whydescription: CharField(max_length=255)
Dispatches
-
URL:
- /api/1.0/dispatches/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- area: ForeignKey(Area, null=True, blank=True)
- areacode: CharField(max_length=50)
- attachment_count: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- bookend1: CharField(null=True, blank=True, max_length=50)
- bookend2: CharField(null=True, blank=True, max_length=50)
- closed: DateTimeField()
- closedby: CharField(null=True, blank=True, max_length=150)
- completed: DateTimeField(null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- currentstatus: ForeignKey(Dispatch Status, null=True, blank=True, readonly=True) NOTE: This field is not useable.
- currentstatus_description: CharField(max_length=50, readonly=True)
- currentstatus_dispatchstatus_id: ForeignKey(Dispatch Status, null=True, blank=True, readonly=True) NOTE: This represents the id of the current dispatch status. Read the /dispatchstatuses/ api documentation for more information about statuses
- cycle_completed: BigIntegerField(null=True, blank=True) NOTE: values can range from -9223372036854775808 to 9223372036854775807
- cycle_due: BigIntegerField(null=True, blank=True) NOTE: values can range from -9223372036854775808 to 9223372036854775807
- deleted: CharField(null=True, blank=True, max_length=4)
- description: TextField()
- dispatched: DateTimeField(null=True, blank=True)
- dispatchnumber: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- dispatchtype: ForeignKey(Dispatch Type)
- dispatchtypecode: CharField(max_length=50)
- downtime: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- downtime_cost: DecimalField(max_digits=19, decimal_places=4)
- due: DateTimeField(null=True, blank=True)
- eventschedule: ForeignKey(Event Schedule, null=True, blank=True)
- eventschedulemachine: ForeignKey(Event Schedule Machine, null=True, blank=True)
- externalid: CharField(null=True, max_length=255)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(readonly=True)
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line: ForeignKey(Line, null=True, blank=True)
- lineabbreviation: CharField(max_length=50)
- linecode: CharField(max_length=50)
- machine: ForeignKey(Machine, null=True, blank=True)
- machinecode: CharField(max_length=50)
- machinecolor: CharField(null=True, blank=True, max_length=10)
- machinecount: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- machinedescription: CharField(max_length=255)
- machinefontcolor: CharField(null=True, blank=True, max_length=6)
- machinegroup: CharField(null=True, blank=True, max_length=50)
- machinegroupcount: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- notificationcount: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- open: CharField(max_length=1)
- parent_dispatch: ForeignKey(Dispatch, null=True, blank=True)
- parent_fives: ForeignKey(five s, null=True, blank=True)
- parent_kaizen: ForeignKey(Kaizen, null=True, blank=True)
- parent_sigevent: ForeignKey(Significant Event, null=True, blank=True)
- parent_yokoten: ForeignKey(Yokoten, null=True, blank=True)
- quarantined: CharField(max_length=4)
- reason: ForeignKey(Reasons, null=True, blank=True)
- reported: DateTimeField()
- scheduled: DateTimeField(null=True, blank=True)
- sigdowntime: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- site: ForeignKey(Site)
- started: DateTimeField()
- techniciancount: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- tooling: ForeignKey(Tooling, null=True, blank=True)
- toolingcode: CharField(null=True, blank=True, max_length=50)
- toolingdescription: CharField(null=True, blank=True, max_length=255)
- trade: ForeignKey(Trade, null=True)
- tradecode: CharField(null=True, blank=True, max_length=50)
- valuestream: CharField(max_length=50)
- valuestream: ForeignKey(Value Stream, null=True, blank=True)
- valuestreamcolor: CharField(max_length=6)
- wonumber: CharField(max_length=50, readonly=True) NOTE: The number of the work order that launched the dispatch
-
Methods:
URL Example: /api/1.0/dispatches/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
-
- add - /api/1.0/dispatches/add/
- add_actioncomponent - /api/1.0/dispatches/add_actioncomponent/
- add_comment - /api/1.0/dispatches/add_comment/
- add_external_cost - /api/1.0/dispatches/add_external_cost/
- attach_document - /api/1.0/dispatches/attach_document/
- changestatus - /api/1.0/dispatches/changestatus/
- changetype - /api/1.0/dispatches/changetype/
- close - /api/1.0/dispatches/close/
- complete - /api/1.0/dispatches/complete/
- current_assigned_resources - /api/1.0/dispatches/current_assigned_resources/
- current_dispatched_resources - /api/1.0/dispatches/current_dispatched_resources/
- delete - /api/1.0/dispatches/delete/
- get_core_lastupdated - /api/1.0/dispatches/get_core_lastupdated/
- get_event_data - /api/1.0/dispatches/get_event_data/
- get_notes - /api/1.0/dispatches/get_notes/
- get_reasons - /api/1.0/dispatches/get_reasons/
- open - /api/1.0/dispatches/open/
- open_followup - /api/1.0/dispatches/open_followup/
- set_description - /api/1.0/dispatches/set_description/
- set_externalid - /api/1.0/dispatches/set_externalid/
- set_reason - /api/1.0/dispatches/set_reason/
Dispatch Notes
-
Description:
- View Dispatch notes. Notes can only be created via the add method.
-
URL:
- /api/1.0/dispatchnotes/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- dispatch: ForeignKey(Dispatch)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
- text: TextField(null=True, blank=True)
-
Methods:
URL Example: /api/1.0/dispatchnotes/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Dispatch Statuses
-
Description:
- Read only interface to view DispatchStatus information. Note: To view system statuses use the get_system_statuses method for this api.
-
URL:
- /api/1.0/dispatchstatuses/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- color: CharField(null=True, blank=True, max_length=6)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=50)
- fontcolor: CharField(null=True, blank=True, max_length=6)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- inactive: BooleanField()
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site, null=True, blank=True)
-
Methods:
URL Example: /api/1.0/dispatchstatuses/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Dispatch Technicians
-
URL:
- /api/1.0/dispatchtechnicians/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- assigned: DateTimeField()
- assignedby: CharField(max_length=150)
- completed: DateTimeField(null=True, blank=True)
- dispatch: ForeignKey(Dispatch)
- dispatchnumber: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- externalid: CharField(null=True, blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- markedcompletedby: CharField(max_length=150)
- name: CharField(max_length=181)
- resourcecost: DecimalField(max_digits=19, decimal_places=4)
- resourcerate: DecimalField(null=True, blank=True, max_digits=19, decimal_places=4)
- site: ForeignKey(Site)
- technician: ForeignKey(Technician)
- technicianid: CharField(max_length=150)
- trade: ForeignKey(Trade, null=True, blank=True, readonly=True)
- tradecode: CharField(max_length=50, readonly=True)
- user: ForeignKey(User)
-
Methods:
URL Example: /api/1.0/dispatchtechnicians/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Dispatch Types
-
URL:
- /api/1.0/dispatchtypes/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- actioncomponentrequired: BooleanField()
- active: BooleanField()
- allowmultiple: BooleanField()
- cannotaddremovedocuments: BooleanField()
- code: CharField(max_length=50)
- color: CharField(null=True, blank=True, max_length=6)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- critical: CharField(max_length=4)
- description: CharField(max_length=255)
- dispatch_metric_rules: JSONField(null=True, blank=True)
- excludeproductiondashboard: BooleanField()
- fontcolor: CharField(null=True, blank=True, max_length=6)
- hidden_sections: ArrayField(null=True, blank=True)
- highlightcritical: BooleanField()
- id: AutoField( primary_key=True, blank=True, readonly=True)
- impact: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- inactivated: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- metricautodispatch: BooleanField(null=True)
- open: CharField(max_length=1)
- operatortype: CharField(null=True, blank=True, max_length=1)
- priority: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- reasonrequired: BooleanField()
- requirequalityfields: BooleanField()
- resourcerequired: BooleanField()
- site: ForeignKey(Site)
- startwhendispatched: BooleanField()
- usercreatetype: BooleanField()
- whyrequired: BooleanField()
Document Categories
-
URL:
- /api/1.0/documentcategories/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- checklist_postwork: ForeignKey(document, null=True, blank=True)
- checklist_prework: ForeignKey(document, null=True, blank=True)
- code: CharField(max_length=3)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- menu: BooleanField()
- name: CharField(max_length=50)
- production_standard_work: BooleanField()
- single_approver: BooleanField()
- site: ForeignKey(Site)
Event Answers
-
URL:
- /api/1.0/eventanswers/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- answer: TextField()
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- dispatch: ForeignKey(Dispatch)
- eventquestion: ForeignKey(Event Question, null=True, blank=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- question: TextField()
- site: ForeignKey(Site)
Event Questions
-
URL:
- /api/1.0/eventquestions/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- answer1: TextField(blank=True)
- answer2: TextField(blank=True)
- answer3: TextField(blank=True)
- answer4: TextField(blank=True)
- answer5: TextField(blank=True)
- ask_when: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- priority: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- question: TextField()
- site: ForeignKey(Site)
-
Methods:
URL Example: /api/1.0/eventquestions/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Event Schedules
-
URL:
- /api/1.0/eventschedule/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- bring_current_by_launch: BooleanField()
- category_ids: ArrayField(null=True, blank=True, readonly=True) NOTE: A list categories(ids) that the event schedule has set.
- comments: CharField(null=True, blank=True, max_length=1024)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- day: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- description: CharField(max_length=255)
- dispatchtype: ForeignKey(Dispatch Type)
- do_event_shadowing: BooleanField()
- during_production_only: BooleanField()
- exclude_weekends: BooleanField()
- externalid: CharField(null=True, blank=True, max_length=50)
- friday: BooleanField()
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- interval: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- intervaltype: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- is_tooling: BooleanField()
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- monday: BooleanField()
- saturday: BooleanField()
- scheduletype: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- shift: ForeignKey(Resource Shift, null=True, blank=True)
- site: ForeignKey(Site)
- sunday: BooleanField()
- suspended: BooleanField()
- suspendedby: CharField(null=True, blank=True, max_length=150)
- suspendedon: DateTimeField(null=True, blank=True)
- thursday: BooleanField()
- trade: ForeignKey(Trade)
- tuesday: BooleanField()
- wednesday: BooleanField()
-
Methods:
URL Example: /api/1.0/eventschedule/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Event Schedule Machines
-
URL:
- /api/1.0/eventschedulemachine/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- created: DateTimeField(readonly=True)
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- due: DateTimeField()
- eventschedule: ForeignKey(Event Schedule)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastcompleted: DateTimeField(null=True, blank=True)
- lastcyclecompleted: BigIntegerField(null=True, blank=True) NOTE: values can range from -9223372036854775808 to 9223372036854775807
- lastlaunched: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- launch: DateTimeField()
- launchprior: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- machine: ForeignKey(Machine)
- occurrencecount: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- open: BooleanField()
- resources: ArrayField(null=True, blank=True, readonly=True) NOTE: A list of resources on this event schedule
- scheduled: DateTimeField()
- scheduleprior: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- suspended: BooleanField()
- suspendedby: CharField(null=True, blank=True, max_length=150)
- suspendedon: DateTimeField(null=True, blank=True)
- tooling: ForeignKey(Tooling, null=True)
-
Methods:
URL Example: /api/1.0/eventschedulemachine/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
-
- get_line_schedule_info - /api/1.0/eventschedulemachine/get_line_schedule_info/
- get_machine_schedule_info - /api/1.0/eventschedulemachine/get_machine_schedule_info/
- get_next_scheduled_occurrence - /api/1.0/eventschedulemachine/get_next_scheduled_occurrence/
- get_scheduled_occurrences - /api/1.0/eventschedulemachine/get_scheduled_occurrences/
- resume - /api/1.0/eventschedulemachine/resume/
- suspend - /api/1.0/eventschedulemachine/suspend/
- update_schedule - /api/1.0/eventschedulemachine/update_schedule/
Event Schedule Machine Occurrences
-
URL:
- /api/1.0/eventschedulemachineoccurrence/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- completed: DateTimeField(null=True, blank=True)
- count: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- dispatch: ForeignKey(Dispatch, null=True, blank=True)
- due: DateTimeField(null=True, blank=True)
- estimated_hours: FloatField()
- eventschedulemachine: ForeignKey(Event Schedule Machine, null=True, blank=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- launch: DateTimeField()
- machine: ForeignKey(Machine)
- modified: BooleanField()
- occurrence_type: ForeignKey(Occurrence Type, null=True, blank=True)
- scheduled: DateTimeField()
- site: ForeignKey(Site)
-
Methods:
URL Example: /api/1.0/eventschedulemachineoccurrence/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Event Schedule Machine Resources
-
URL:
- /api/1.0/eventschedulemachineresource/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- estimate: FloatField(null=True, blank=True)
- eventschedulemachine: ForeignKey(Event Schedule Machine)
- eventscheduleoccurrencetype: ForeignKey(Event Schedule Occurrence Type, null=True, blank=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- scheduled_date: DateTimeField(null=True, blank=True)
- trade: ForeignKey(Trade, null=True, blank=True)
- user: ForeignKey(User, null=True, blank=True)
-
Methods:
URL Example: /api/1.0/eventschedulemachineresource/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Event Schedule Occurrence Types
-
URL:
- /api/1.0/eventscheduleoccurrencetype/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- estimated_hours: FloatField()
- eventschedule: ForeignKey(Event Schedule)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- kit_template: ForeignKey(Kit Template, null=True)
- launchprior: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- launchprior_type: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- occurrencetype: ForeignKey(Occurrence Type)
-
Methods:
URL Example: /api/1.0/eventscheduleoccurrencetype/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Kaizen Categories
-
URL:
- /api/1.0/kaizencategory/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- default: BooleanField()
- description: CharField(max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- menu: BooleanField()
- site: ForeignKey(Site)
Kaizen
-
URL:
- /api/1.0/kaizen/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- area_codes: ManyToManyField(Area) NOTE: Updating area_codes will replace any areas, lines and machines already assigned.
- area_externalids: ManyToManyField(Area) NOTE: Updating area_externalids will replace any areas, lines and machines already assigned.
- area_ids: ManyToManyField(Area) NOTE: Updating area_ids will replace any areas, lines and machines already assigned.
- attachment_count: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- category: ForeignKey(Kaizen Category)
- closed: BooleanField()
- closed_date: DateTimeField(null=True, blank=True)
- complete: BooleanField()
- complete_date: DateTimeField(null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- createdbyuser: ForeignKey(User, null=True, blank=True)
- description: CharField(max_length=50)
- details: TextField(null=True, blank=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- lastupdatedbyuser: ForeignKey(User, null=True, blank=True)
- line_codes: ManyToManyField(Line, blank=True) NOTE: Updating line_codes will replace any areas, lines and machines already assigned. Areas are ignored if lines are provided.
- line_externalids: ManyToManyField(Line, blank=True) NOTE: Updating line_externalids will replace any areas, lines and machines already assigned. Areas are ignored if lines are provided.
- line_ids: ManyToManyField(Line, blank=True) NOTE: Updating line_ids will replace any areas, lines and machines already assigned. Areas are ignored if lines are provided.
- machine_codes: ManyToManyField(Machine, blank=True) NOTE: Updating machine_codes will replace any areas, lines and machines already assigned. Lines and areas are ignored if machines are provided.
- machine_ids: ManyToManyField(Machine, blank=True) NOTE: Updating machine_ids will replace any areas, lines and machines already assigned. Lines and areas are ignored if machines are provided.
- number: CharField(max_length=50)
- owner: ForeignKey(User, null=True, blank=True)
- owner_assigned_date: DateTimeField(null=True, blank=True)
- priority: ForeignKey(Kaizen Priority)
- requestedby: CharField(max_length=50)
- site: ForeignKey(Site)
- status: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- status_date: DateTimeField(null=True)
-
Methods:
URL Example: /api/1.0/kaizen/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Lines
-
URL:
- /api/1.0/lines/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- abbreviation: CharField(max_length=50)
- active: BooleanField()
- area: ForeignKey(Area, null=True, blank=True)
- areacode: CharField(null=True, blank=True, max_length=50)
- code: CharField(max_length=50)
- color: CharField(null=True, blank=True, max_length=6)
- costcenter: ForeignKey(Cost Center, null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- datecreated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- dateinactivated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- dateupdated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- defaultmachine: ForeignKey(Machine, null=True, blank=True)
- description: CharField(max_length=255)
- downtime_rate: DecimalField(null=True, blank=True, max_digits=19, decimal_places=4)
- enable_auto_pitch_splits: BooleanField()
- enable_kaizen: BooleanField()
- enable_operators_by_name: BooleanField()
- enable_operators_skills: BooleanField()
- enable_pitchdetails_api: BooleanField()
- enable_product_orders: BooleanField()
- enable_production: BooleanField()
- enable_production_dispatches: BooleanField()
- enable_production_standard_work: BooleanField()
- enable_scrap_categories: BooleanField()
- enable_set_demand_on_changeover: BooleanField()
- enable_start_end_shift: BooleanField()
- enable_workorders: BooleanField()
- externalid: CharField(null=True, blank=True, max_length=50)
- fontcolor: CharField(null=True, blank=True, max_length=6)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- labor_efficiency_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- labor_efficiency_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- lhpu_green_yellow: DecimalField(max_digits=19, decimal_places=4)
- lhpu_yellow_red: DecimalField(max_digits=19, decimal_places=4)
- lmpu_green_yellow: DecimalField(max_digits=19, decimal_places=3)
- lmpu_yellow_red: DecimalField(max_digits=19, decimal_places=3)
- npm_green_yellow: DecimalField(max_digits=19, decimal_places=3)
- npm_yellow_red: DecimalField(max_digits=19, decimal_places=3)
- oa_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- oa_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- oee_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- oee_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- pace_date: DateField(null=True, blank=True)
- peff_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- peff_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- peff_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- peff_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- pitch_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- pitch_pace_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- pitch_pace_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- pitch_pace_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- pitch_pace_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- pitch_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- pitch_schedule_template: ForeignKey(Pitch Schedule Template, null=True, blank=True)
- pitch_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- pitch_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- pph_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- pph_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- pph_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- pph_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- ppp_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- ppp_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- production_order: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- scrap_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- scrap_qty_green_red: DecimalField(max_digits=19, decimal_places=2)
- scrap_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- site: ForeignKey(Site)
- skill_level_notify_threshold: ForeignKey(Skill Level, null=True, blank=True)
- teff_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- teff_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- timecreated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- timeupdated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- tpu_green_yellow: DecimalField(max_digits=19, decimal_places=3)
- tpu_yellow_red: DecimalField(max_digits=19, decimal_places=3)
- yield_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- yield_yellow_green: DecimalField(max_digits=19, decimal_places=2)
-
Methods:
URL Example: /api/1.0/lines/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Machine Locations
-
URL:
- /api/1.0/machineassociationhistory/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- associated: DateTimeField()
- id: AutoField( primary_key=True, blank=True, readonly=True)
- line: ForeignKey(Line)
- machine: ForeignKey(Machine)
- unassociated: DateTimeField(null=True, blank=True)
-
Methods:
URL Example: /api/1.0/machineassociationhistory/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Machine Groups
-
URL:
- /api/1.0/machinegroups/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- area: ForeignKey(Area)
- areacode: CharField(null=True, max_length=50)
- code: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=255)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line: ForeignKey(Line)
- linecode: CharField(null=True, max_length=50)
- site: ForeignKey(Site)
-
Methods:
URL Example: /api/1.0/machinegroups/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Machines
-
URL:
- /api/1.0/machines/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- alias: CharField(blank=True, max_length=20)
- area: ForeignKey(Area, null=True, blank=True)
- code: CharField(max_length=50)
- costcenter: ForeignKey(Cost Center, null=True, blank=True)
- costcentercode: CharField(null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- critical: CharField(blank=True, max_length=20)
- cyclecount: BigIntegerField(null=True, blank=True) NOTE: values can range from -9223372036854775808 to 9223372036854775807
- cyclecount_multiplier: FloatField()
- datecreated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- dateinactivated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- dateupdated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- deployed: DateField(null=True, blank=True)
- description: CharField(max_length=255)
- down_count: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line: ForeignKey(Line, null=True, blank=True)
- linecode: CharField(null=True, blank=True, max_length=50)
- machinegroupcode: CharField(null=True, blank=True, max_length=50)
- modelname: CharField(null=True, blank=True, max_length=50)
- nonproduction: BooleanField()
- noschedule: BooleanField()
- serialnumber: CharField(null=True, blank=True, max_length=50)
- shortdescription: CharField(max_length=12)
- sigdowntime: IntegerField(blank=True) NOTE: values can range from -2147483648 to 2147483647
- site: ForeignKey(Site)
- technology: ForeignKey(Technology, null=True, blank=True)
- technologycode: CharField(null=True, blank=True, max_length=50)
- timecreated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- timeupdated: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- valuestream: ForeignKey(Value Stream, null=True, blank=True)
- valuestreamcode: CharField(null=True, blank=True, max_length=50)
-
Methods:
URL Example: /api/1.0/machines/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Pages
-
Description:
- This API interface is READ ONLY.
-
URL:
- /api/1.0/pages/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- dispatch: ForeignKey(Dispatch, null=True, blank=True)
- dispatchnumber: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- errormessage: CharField(max_length=256)
- fields: TextField()
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastsent: DateTimeField()
- lastsent_utc: DateTimeField()
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- machine_up_sent: BooleanField()
- paging: ForeignKey(Notification, null=True, blank=True)
- sent: DateTimeField()
- sent_utc: DateTimeField()
- sentcount: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- site: ForeignKey(Site)
- subject: TextField()
- type: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- userinfo: CharField(max_length=1024)
-
Methods:
URL Example: /api/1.0/pages/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Page Messages
-
Description:
- This API interface is Deprecated and READ ONLY. Use the Pages API instead
-
URL:
- /api/1.0/pagemessages/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- id: AutoField( primary_key=True, blank=True, readonly=True)
- message: CharField(max_length=1024)
- page: ForeignKey(Page)
- sent: DateTimeField(blank=True) NOTE: value is in UTC
- site: ForeignKey(Site)
- subject: CharField(max_length=1024)
- user: ForeignKey(User)
-
Methods:
URL Example: /api/1.0/pagemessages/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Part Categories
-
URL:
- /api/1.0/partcategory/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- code: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- default: BooleanField()
- description: CharField(blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
Pitch Details
-
Description:
- Read only interface to view Pitch Details.
-
URL:
- /api/1.0/pitchdetails/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- actual: DecimalField(null=True, max_digits=19, decimal_places=2)
- build_sequence: ForeignKey(Build Sequence, null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- end: DateTimeField()
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line: ForeignKey(Line)
- operator_count: DecimalField(null=True, max_digits=19, decimal_places=2)
- pitch: ForeignKey(Pitch, null=True)
- product: ForeignKey(Products and Components, null=True)
- scrap: DecimalField(null=True, max_digits=19, decimal_places=2)
- site: ForeignKey(Site)
- start: DateTimeField()
-
Notes for Query API:
-
- Read queries for Pitch Details must be filtered by site and then both the line and end parameters, and one of product or start.
-
Methods:
URL Example: /api/1.0/pitchdetails/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Pitches
-
Description:
- This API interface is READ ONLY. To send production data to Dispatch, please use the PitchDetails record_details API call.
-
URL:
- /api/1.0/pitches/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- actual: DecimalField(null=True, max_digits=19, decimal_places=2)
- actual_product: ForeignKey(Products and Components, null=True)
- area: ForeignKey(Area)
- build_sequence: ForeignKey(Build Sequence, null=True, blank=True)
- changeover_earned_hours: DecimalField(max_digits=19, decimal_places=2)
- comment: CharField(null=True, blank=True, max_length=1024)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- cycle_time: DecimalField(null=True, max_digits=19, decimal_places=4)
- demand: DecimalField(max_digits=19, decimal_places=2)
- downtime_minutes: DecimalField(max_digits=19, decimal_places=2)
- earned_hours: DecimalField(max_digits=19, decimal_places=2)
- has_actual_details: BooleanField()
- has_operator_count_details: BooleanField()
- has_scrap_details: BooleanField()
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line: ForeignKey(Line)
- name: TextField(null=True, blank=True)
- nonproduction_minutes: DecimalField(max_digits=19, decimal_places=2)
- operational_availability: DecimalField(null=True, max_digits=19, decimal_places=2)
- operator_count: DecimalField(max_digits=19, decimal_places=2)
- overall_equipment_effectiveness: DecimalField(null=True, max_digits=19, decimal_places=2)
- pitch_end: DateTimeField()
- pitch_start: DateTimeField()
- planned_operator_count: DecimalField(max_digits=19, decimal_places=2)
- planned_product: ForeignKey(Products and Components, null=True)
- planned_production_minutes: DecimalField(max_digits=19, decimal_places=2)
- scrap: DecimalField(max_digits=19, decimal_places=2)
- shift: ForeignKey(Resource Shift)
- shift_start_date: DateTimeField()
- site: ForeignKey(Site)
-
Notes for Query API:
-
- Read queries for Pitches must be filtered by site and then at least one of the lastupdated/line/pitch_start/pitch_end/shift_start_date parameters.
-
Methods:
URL Example: /api/1.0/pitches/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
-
- load_from_template - /api/1.0/pitches/load_from_template/
- mostrecent - /api/1.0/pitches/mostrecent/
- set_active - /api/1.0/pitches/set_active/
- set_demand - /api/1.0/pitches/set_demand/
- set_demand_by_cycle_time - /api/1.0/pitches/set_demand_by_cycle_time/
- set_demand_by_product_order_queue - /api/1.0/pitches/set_demand_by_product_order_queue/
- set_planned_operator_count - /api/1.0/pitches/set_planned_operator_count/
Products and Components
-
Description:
- Read only interface to view Products/Components.
-
URL:
- /api/1.0/productcomponents/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- background_color: CharField(max_length=6)
- barcode_data: TextField(null=True, blank=True)
- barcode_format: CharField(null=True, blank=True, max_length=50)
- code: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- default_changeover_duration: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- description: CharField(max_length=255)
- externalid: CharField(null=True, blank=True, max_length=50)
- finished_product: BooleanField()
- font_color: CharField(max_length=6)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- preferred_changeover_order: DecimalField(max_digits=19, decimal_places=2)
- productcategory: ForeignKey(Product Category, null=True, blank=True)
- raw_material: BooleanField()
- site: ForeignKey(Site)
- subassembly: BooleanField()
-
Methods:
URL Example: /api/1.0/productcomponents/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Product Orders
-
Description:
- Read only interface to view Product Orders.
-
URL:
- /api/1.0/productorders/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- background_color: CharField(null=True, blank=True, max_length=6)
- barcode_data: TextField(null=True, blank=True)
- barcode_format: CharField(null=True, blank=True, max_length=50)
- built_quantity: DecimalField(null=True, blank=True, max_digits=19, decimal_places=2)
- completed: BooleanField()
- completed_date: DateTimeField(null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: TextField(null=True, blank=True)
- due_date: DateTimeField(null=True, blank=True)
- externalid: CharField(null=True, blank=True, max_length=50)
- font_color: CharField(null=True, blank=True, max_length=6)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- name: CharField(max_length=50)
- order_quantity: DecimalField(null=True, blank=True, max_digits=19, decimal_places=2)
- product: ForeignKey(Products and Components)
- schedule_date: DateTimeField(null=True, blank=True)
- scrap_quantity: DecimalField(null=True, blank=True, max_digits=19, decimal_places=2)
- site: ForeignKey(Site)
- start_date: DateTimeField(null=True, blank=True)
- status: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- status_date: DateTimeField(blank=True) NOTE: value is in UTC
-
Methods:
URL Example: /api/1.0/productorders/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Reasons
-
Description:
- Read only interface to view Reasons.
-
URL:
- /api/1.0/reasons/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- code: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=255)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
- site_default: BooleanField()
Resource Shifts
-
URL:
- /api/1.0/resourceshifts/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(null=True, blank=True, max_length=255)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- length: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- name: CharField(max_length=50)
- schedule: TextField()
- site: ForeignKey(Site)
- startdate: DateField()
-
Methods:
URL Example: /api/1.0/resourceshifts/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Scrap Categories
-
Description:
- This API interface is READ ONLY.
-
URL:
- /api/1.0/scrapcategory/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- code: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- name: CharField(max_length=50)
- rework: BooleanField()
- scrap_type: CharField(max_length=6)
- site: ForeignKey(Site)
Scrap Details
-
Description:
- This API interface is READ ONLY. To send scrap detail data to Dispatch, please use the Scrap Detail add_scrap_detail API call.
-
URL:
- /api/1.0/scrapdetail/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- category: ForeignKey(Scrap Category, null=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- end: DateTimeField(null=True, blank=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line: ForeignKey(Line, null=True)
- pitch: ForeignKey(Pitch)
- product: ForeignKey(Products and Components, null=True)
- scrap: DecimalField(null=True, max_digits=19, decimal_places=2)
- shift: ForeignKey(Resource Shift, null=True)
- site: ForeignKey(Site)
- start: DateTimeField(null=True, blank=True)
- ui_editable: NullBooleanField(null=True, blank=True)
-
Methods:
URL Example: /api/1.0/scrapdetail/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Sites
-
URL:
- /api/1.0/sites/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- address: CharField(null=True, blank=True, max_length=100)
- city: CharField(null=True, blank=True, max_length=50)
- country: CharField(null=True, blank=True, max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- currency_code: CharField(max_length=10)
- description: CharField(max_length=255)
- dispatcher_email: CharField(null=True, blank=True, max_length=256)
- dispatcher_phone: CharField(null=True, blank=True, max_length=50)
- externalid: CharField(null=True, blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- latitude: FloatField(null=True, blank=True)
- lmpu_green_yellow: DecimalField(max_digits=19, decimal_places=3)
- lmpu_yellow_red: DecimalField(max_digits=19, decimal_places=3)
- longitude: FloatField(null=True, blank=True)
- main_phone: CharField(null=True, blank=True, max_length=50)
- oa_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- oa_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- oee_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- oee_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- peff_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- peff_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- peff_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- peff_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- pph_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- pph_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- pph_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- pph_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- ppp_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- ppp_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- products_produced_description: CharField(null=True, blank=True, max_length=256)
- quality_server: ForeignKey(Server Trust, null=True, blank=True)
- scrap_green_yellow: DecimalField(max_digits=19, decimal_places=2)
- scrap_yellow_red: DecimalField(max_digits=19, decimal_places=2)
- server: ForeignKey(Server Trust, null=True, blank=True)
- site: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- state_province: CharField(null=True, blank=True, max_length=50)
- teff_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- teff_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- test_site: BooleanField()
- timezone: CharField(max_length=200)
- total_headcount: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- yield_red_yellow: DecimalField(max_digits=19, decimal_places=2)
- yield_yellow_green: DecimalField(max_digits=19, decimal_places=2)
- zip_postal_code: CharField(null=True, blank=True, max_length=50)
-
Methods:
URL Example: /api/1.0/sites/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Spares
-
URL:
- /api/1.0/spares/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- areacode: CharField(null=True, blank=True, max_length=50)
- bin_location: ForeignKey(Bin Location, null=True, blank=True)
- bomid: ForeignKey(Bill of Material)
- category: ForeignKey(Consumption Category)
- closed: BooleanField()
- comments: CharField(blank=True, max_length=256)
- cost: DecimalField(max_digits=19, decimal_places=4)
- costcenter: CharField(null=True, blank=True, max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(blank=True, max_length=1024)
- dispatch: ForeignKey(Dispatch, null=True, blank=True)
- dispatchnumber: PositiveIntegerField(null=True, blank=True)
- externalid: CharField(null=True, blank=True, max_length=50)
- hidden: BooleanField()
- id: AutoField( primary_key=True, blank=True, readonly=True)
- issued: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- linecode: CharField(null=True, blank=True, max_length=50)
- location: CharField(blank=True, max_length=50)
- machine: ForeignKey(Machine, null=True, blank=True)
- machinecode: CharField(null=True, blank=True, max_length=50)
- notify: BooleanField()
- partnumber: CharField(blank=True, max_length=100)
- quantity: DecimalField(max_digits=19, decimal_places=4)
- quantity_on_hand: DecimalField(null=True, blank=True, max_digits=19, decimal_places=4)
- requestedby: CharField(null=True, blank=True, max_length=150)
- site: ForeignKey(Site)
- status: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- synchronized_on: DateTimeField(null=True, blank=True)
- transaction_type: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- vendorpartnumber: CharField(blank=True, max_length=50)
- workorder: ForeignKey(Work Order, null=True, blank=True)
- workordernumber: CharField(null=True, blank=True, max_length=50)
-
Methods:
URL Example: /api/1.0/spares/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Technician Areas
-
URL:
- /api/1.0/technicianareas/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- areacode: CharField(max_length=50)
- assigned: DateTimeField()
- assignedby: CharField(max_length=150)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- site: ForeignKey(Site)
- technicianid: CharField(max_length=150)
- valuestream: CharField(max_length=50)
Technicians
-
Description:
- This API interface is READ ONLY.
-
URL:
- /api/1.0/technicians/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- areacode: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField()
- inactive: CharField(max_length=1)
- isassigned: BooleanField()
- lastassigned: DateTimeField()
- lastcompleted: DateTimeField()
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- name: CharField(max_length=181)
- site: ForeignKey(Site)
- technicianid: CharField(max_length=150)
- user: ForeignKey(User)
-
Methods:
URL Example: /api/1.0/technicians/
method_name
- /
id(optional)
- /?auth=
<API_Key>
Technologies
-
URL:
- /api/1.0/technologies/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- code: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=255)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- inactive: BooleanField()
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
Tooling
-
URL:
- /api/1.0/tooling/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- area: ForeignKey(Area, null=True, blank=True)
- category: ForeignKey(Tooling Category, null=True, blank=True)
- code: CharField(max_length=50)
- costcenter: ForeignKey(Cost Center, null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- currentstatus: ForeignKey(Tooling Status, null=True, blank=True)
- cyclecount: BigIntegerField() NOTE: values can range from -9223372036854775808 to 9223372036854775807
- cyclecount_multiplier: FloatField()
- deployed: DateField(null=True, blank=True)
- description: CharField(max_length=255)
- down_count: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- lastlocationchange: DateTimeField()
- lastlocationchangeby: CharField(null=True, blank=True, max_length=150)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line: ForeignKey(Line, null=True, blank=True)
- location: ForeignKey(Tooling Location, null=True, blank=True)
- machine: ForeignKey(Machine, null=True, blank=True)
- max_rebuilds: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- modelname: CharField(null=True, blank=True, max_length=50)
- nonproduction: BooleanField()
- note: TextField(null=True, blank=True)
- possible_machines_codes: ManyToManyField(Machine, blank=True, readonly=True)
- possible_machines_ids: ManyToManyField(Machine, blank=True, readonly=True)
- rebuildcount: IntegerField(null=True, blank=True) NOTE: values can range from -2147483648 to 2147483647
- serialnumber: CharField(null=True, blank=True, max_length=50)
- shortdescription: CharField(max_length=50)
- site: ForeignKey(Site)
- technology: ForeignKey(Technology, null=True, blank=True)
- valuestream: ForeignKey(Value Stream, null=True, blank=True)
-
Methods:
URL Example: /api/1.0/tooling/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Trades
-
URL:
- /api/1.0/trades/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- code: CharField(max_length=50)
- color: CharField(max_length=6)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- default: BooleanField()
- description: CharField(max_length=255)
- font_color: CharField(max_length=6)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- operatorinput: BooleanField()
- site: ForeignKey(Site)
Units of Measure
-
URL:
- /api/1.0/unitofmeasure/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- code: CharField(max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- precision: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- site: ForeignKey(Site)
Users
-
URL:
- /api/1.0/users/
-
Permissions:
-
- Read: True
- Create: False
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- displayinfo: CharField(null=True, blank=True, max_length=50)
- email: CharField(null=True, blank=True, max_length=254)
- externalid: CharField(null=True, blank=True, max_length=50)
- firstname: CharField(max_length=30)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- image: ForeignKey(User Image, null=True, blank=True)
- lastname: CharField(max_length=150)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- ldapconfig: ForeignKey(LDAP Config, null=True, blank=True)
- locksettings: BooleanField()
- loginid: CharField(max_length=150)
- phone: CharField(null=True, blank=True, max_length=50)
- preferred_language: CharField(null=True, blank=True, max_length=50)
- samlconfig: ForeignKey(SAML Config, null=True, blank=True)
- smsemail: CharField(null=True, blank=True, max_length=254)
- wechat: CharField(null=True, blank=True, max_length=50)
-
Methods:
URL Example: /api/1.0/users/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
-
- clock_in - /api/1.0/users/clock_in/
- clock_in_by_externalid - /api/1.0/users/clock_in_by_externalid/
- clock_out - /api/1.0/users/clock_out/
- clock_out_by_externalid - /api/1.0/users/clock_out_by_externalid/
- lastlogins - /api/1.0/users/lastlogins/
- reset_password - /api/1.0/users/reset_password/
- set_active - /api/1.0/users/set_active/
- set_availability - /api/1.0/users/set_availability/
- set_availability_by_externalid - /api/1.0/users/set_availability_by_externalid/
- set_externalid - /api/1.0/users/set_externalid/
- set_resource_site - /api/1.0/users/set_resource_site/
- update_device - /api/1.0/users/update_device/
User Sites
-
URL:
- /api/1.0/usersites/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- id: AutoField( primary_key=True, blank=True, readonly=True)
- l2lgroups: ArrayField(null=True, blank=True)
- resourcerate: ForeignKey(Resource Rate, null=True, blank=True)
- shift: ForeignKey(Resource Shift, null=True, blank=True)
- site: ForeignKey(Site)
- trade: ForeignKey(Trade, null=True, blank=True)
- user: ForeignKey(User)
- usergroup: ForeignKey(User Group, null=True, blank=True)
User Times
-
URL:
- /api/1.0/usertime/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- costcenter: ForeignKey(Cost Center, null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- end: DateTimeField(null=True, blank=True)
- fraction_allocated_per_line: FloatField(null=True, blank=True)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- line_ids: MultipleChoiceArrayField(null=True, blank=True)
- machine_ids: MultipleChoiceArrayField(null=True, blank=True)
- site: ForeignKey(Site)
- start: DateTimeField()
- user: ForeignKey(User)
Value Streams
-
URL:
- /api/1.0/valuestreams/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- code: CharField(max_length=50)
- color: CharField(max_length=6)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- description: CharField(max_length=255)
- fontcolor: CharField(null=True, blank=True, max_length=6)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- inactive: BooleanField()
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
Vendors
-
URL:
- /api/1.0/vendors/
-
Permissions:
-
- Read: True
- Create: True
- Update: True
-
Query Record Limit:
-
- 2000
-
Fields:
-
- accountnumber: CharField(null=True, blank=True, max_length=50)
- active: BooleanField()
- address1: CharField(null=True, blank=True, max_length=50)
- address2: CharField(null=True, blank=True, max_length=50)
- city: CharField(null=True, blank=True, max_length=50)
- code: CharField(null=True, blank=True, max_length=50)
- country: CharField(null=True, blank=True, max_length=50)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- email: CharField(null=True, blank=True, max_length=254)
- fax: CharField(null=True, blank=True, max_length=15)
- home_page: URLField(null=True, blank=True, max_length=200)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- name: CharField(max_length=1024)
- phone: CharField(null=True, blank=True, max_length=15)
- po_box: CharField(null=True, blank=True, max_length=50)
- site: ForeignKey(Site)
- state: CharField(null=True, blank=True, max_length=50)
- zip: CharField(null=True, blank=True, max_length=10)
Warehouses
-
Description:
- This API interface is READ ONLY.
-
URL:
- /api/1.0/warehouses/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- default: BooleanField()
- description: CharField(max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- site: ForeignKey(Site)
Work Order Categories
-
Description:
- This API interface is READ ONLY.
-
URL:
- /api/1.0/workordercategories/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- active: BooleanField()
- allow_machine_selection: BooleanField()
- allow_resource_selection: BooleanField()
- background_color: CharField(null=True, blank=True, max_length=6)
- code: CharField(max_length=10)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- dispatchtype: ForeignKey(Dispatch Type)
- fontcolor: CharField(null=True, blank=True, max_length=6)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- inactivated: DateTimeField(null=True, blank=True)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- menu: BooleanField()
- name: CharField(max_length=50)
- site: ForeignKey(Site)
Work Orders
-
Description:
- This API interface is READ ONLY.
-
URL:
- /api/1.0/workorders/
-
Permissions:
-
- Read: True
- Create: False
- Update: False
-
Query Record Limit:
-
- 2000
-
Fields:
-
- actual_hours: FloatField(null=True, blank=True)
- attachment_count: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- category: ForeignKey(Work Order Category)
- closed: BooleanField()
- closed_date: DateTimeField(null=True, blank=True)
- costcenter: ForeignKey(Cost Center, null=True, blank=True)
- created: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- createdby: CharField(null=True, blank=True, max_length=150, readonly=True)
- createdbyuser: ForeignKey(User, null=True, blank=True)
- description: CharField(max_length=50)
- dispatch: ForeignKey(Dispatch, null=True, blank=True)
- due_date: DateTimeField(null=True, blank=True)
- estimated_cost: DecimalField(null=True, max_digits=19, decimal_places=4)
- estimated_hours: FloatField(null=True, blank=True)
- external_cost: DecimalField(null=True, max_digits=19, decimal_places=4)
- externalid: CharField(null=True, blank=True, max_length=50)
- id: AutoField( primary_key=True, blank=True, readonly=True)
- instructions: TextField()
- labor_cost: DecimalField(null=True, max_digits=19, decimal_places=4)
- lastupdated: DateTimeField(blank=True, readonly=True) NOTE: value is in UTC
- lastupdatedby: CharField(null=True, blank=True, max_length=150, readonly=True)
- lastupdatedbyuser: ForeignKey(User, null=True, blank=True)
- launch_date: DateTimeField(null=True, blank=True)
- machine: ForeignKey(Machine)
- number: CharField(max_length=50)
- owner: ForeignKey(User, null=True, blank=True)
- owner_assigned_date: DateTimeField(null=True, blank=True)
- parent_dispatch: ForeignKey(Dispatch, null=True, blank=True)
- parent_fives: ForeignKey(five s, null=True, blank=True)
- parent_kaizen: ForeignKey(Kaizen, null=True, blank=True)
- parent_sigevent: ForeignKey(Significant Event, null=True, blank=True)
- parent_workorder: ForeignKey(Work Order, null=True, blank=True)
- priority: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- project_workorder: BooleanField()
- projectid: CharField(null=True, blank=True, max_length=50)
- requested_due_date: DateTimeField()
- requestedby: CharField(max_length=50)
- requestedby_phone: CharField(null=True, blank=True, max_length=50)
- scheduled_date: DateTimeField(null=True, blank=True)
- site: ForeignKey(Site)
- spares_cost: DecimalField(null=True, max_digits=19, decimal_places=4)
- spares_estimate: DecimalField(null=True, blank=True, max_digits=19, decimal_places=2)
- status: IntegerField() NOTE: values can range from -2147483648 to 2147483647
- status_date: DateTimeField(null=True)
- total_cost: DecimalField(null=True, max_digits=19, decimal_places=4)
- trade: ForeignKey(Trade)
-
Methods:
URL Example: /api/1.0/workorders/
method_name
- /
id(optional)
- /?auth=
<API_Key>
- &...
Detailed Method Documentation
- Area Method: get_area_warehouses
- Bill Of Materials Method: inbound_location_quantity_sync
- Bill Of Materials Method: inbound_sync
- Bill Of Materials Method: outbound_sync
- Bill Of Materials Method: synchronize
- Bill Of Materials Method: partimage
- CostCenter Method: add
- CostCenter Method: inactivate
- Dispatch Method: get_event_data
- Dispatch Method: current_assigned_resources
- Dispatch Method: current_dispatched_resources
- Dispatch Method: open
- Dispatch Method: open_followup
- Dispatch Method: changestatus
- Dispatch Method: changetype
- Dispatch Method: complete
- Dispatch Method: close
- Dispatch Method: add
- Dispatch Method: add_comment
- Dispatch Method: add_actioncomponent
- Dispatch Method: get_notes
- Dispatch Method: attach_document
- Dispatch Method: set_externalid
- Dispatch Method: set_description
- Dispatch Method: set_reason
- Dispatch Method: get_reasons
- Dispatch Note Method: add
- Dispatch Status Method: get_system_statuses
- Dispatch Technician Method: add
- Dispatch Technician Method: assign
- Dispatch Technician Method: dispatch
- Dispatch Technician Method: complete
- Documents Method: add
- Documents Method: modify
- Documents Method: list_bycategory
- Documents Method: viewinfo
- Event Schedule Method: get_schedules
- Event Schedule Machine Resource Method: add_resource
- Event Schedule Machine Resource Method: update_resource
- Event Schedule Machine Method: get_machine_schedule_info
- Event Schedule Machine Method: get_line_schedule_info
- Event Schedule Machine Method: resume
- Event Schedule Machine Method: suspend
- Event Schedule Machine Method: update_schedule
- Event Schedule Machine Occurrences Method: update_scheduled_occurrence
- Event Schedule Occurrence Type Method: get_resource_schedule
- Event Schedule Occurrence Type Method: set_resource_schedule
- Kaizen Method: add
- Kaizen Method: modify
- Machine Method: get_open_dispatches
- Machine Method: rename
- Machine Method: set_cycle_count
- Machine Method: increment_cycle_count
- Pages Method: get_pages
- Page Messages Method: get_messages
- Pitch Method: load_from_template
- Pitch Method: set_active
- Pitch Method: set_demand
- Pitch Method: set_demand_by_cycle_time
- Pitch Method: set_demand_by_product_order_queue
- Pitch Method: set_planned_operator_count
- Pitch Method: mostrecent
- Pitch Details Method: record_details
- Pitch Details Method: mostrecent
- Product Orders Method: sync_order
- Product Orders Method: sync_ekanban_order
- Product Order Build Sequence Method: complete_order
- Product Order Build Sequence Method: finish_change_over
- Product Order Build Sequence Method: get_current_order_on_line
- Product Order Build Sequence Method: put_order_on_hold
- Product Order Build Sequence Method: start_change_over
- Product Order Build Sequence Method: sync_order_details
- Scrap Detail Method: add_scrap_detail
- Spares Method: request_issue
- Spares Method: synchronize
- Spares Method: close
- Technicians Method: set_availability (Deprecated)
- Users Method: lastlogins
- Users Method: clock_in
- Users Method: clock_in_by_externalid
- Users Method: clock_out
- Users Method: clock_out_by_externalid
- Users Method: set_availability
- Users Method: set_availability_by_externalid
- Users Method: set_externalid
- WorkOrders Method: add_note
- WorkOrders Method: add_external_cost
- WorkOrders Method: get_external_costs
Area Method: get_area_warehouses
URL: https://company.leading2lean.com/api/1.0/areas/get_area_warehouses/id/?auth=<API_Key>
HTTP Method: GET
Functionality: Provides a way to retrieve all warehouses associated with an area.
Parameters:
- id (Required if no code is provided) - Specify the id of the area.
- auth (Required) - This is your authentication (API Key).
- site (Required) - Specify the site.
- code (Required if no id is provided) - Specify the area code.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - A list of warehouses including the primary and all secondary.
- error (Optional) - Error message if success is false.
Bill Of Materials Method: inbound_location_quantity_sync
URL: https://company.leading2lean.com/api/1.0/billofmaterials/inbound_location_quantity_sync/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a simple way to update location and part quantities.
Parameters:
- id (Required if no partnumber or site is provided) - Specify the id for the Bill Of Materials Part that you would like to update the location quantity for.
- auth (Required) - This is your authentication (API Key).
- site (Required) - Specify the site.
- partnumber(Required if now part id is provided) - Specify the part number.
- location (Required) - Specify the location code/description.
- quantity (Required) - Specify the new quantity.
- warehouse (Optional) - Specify the warehouse description for this location. If no warehouse is specified, the default warehouse will be used.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - The new quantity for the location.
- error (Optional) - Error message if success is false.
Bill Of Materials Method: inbound_sync
URL: https://company.leading2lean.com/api/1.0/billofmaterials/inbound_sync/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to update and create Bill Of Materials parts.
Parameters:
- auth (Required) - This is your authentication (API Key).
- id (Required if no partnumber or site is provided) - Specify the id for the Bill Of Materials Part that you would like to update the location quantity for.
- site (Required) - Specify the site.
- partnumber(Required if now part id is provided) - Specify the part number.
- description (Required) - Specify the part description.
- location (Required) - Specify the location code/description.
- quantity (Required) - Specify the new quantity.
- minimum (Required) - Specify the minimum on hand quantity.
- optimum (Required) - Specify the optimum on hand quantity.
- cost (Required) - Specify the part cost.
- warehouse (Optional) - Specify the warehouse description for this location. If no warehouse code is specified, the default warehouse will be used.
- synchronized (Optional) - Specifies if the part has been sychronized to an ERP system. Default=False.
- taxable (Optional) - Set True/False value for this property.
- critical (Optional) - Set True/False value for this property.
- obsolete (Optional) - Set True/False value for this property.
- active (Optional) - Set True/False value for this property.
- externalid (Optional) - External ID used to reference part from external systems.
- manufacturer (Optional) - Specify the part manufacturer.
- manufacturer_partnumber (Optional) - Specify the manufacturer part number.
- info (Optional) - Specify additional info regarding this part.
- unit_of_measure_code (Optional) - Specify unit of measure code
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - A representation of the Bill of Materials Part object.
- error (Optional) - Error message if success is false.
Bill Of Materials Method: outbound_sync
URL: https://company.leading2lean.com/api/1.0/billofmaterials/outbound_sync/id/?auth=<API_Key>
HTTP Method: GET
Functionality: Provides a method to retrieve parts with their synchronized value set to False.
Parameters:
- auth (Required) - This is your authentication (API Key).
- site (Required) - Specify the site.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - A list of part objects.
- error (Optional) - Error message if success is false.
Bill Of Materials Method: synchronize
URL: https://company.leading2lean.com/api/1.0/billofmaterials/synchronize/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a simple way to update location and part quantities.
Parameters:
- id (Required) - Specify the id for the Bill Of Materials Part that you would like to synchronize.
- synchronized (Required) - True/False value to set for this part.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Bill Of Materials Method:
URL: https://company.leading2lean.com/api/1.0/billofmaterials/bulk_image_set/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to bulk add external image URLs to a part (bill of material). Please note this value will override any currently uploaded images, and should only be used to set a reference to an image hosted elsewhere. This endpoint is not meant to sent an image file to.
Parameters:
- images (Required) - A JSON string containing an array of objects where each object contains the properties 'file' which is a URL of an image, and a 'part_id' (Bill of Material id). You can also use an 'external_id' and 'site_id' as well to specify the part (Bill of Material). Limit of 1000 max records per call.
Image Record Requirements
- file - A string that is a valid URL that uses https, and ends in .gif, .png, .jpg, .jpeg, .tif, or .tiff
- part_id (Required if both external_id and site_id not used) - A number containing the part_id (Bill of Material).
- external_id (Required if part_id not sent) - The external id set on the part (Bill of Material)
- site_id (Required if part_id not sent) - The site id set on the part (Bill of Material)
Examples of a valid image JSON string with 3 valid records:
[ { "part_id": 350, "file": "https://www.l2l.com/externalimage.jpg" }, { "part_id": 351, "file": "https://www.l2l.com/externalimage2.png" }, { "external_id": 150, "site_id": 1, "file": "https://www.l2l.com/externalimage3.jpeg"} ]
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success data will have the amount of records created, along with records that had validations issues and were not set due to missing fields, invalid parts for invalid part_id or external_id/site_id, and invalid urls that contains a list of invalid . See JSON example below:
{ "records_created": 10, "validation_errors": [ "invalid_parts": [ { "part_id": 350, "file": "https://www.l2l.com/externalimage.jpg" } ], "invalid_urls": [ { "part_id": 350, "file": "http://www.l2l.com/externalimage.bmp" } ], "missing_fields" [ { "part_id": 450 } ] ] }
In this example we sent a total of 13 records to be set via the API. The response indicated 10 of them were successfully created or updated, and returned the three records that failed. As an example the 'invalid_parts' record may have failed due to there not being a part (Bill of Material) with that id. The 'invalid_urls' record failed due to 2 reasons, first we require https. Second we don't allow .bmp files to be referenced. The 'missing_fields' record indicates you didn't include the required 'file' field.
- error (Optional) - Error message if success is false.
Build Sequences Method: complete_order
URL: https://company.leading2lean.com/api/1.0/buildsequence/complete_order/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a simple way complete an individual build sequence by providing the build sequence or specifing the current build sequence on a line by providing the line..
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code for the data
- linecode (Required if not providing line_externalid and not providing a build sequence) – Specify the line code for the line on which the order is being built
- line_externalid (Required if not providing linecode and not providing a build sequence) – Specify the line externalid for the line on which the order is being built
- id (Required if not providing build_sequence_externalid) – The id of the build sequence in the (provided in the URL)
- build_sequence_externalid (Required if not providing an id) – The externalid of the build sequence
- productcode (Optional) – The product code/sku/model number being produced. Used as a filter to ensure you are only affecting an order with this productcode. Defaults to null (disables the product code check).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual build sequence record.
- error (Optional) - Error message if success is false.
Build Sequences Method: finish_change_over
URL: https://company.leading2lean.com/api/1.0/buildsequence/finish_change_over/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a simple way to finish the change over for an individual build sequence by providing the build sequence or specifing the current build sequence on a line by providing the line.
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code for the data
- linecode (Required if not providing line_externalid and not providing a build sequence) – Specify the line code for the line on which the order is being built
- line_externalid (Required if not providing linecode and not providing a build sequence) – Specify the line externalid for the line on which the order is being built
- id (Required if not providing build_sequence_externalid) – The id of the build sequence in the (provided in the URL)
- build_sequence_externalid (Required if not providing an id) – The externalid of the build sequence
- productcode (Optional) – The product code/sku/model number being produced. Used as a filter to ensure you are only affecting an order with this productcode. Defaults to null (disables the product code check).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual build sequence record.
- error (Optional) - Error message if success is false.
Build Sequences Method: get_current_order_on_line
URL: https://company.leading2lean.com/api/1.0/buildsequence/get_current_order_on_line/?auth=<API_Key>
HTTP Method: GET
Functionality: Provides a simple way to get the current build sequence on a line.
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code for the data
- linecode (Required if not providing line_externalid) – Specify the line code for the line to get the current order
- line_externalid (Required if not providing linecode) – Specify the line externalid for the line to get the current order
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual build sequence record.
- error (Optional) - Error message if success is false.
Build Sequences Method: put_order_on_hold
URL: https://company.leading2lean.com/api/1.0/buildsequence/put_order_on_hold/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a simple way to put an individual build sequence on hold by providing the build sequence or specifing the current build sequence on a line by providing the line.
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code for the data
- linecode (Required if not providing line_externalid and not providing a line) – Specify the line code for the line on which the order is being built
- line_externalid (Required if not providing linecode) – Specify the line externalid for the line on which the order is being built
- id (Required if not providing build_sequence_externalid) – The id of the build sequence in the (provided in the URL)
- build_sequence_externalid (Required if not providing an id) – The externalid of the build sequence
- productcode (Optional) – The product code/sku/model number being produced. Used as a filter to ensure you are only affecting an order with this productcode. Defaults to null (disables the product code check).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual build sequence record.
- error (Optional) - Error message if success is false.
Build Sequences Method: start_change_over
URL: https://company.leading2lean.com/api/1.0/buildsequence/start_change_over/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a simple way to start a change over of an individual build sequence on a line.
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code for the data
- linecode (Required if not providing line_externalid and not providing a build sequence) – Specify the line code for the line on which the order is being built
- line_externalid (Required if not providing linecode and not providing a build sequence) – Specify the line externalid for the line on which the order is being built
- id (Required if not providing build_sequence_externalid and not providing a line) – The id of the build sequence in the (provided in the URL)
- build_sequence_externalid (Required if not providing an id and not providing a line) – The externalid of the build sequence
- productcode (Optional) – The product code/sku/model number being produced. Used as a filter to ensure you are only affecting an order with this productcode. Defaults to null (disables the product code check).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual build sequence record.
- error (Optional) - Error message if success is false.
CostCenter Method: add
URL: https://company.leading2lean.com/api/1.0/costcenters/add/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to create CostCenter objects.
Parameters: Note - The authenticating user must have access to the site the CostCenter is being created in.
- auth (Required) - This is your authentication (API Key).
- code (Required) - Specify the code for the new CostCenter.
- description (Optional) - Specify the description for the new CostCenter.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - A representation of the new CostCenter object.
CostCenter Method: inactivate
URL: https://company.leading2lean.com/api/1.0/costcenters/inactivate/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to inactivate an existing CostCenter. Note that only CostCenters not linked to active Lines, Machines, and Tooling objects can be inactivated.
Parameters: Note - The authenticating user must have access to the site the CostCenter exists in.
- auth (Required) - This is your authentication (API Key).
- code (Required) - Specify the code for the CostCenter to inactivate.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - A representation of the updated CostCenter object.
Dispatch Method: get_event_data
URL: https://company.leading2lean.com/api/1.0/dispatches/get_event_data/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to retrieve dispatch data.
Important - when syncronizing dispatch data, you must keep the parameters in your calls the same, otherwise the dispatch data will be incorrect. For example, if using the open, line_ids and dispatchtype_ids parameters, the lastupdated values only apply to that combination of parameters. Parameters:
- auth (Required) - This is your authentication (API Key).
- site (Required) - This is the site to get dispatches for.
- lastupdated (Required) - Timestamp in UTC to limit the dispatch search to only dispatches modified since the given value. Must be in this format: "%Y-%m-%d %H:%M:%S" Example: 2013-04-24 15:30:00. The check is done using >= logic, so results returned in previous results may still be returned in subsequent calls if the lastupdated call does not change and callers should take that into account
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- limit= (Optional) - Set the max number of results returned. Defaults to 2000, which is the maximum.
- areacode= (Optional) - Limit the search to dispatches for machines in the given area.
- line_ids= (Optional) - Limits the search to dispatches for machines in the given lines. The value must be a comma separated list of line id's.
- dispatchtype_ids= (Optional) - Limits the search to dispatches with the given dispatch types. The value must be a comma separated list of dispatch type id's.
- externalid= (Optional) - Return dispatches that have the given externalid.
- externalid_prefix= (Optional) - Return dispatches that have the given externalid prefix.
- open= (Optional) - Return dispatches that are either open (if 1 is specified) or closed (if 0 specified). If not specified, no filtering by open status is done.
- deleted= (Optional) - Return dispatches that are either deleted (if 1 is specified) or not deleted (if 0 specified). If not specified, no filtering by deleted status is done.
- reversed= (Optional) - Return dispatches in descending order by lastupdated if 1 is specified, otherwise ascending order is used.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, contains a list of individual dispatch records, sorted by lastupdated time in ascending order. The data will be list of objects formatted as follows:
{'data': [ { 'id': integer, 'dispatchnumber': integer, 'lineid': integer, 'linecode': string, 'lineabbreviation': string, 'areacode': string, 'machineid': integer, 'machinecode': string, 'machinedescription': string, 'technology': string, 'description': string, 'machinegroup': string, 'downtime': integer, 'open': 'T' or 'F', 'shiftreported': string, 'shiftcompleted': string, 'techniciancount': string, 'machinecount': integer, 'sigdowntime': integer, 'deleted': 'Y' or '', 'tradecode': string, 'valuestreamcode': string, 'externalid': string, 'created': datestring in UTC, 'lastupdated': datestring in UTC, 'createdby': string, 'lastupdatedby': string, 'reported': datestring in Site timezone, 'dispatched': datestring in Site timezone, 'completed': datestring in Site timezone, 'dispatchtype': string, 'reasoncode': string, 'technicians': [{'name': string, 'assigned': datestring in Site timezone, 'completed': datestring in Site timezone}], 'assigned_technicians': [{'loginid': 'string, 'name': string}], 'actioncomponents': [{'actiondescription': string, 'componentdescription': string}], 'currentstatus': { 'dispatchstatus_id': integer, 'dispatchstatus_description': string, }, 'external_costs': [{'id': int, 'cost': int, 'expense_date': datestring in Site timezone, 'name': string, 'vendor': int, 'category': int, 'description': string}] } ] }
- max_lastupdated - On success, is set to the max lastupdated value in the data list, and can be used to iterate through the whole dispatch data set.
- max_lastupdated_apiformat - Same as max_lastupdated, but formatted in the standard api date format as "%Y-%m-%d %H:%M:%s".
- error (Optional) - Error message if success is false.
Here's some sample python code that can be used as a framework to write code that processes new dispatches:
from datetime import datetime, timedelta import time import requests DATESTRING_FORMAT = "%Y-%m-%d %H:%M:%S" DISPATCHSTATUS_ID_NEW = -1 BASE_URL = 'TODO' # must be set to your dispatch server APIKEY = 'TODO' # must be set to your dispatch api key SITE = 'TODO' # must be set to the site numeric value for the site on the dispatch server code is running for PROCESS_DISPATCH_TYPES = [] # fill out with dispatchtype codes we want to process def run_poll_loop(): lastupdated = datetime.now() - timedelta(days=2) # starts getting dispatches from 2 days ago last_dispatch = None while True: resp = requests.get(BASE_URL + '/api/1.0/dispatches/get_event_data/', params={ "auth": APIKEY, "site": SITE, "lastupdated": lastupdated.strftime(DATESTRING_FORMAT) }) if resp.ok: payload = resp.json() data = payload['data'] for d in data: # skip it if we already saw it as the >= checks on lastupdated can result in us getting previous results if d['id'] == last_dispatch: continue if d['dispatchtype'] in PROCESS_DISPATCH_TYPES and d['currentstatus']['dispatchstatus_id'] == DISPATCHSTATUS_ID_NEW: # TODO: write logic for what to do here for new dispatches we are concerned about pass last_dispatch = d['id'] # grab the new lastupdated value to use in the next call, and add 1 second to avoid getting the same last result over and over lastupdated = datetime.strptime(payload['max_lastupdated_apiformat'], DATESTRING_FORMAT) time.sleep(60) # don't DOS the dispatch server please if __name__ == '__main__': run_poll_loop()
Dispatch Method: current_assigned_resources
URL: https://company.leading2lean.com/api/1.0/dispatches/current_assigned_resources/?auth=<API_Key>
HTTP Method: GET
Functionality: Provides a way to view the currently assigned resources for dispatches.
Parameters:
- site (Required) - This is the site to search in.
- auth (Required) - This is your authentication (API Key).
- ids (Optional) - A comma separated list of dispatch IDs (not dispatch numbers). If not specified, then the current set of uncompleted dispatches is returned.
- limit (Optional) - A limit to how many results to return when ids is not specified - defaults to 100 by default and cannot exceed 2000.
- lastupdated (Optional) - Specifies the lastupdated time to use to order results by (when ids is not specified). Must be formatted using the standard API format. This can be used when iterating over a large result set.
- reversed= (Optional) - Return dispatches in descending order by lastupdated if 1 is specified, otherwise ascending order is used.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns a json object in the following format:
{'success': <true|false>, 'data': [{ 'id': integer, 'dispatchnumber': integer, 'lastupdated': datestring, 'resources': [{ 'id': , 'loginid': , 'fullname': , }, ...] }, ...] 'max_lastupdated_apiformat': datestring, # in api format 'max_lastupdated': datestring, # in ISO8601 } </true|false>
- error (Optional) - Error message if success is false.
Dispatch Method: current_dispatched_resources
URL: https://company.leading2lean.com/api/1.0/dispatches/current_dispatched_resources/?auth=<API_Key>
HTTP Method: GET
Functionality: Provides a way to view the currently dispatched resources for dispatches.
Parameters:
- site (Required) - This is the site to search in.
- auth (Required) - This is your authentication (API Key).
- ids (Optional) - A comma separated list of dispatch IDs (not dispatch numbers). If not specified, then the current set of uncompleted dispatches is returned.
- limit (Optional) - A limit to how many results to return when ids is not specified - defaults to 100 by default and cannot exceed 2000.
- lastupdated (Optional) - Specifies the lastupdated time to use to order results by (when ids is not specified). Must be formatted using the standard API format. This can be used when iterating over a large result set.
- reversed (Optional) - Return dispatches in descending order by lastupdated if 1 is specified, otherwise ascending order is used.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns a json object in the following format:
{'success': bool, 'error': string, 'data': [{ 'id': integer, 'dispatchnumber': integer, 'lastupdated': datestring, 'resources': [{ 'id': string, # user id 'loginid': string, # user loginid 'fullname': string, # user firstname lastname 'assigned': datestring, # when the resource was dispatched }, ...] }, ...] }
- error (Optional) - Error message if success is false.
Dispatch Method: open
URL: https://company.leading2lean.com/api/1.0/dispatches/open/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to open a new dispatch.
Parameters:
- dispatchtypecode (Required if no dispatchtype id is provided) - Specify the dispatch type code that you want to create.
- dispatchtype (Required if no dispatchtypecode is provided) - Specify the dispatch type id that you want to create.
- description (Required) - This is the dispatch description. I.e. What is the problem, work order description, etc.
- machinecode (Required if no machine id is provided) - This is the machine code this dispatch is related to.
- machine (Required if no machinecode is provided) - This is the machine id this dispatch is related to.
- tradecode (Required if no trade id is provided) - This is the trade code this dispatch is related to.
- trade (Required if no tracecode is provided) - This is the trade id this dispatch is related to.
- user (Required) - This is the username of the user creating the dispatch.
- site (Required) - This is the site this dispatch is related to.
- auth (Required) - This is your authentication (API Key).
- trade_required (Optional) - If thise is set to true, we will validate that the trade supplied is valid and return an error if not. If this parameter is not supplied or set to false, we will attempt to use the provided trade and fall back to the default trade if it is invalid.
- reason_id (Optional) - This is the reason id this dispatch is related to.
- document_externalid (Optional) - This is the externalid value of an existing document in Document Center.
- assigned_users (Optional) - This is a comma delimited list of usernames of the users you want assigned to this dispatch. For example: assigned_users=khill,jseaton
- due (Optional) – The due date of the dispatch in this format: "%Y-%m-%d %H:%M" Example: 2013-04-24 15:30. Must be in the site's timezone.
- reported (Optional) – The reported date of the dispatch in one of these two formats: "%Y-%m-%d %H:%M:%S" or "%Y-%m-%d %H:%M" Examples: 2013-04-24 15:30:00 or 2013-04-24 15:30. If not specified then the current site time is used. If specified, it must be in the site's timezone.
- parent_dispatch_id (Optional) – The id of a dispatch to set as the parent dispatch.
- last_part_run (Optional) - This is the last part run value to be associated with the dispatch.
- material_quarantined (Optional) - This is the material quarantined value to be associated with the dispatch. Possible values are 'N' and 'Y'.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record created.
- error (Optional) - Error message if success is false.
Dispatch Method: changestatus
URL: https://company.leading2lean.com/api/1.0/dispatches/changestatus/<id>/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to change the status of a dispatch.
Parameters: Note - The dispatch id (not the dispatchnumber) must be specified in the path. The authenticating user must have access to the site the dispatch was created in.
- auth (Required) - This is your authentication (API Key).
- dispatchstatus_id (Required) - Specify the dispatchstatus id code that you want to change to.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
Dispatch Method: changetype
URL: https://company.leading2lean.com/api/1.0/dispatches/changetype/<id>/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to change the status of a dispatch.
Parameters: Note - The dispatch id (not the dispatchnumber) must be specified in the path. The authenticating user must have access to the site the dispatch was created in.
The Dispatch Type id's can be obtained from the /api/1.0/dispatchtypes/ endpoint.
- auth (Required) - This is your authentication (API Key).
- dispatchtype_id (Required) - Specify the dispatch type id that you want to change to (not the code).
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
Dispatch Method: open_followup
URL: https://company.leading2lean.com/api/1.0/dispatches/open_followup/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to create a followup dispatch to an existing dispatch.
Parameters:
- id (Required) - Specify the id for the dispatch you want to create a followup dispatch for. The new follow up dispatch will be created with the same machine and trade as the parent dispatch, and the new description will reference the parent dispatch. (Must be specified in the url path)
- auth (Required) - This is your authentication (API Key).
- site (Required) - Specify the site that the dispatch is in.
- dispatchtypecode (Optional) - Specify the dispatch type code that you want to create. If not set, it defaults to the parent dispatch's dispatchtype.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record created.
- error (Optional) - Error message if success is false.
Dispatch Method: complete
URL: https://company.leading2lean.com/api/1.0/dispatches/complete/id/?auth=<API_Key>
HTTP Method: GET or POST
Functionality: Provides a way to complete a dispatch.
Parameters:
- id (Required) - Specify the id for the dispatch you want to close.
- auth (Required) - This is your authentication (API Key).
- note (Optional) - If specified, a Dispatch Note will be created with this text. This is meant to be used with workflows that add a note when completing the dispatch.
- completed (Optional) - If specified, this value will be used as the completed date for the dispatch, otherwise the site's current time is used. Must be specified in this format: "%Y-%m-%d %H:%M:%S" for a time in the dispatch's site's timezone.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record specified by the id parameter above.
- error (Optional) - Error message if success is false.
Dispatch Method: close
URL: https://company.leading2lean.com/api/1.0/dispatches/close/id/?auth=<API_Key>
HTTP Method: GET or POST
Functionality: Provides a way to close a dispatch.
Parameters:
- id (Required) - Specify the id (NOT the dispatch number) for the dispatch you want to close in the URL path.
- auth (Required) - This is your authentication (API Key).
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record specified by the id parameter above.
- error (Optional) - Error message if success is false.
Dispatch Method: add
URL: https://company.leading2lean.com/api/1.0/dispatches/add/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Add a completed dispatch. This is useful for adding history or syncing events from another system. (Use the open method to create a new dispatch)
Parameters:
- auth (Required) - This is your authentication (API Key).
- dispatchtypecode (Required) - Specify the dispatch type code for the dispatch.
- description (Required) - This is the dispatch description. I.e. What is the problem, work order description, etc.
- machinecode (Required) - This is the machine this dispatch is related to.
- tradecode (Required) - This is the trade this dispatch is related to.
- resource (Required) - This is the resource id that worked on this dispatch, or can be a comma separated list of resource id's.
- site (Required) - This is the site this dispatch is related to.
- actioncode (Optional) - This is the code for the action the resource completed on this dispatch.
- componentcode (Optional) - This is the code for the component associated with the actioncode above.
- comment (Optional) - This is the comment associated with the action and component codes above.
- reasoncode (Optional) - This is the reason code for the dispatch.
- reported (Optional) – The reported date of the dispatch in this format: "%Y-%m-%d %H:%M" Example: 2013-04-24 15:30. If not specified, defaults to now.
- completed (Optional) – The completed date of the dispatch in this format: "%Y-%m-%d %H:%M" Example: 2013-04-24 15:30. If not specified, defaults to the reported time.
- externalid (Optional) - This is the externalid for this dispatch (usually an id from an external system used for cross referencing).
- document_externalid (Optional) - This is the externalid value of an existing document in Document Center you want to attach to this dispatch.
- parent_dispatch_id (Optional) - If specified, this is the id for a parent dispatch the new dispatch is a followup for.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the newly created dispatch record.
- error (Optional) - Error message if success is false.
Dispatch Method: add_comment
URL: https://company.leading2lean.com/api/1.0/dispatches/add_comment/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to add a comment to a dispatch description.
Parameters:
- id (Required) - Specify the id for the dispatch you want to update.
- auth (Required) - This is your authentication (API Key).
- comment (Required) - This is the comment you want to append to the dispatch description.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record specified by the id parameter above.
- error (Optional) - Error message if success is false.
Dispatch Method: add_external_cost
URL: https://company.leading2lean.com/api/1.0/dispatches/add_external_cost/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to add an external cost to a dispatch.
Parameters:
- id (Required) - Specify the id for the dispatch you want to update.
- auth (Required) - This is your authentication (API Key).
- expense_date (Required) - This is the expense date for the external cost.
- description (Required) - This is the description for the external cost.
- name (Required) - This is the name of the external cost.
- vendor (Required) - This is the id for the vendor of the external cost.
- category (Optional) - This is the id of the external cost category.
- cost (Required) - This is the cost.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual external cost record that was added to the Dispatch.
- error (Optional) - Error message if success is false.
Dispatch Method: add_actioncomponent
URL: https://company.leading2lean.com/api/1.0/dispatches/add_actioncomponent/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to add an Action/Component record to a dispatch.
Parameters:
- auth (Required) - This is your authentication (API Key).
- id (Required or dispatchnumber/site) - Specify the id for the dispatch you want to update.
- dispatchnumber (Required if not using id) - Specify the dispatchnumber for the dispatch you want to update.
- site (Required if using dispatchnumber) - Specify the site for the dispatch you want to update.
- actioncode (Required) - The Action code for the action in the dispatch site.
- componentcode (Required) - The Component code for the action in the dispatch site.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- comment (Optional) - Specify a comment for the Action/Component record.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record specified by the id parameter above.
- error (Optional) - Error message if success is false.
Dispatch Method: get_notes
URL: https://company.leading2lean.com/api/1.0/dispatches/get_notes/id/?auth=<API_Key>
HTTP Method: GET
Functionality: Provides a way to get the notes attached to a dispatch.
Parameters:
- auth (Required) - This is your authentication (API Key).
- id (Required) - Specify the id for the dispatch you want to add a note for (may be in the url path or a POST parameter).
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Set to either true or false.
- data - On success, set to a list of note objects attached to the requested dispatch.
- error (Optional) - Error message if success is false.
Dispatch Method: attach_document
URL: https://company.leading2lean.com/api/1.0/dispatches/attach_document/id/?auth=<API_Key>
HTTP Method: POST
Parameters:
- id (Required) - Specify the id for the dispatch you want to modify.
- auth (Required) - This is your authentication (API Key).
- document_externalid (Optional) - This is the externalid value of an existing document in Document Center.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record specified by the id parameter above.
- error (Optional) - Error message if success is false.
Dispatch Method: set_externalid
URL: https://company.leading2lean.com/api/1.0/dispatches/set_externalid/id/?auth=<API_Key>
HTTP Method: POST
Parameters:
- id (Required) - Specify the id for the dispatch you want to modify.
- auth (Required) - This is your authentication (API Key).
- externalid (Optional) - This is the externalid you want to set on the dispatch record. If not specified, then the existing externalid value is set to null.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record specified by the id parameter above.
- error (Optional) - Error message if success is false.
Dispatch Method: set_description
URL: https://company.leading2lean.com/api/1.0/dispatches/set_description/id/?auth=<API_Key>
HTTP Method: POST
Parameters:
- id (Required) - Specify the id for the dispatch you want to modify.
- auth (Required) - This is your authentication (API Key).
- description (Required) - This is the description you want to set on the dispatch record.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record specified by the id parameter above.
- error (Optional) - Error message if success is false.
Dispatch Method: set_reason
URL: https://company.leading2lean.com/api/1.0/dispatches/set_reason/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Set the dispatch reason.
Parameters:
- id (Required) - Specify the id for the dispatch you want to modify.
- auth (Required) - This is your authentication (API Key).
- reason (Optional) - This is the code for the reason to set on the dispatch record. If not specified or set to an empty string, the reason is set to null.
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record specified by the id parameter above.
- error (Optional) - Error message if success is false.
Dispatch Method: get_reasons
URL: https://company.leading2lean.com/api/1.0/dispatches/get_reasons/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Lookup the possible reasons for a given dispatch.
Parameters:
- id (Required) - Specify the id for the dispatch you want to lookup the reasons for.
- auth (Required) - This is your authentication (API Key).
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns a list of reasons that are valid for the given dispatch.
- error (Optional) - Error message if success is false.
Dispatch Note Method: add
URL: https://company.leading2lean.com/api/1.0/dispatchnotes/add/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to add a note to a dispatch.
Parameters:
- auth (Required) - This is your authentication (API Key).
- dispatch_id (Required) - Specify the id for the dispatch you want to add a note for (must be a POST parameter).
- note (Required) - This is the note text you want to add as a Dispatch Note (must be a POST parameter).
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch note record created.
- error (Optional) - Error message if success is false.
Dispatch Status Method: get_system_statuses
URL: https://company.leading2lean.com/api/1.0/dispatchstatuses/get_system_statuses/?auth=<API_Key>
HTTP Method: GET
Functionality: Provides a way to get system statuses. Note: The id will be negative, and there is no site associated with system statuses as they are shared by all sites.
Parameters:
- auth (Required) - This is your authentication (API Key).
- Optional Query Parameter (Optional) - Add key/value query parameter to the end of the url.
- format=xml (Optional) - returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the system's disptach statuses.
- error (Optional) - Error message if success is false.
Dispatch Technician Method: add
URL: https://company.leading2lean.com/api/1.0/dispatchtechnicians/add/?auth=<API_Key>
HTTP Method: POST
Parameters:
- site (Required) - This is the site this Resource/Technician is related to.
- auth (Required) - This is your authentication (API Key).
- dispatch_id (Required) - This is the id of the dispatch this Resource/Technician record is being added to.
- user_id (Required if technician_code is not provided, otherwise Optional) - This is the Resource/Technician user id.
- technician_code (Required if user_id is not provided, otherwise Optional) - This is the Resource/Technician code.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Dispatch Technician Method: assign
URL: https://company.leading2lean.com/api/1.0/dispatchtechnicians/assign/?auth=<API_Key>
HTTP Method: POST
Parameters:
- site (Required) - This is the site this Resource/Technician is related to.
- auth (Required) - This is your authentication (API Key).
- dispatch_id (Required) - This is the id of the dispatch this Resource/Technician record is being added to.
- user_id (Required if technician_code is not provided, otherwise Optional) - This is the Resource/Technician user id.
- technician_code (Required if user_id is not provided, otherwise Optional) - This is the Resource/Technician code.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Dispatch Technician Method: dispatch
URL: https://company.leading2lean.com/api/1.0/dispatchtechnicians/dispatch/?auth=<API_Key>
HTTP Method: POST
Parameters:
- site (Required) - This is the site this Resource/Technician is related to.
- auth (Required) - This is your authentication (API Key).
- dispatch_id (Required) - This is the id of the dispatch this Resource/Technician record is being added to.
- technician_code (Required) - This is the Resource/Technician code.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatchtechnician record created.
- error (Optional) - Error message if success is false.
Dispatch Technician Method: complete
URL: https://company.leading2lean.com/api/1.0/dispatchtechnicians/complete/id/?auth=<API_Key>
HTTP Method: POST
Parameters:
- id (Required)This is passed in the url.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual dispatch record created.
- error (Optional) - Error message if success is false.
Documents Method: add
URL: https://company.leading2lean.com/api/1.0/documents/add/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to create a new active Document and it's initial revision.
Parameters:
- site (Required) - Specifies the site the document will be in.
- name (Required) - Specifies the name of the document.
- description (Required) - Specifies the description of the document.
- externalid (Optional) - Specify a external id for the document.
- externalid_unique (Optional) - If 1, then the externalid will be checked for uniqueness and the api call will fail if another document already has that externalid. Defaults to 0, where externalid is not checked for uniqueness.
- revision_type (Required) - Specifies what type of document revision to create. Currently only 'url' and 'file' are supported.
- url (Required for url revision_type) - URL that the document points to.
- filename (Required for file revision_type) - file that will be uploaded into Dispatch for the document revision.
- revision (Optional) - Allows the caller to specify the initial revision number, defaults to 1 if not specified.
- external_master (Optional) - If 1, then the document will be set as managed by an external system and no UI changes should be allowed.
- publish (Optional) - If 1, then the document's initial revision will be published. Defaults to 0.
- params_use_codes (Optional) - Specifies whether codes or id's are used for all subsequent parameters - specify 1 when using id's and 0 for codes (defaults to 0 and uses id's by default).
- category (Required) - Specifies the document category for the document.
- link_areas (Optional) - Link any dispatch in the given areas to this document via the Documents button.
- link_lines (Optional) - Link any dispatch in the given lines to this document via the Documents button.
- link_machines (Optional) - Link any dispatch for the given machines to this document via the Documents button.
- link_technologies (Optional) - Link any dispatch associated with the given technologies to this document via the Documents button.
- attach_logic (Optional) - Specify the logic to use when determining whether to attach this document to new dispatches. Must be 'and' or 'or' - defaults to 'or'.
- attach_areas (Optional) - Specify list of areas to use in attachment logic.
- attach_lines (Optional) - Specify list of lines to use in attachment logic.
- attach_machines (Optional) - Specify list of machines to use in attachment logic.
- attach_technologies (Optional) - Specify list of technologies to use in attachment logic.
- attach_dispatchtypes (Optional) - Specify list of dispatchtypes to use in attachment logic.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the document record.
- file_upload_url - On successful creation of a file revision, this is a URL that can be used with an HTTP PUT to upload the document. The API caller is responsible for uploading the file, and the returned url is good for 10 minutes. If the document is not uploaded the Document Revision will point to invalid file location.
- error (Optional) - Error message if success is false.
Documents Method: modify
URL: https://company.leading2lean.com/api/1.0/documents/modify/<id>/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to update an existing Document and optionally publish a new revision. Only documents that use URL's are supported at this time.
Parameters:
- id (Optional) - Specifies the id of the document in the path. If not specified, then externalid will be used for the lookup.
- externalid (Optional) - Specifies the document's externalid. If id is not specified this is used for the document lookup. If id is specified, the externalid can be changed (but should not be if it's being used to uniquely identify documents).
- site (Required) - Specifies the site the document is in.
- change-description (Required) - Specifies a short description for the change being made.
- name (Optional) - Specifies an updated name for the document.
- description (Optional) - Specifies an updated description for the document.
- active (Optional) - Allows you to inactivate a document with an updated value of 0, or activate a document with an updated value of 1.
- revision_type (Required if publishing new revision) - Specifies what type of document revision to create. Currently 'url' and 'file' are supported.
- url (Optional for url revision_type) - Specifies an updated URL that the document points to. If this is changed from the previous revision then a new revision of the document is published.
- filename (Optional for file revision_type) - Specifies an updated file that the document points to. If this parameter is set then a new revision of the document is published.
- revision (Optional) - Allows the caller to specify the new revision number. If not specified and a new revision is published, standard revision incrementing logic will be used.
- external_master (Optional) - If 1, then the document will be set as managed by an external system and no UI changes should be allowed.
- publish (Optional) - If 1, then the new revision will be published. Defaults to 0.
- params_use_codes (Optional) - Specifies whether codes or id's are used for all subsequent parameters - specify 1 when using id's and 0 for codes (defaults to 0 and uses id's by default).
- category (Optional) - Specifies an updated document category for the document.
- link_areas (Optional) - Update the areas used for linking to dispatches via the Documents button. NOTE - this replaces the existing links with the new list of areas.
- link_lines (Optional) - Update the lines used for linking to dispatches via the Documents button. NOTE - this replaces the existing links with the new list of lines.
- link_machines (Optional) - Update the machines used for linking to dispatches via the Documents button. Note - this replaces the existing links with the new list of machines.
- link_technologies (Optional) - Update the technologies used for linking to dispatches via the Documents button. NOTE - this replaces the existing technologies with the new list of technologies.
- attach_logic (Optional) - Specify the logic to use when determining whether to attach this document to new dispatches. Must be 'and' or 'or - defaults to 'or'.
- attach_areas (Optional) - Specify list of areas to use in attachment logic. NOTE - if specified this replaces the existing values.
- attach_lines (Optional) - Specify list of lines to use in attachment logic. NOTE - if specified this replaces the existing values.
- attach_machines (Optional) - Specify list of machines to use in attachment logic. NOTE - if specified this replaces the existing values.
- attach_technologies (Optional) - Specify list of technologies to use in attachment logic. NOTE - if specified this replaces the existing values.
- attach_dispatchtypes (Optional) - Specify list of dispatchtypes to use in attachment logic. NOTE - if specified this replaces the existing values.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the document record.
- file_upload_url - On successful creation of a file revision, this is a URL that can be used with an HTTP PUT to upload the document. The API caller is responsible for uploading the file, and the returned url is good for 10 minutes. If the document is not uploaded the Document Revision will point to invalid file location.
- error (Optional) - Error message if success is false.
Documents Method: list_bycategory
URL: https://company.leading2lean.com/api/1.0/documents/list_bycategory/?auth=<API_Key>
HTTP Method: GET
Functionality: Retrieve a list of file and link Documents filtered by Document Categories.
Parameters:
- site (Required) - Specifies the site to search for documents.
- limit (Optional) - Specifies a limit on the number of results returned. Defaults to the document category to filter by.
- q (Optional) - Specifies a search query to filter the Documents by name.
- params_use_codes (Optional) - Specifies whether codes or id's are used for all subsequent parameters - specify 1 when using id's and 0 for codes (defaults to 0 and uses id's by default).
- category (Required) - Specifies the document category to filter by.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the list of document records.
- error (Optional) - Error message if success is false.
Documents Method: viewinfo
URL: https://company.leading2lean.com/api/1.0/documents/viewinfo/<id>/?auth=<API_Key>
HTTP Method: GET
Functionality: Retrieve the information needed to view file and link Documents
Parameters:
- site (Required) - Specifies the site the document is in.
- revision (Optional) - Specifies the revision of the document - defaults to the current revision if not specified.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - The collection of data that can be used to view the document.
- error (Optional) - Error message if success is false.
Kaizen Method: add
URL: https://company.leading2lean.com/api/1.0/kaizen/add/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to add a new Kaizen.
Parameters:
- site (Required) - Specifies the site the kaizen is in.
- description (Required) - Specifies the description for the kaizen.
- details (Optional) - Specifies the details of the kaizen.
- submittedby_id (Optional) - Specifies a user id for the submitted by field of the kaizen. If submittedby_id and submittedby_username is not provided, the submitted by value will be set to the current user.
- submittedby_username (Optional) - Specifies a username for the submitted by field of the kaizen. If submittedby_id and submittedby_username is not provided, the submitted by value will be set to the current user.
- category (Optional) - Specifies the kaizen category for the kaizen. The default category will be used if one is not provided.
- priority (Optional) - Specifies the kaizen priority for the kaizen. The default priority will be used if one is not provided.
- area_ids (Optional) - Specifies the area ids for the kaizen.
- area_codes (Optional) - Specifies the area codes for the kaizen.
- area_externalids (Optional) - Specifies the area external ids for the kaizen.
- line_ids (Optional) - Specifies the line ids for the kaizen. Areas are ignored if lines are provided.
- line_codes (Optional) - Specifies the line codes for the kaizen. Areas are ignored if lines are provided.
- line_externalids (Optional) - Specifies the line external ids for the kaizen. Areas are ignored if lines are provided.
- machine_ids (Optional) - Specifies the machine ids for the kaizen. Lines and areas are ignored if machines are provided.
- machine_codes (Optional) - Specifies the machine codes for the kaizen. Lines and areas are ignored if machines are provided.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the kaizen record.
- error (Optional) - Error message if success is false.
Kaizen Method: modify
URL: https://company.leading2lean.com/api/1.0/kaizen/modify/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to update a Kaizen.
Parameters:
- id (Required) - Specifies the id of the kaizen to update.
- description (Optional) - Specifies the description for the kaizen.
- details (Optional) - Specifies the details of the kaizen.
- submittedby_id (Optional) - Specifies a user id for the submitted by field of the kaizen. If submittedby_id and submittedby_username is not provided, the submitted by value will be set to the current user.
- submittedby_username (Optional) - Specifies a username for the submitted by field of the kaizen. If submittedby_id and submittedby_username is not provided, the submitted by value will be set to the current user.
- category (Optional) - Specifies the kaizen category for the kaizen. The default category will be used if one is not provided.
- priority (Optional) - Specifies the kaizen priority for the kaizen. The default priority will be used if one is not provided.
- area_ids (Optional) - Specifies the area ids for the kaizen. Updating area_ids will replace any areas, lines and machines already assigned.
- area_codes (Optional) - Specifies the area codes for the kaizen. Updating area_codes will replace any areas, lines and machines already assigned.
- area_externalids (Optional) - Specifies the area external ids for the kaizen. Updating area_externalids will replace any areas, lines and machines already assigned.
- line_ids (Optional) - Specifies the line ids for the kaizen. Updating line_ids will replace any areas, lines and machines already assigned. Areas are ignored if lines are provided.
- line_codes (Optional) - Specifies the line codes for the kaizen. Updating line_codes will replace any areas, lines and machines already assigned. Areas are ignored if lines are provided.
- line_externalids (Optional) - Specifies the line external ids for the kaizen. Updating line_externalids will replace any areas, lines and machines already assigned. Areas are ignored if lines are provided.
- machine_ids (Optional) - Specifies the machine ids for the kaizen. Updating machine_ids will replace any areas, lines and machines already assigned. Lines and areas are ignored if machines are provided.
- machine_codes (Optional) - Specifies the machine codes for the kaizen. Updating machine_codes will replace any areas, lines and machines already assigned. Lines and areas are ignored if machines are provided.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the kaizen record.
- error (Optional) - Error message if success is false.
Machine Method: set_cycle_count
URL: https://company.leading2lean.com/api/1.0/machines/set_cycle_count/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to set an existing Machine's cycle count.
Parameters:
- id (Required if not using code/site) - The id for the existing machine.
- code (Required if not using id) - Specifies the code of the existing machine.
- site (Required if not using id) - Specifies the site the machine is in.
- cyclecount - The new value for the cycle count.
- skip_lastupdated - If set to 1, then the lastupdated value for the machine will not be updated, otherwise it is.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- machine - On success, returns the machine record.
- error (Optional) - Error message if success is false.
Machine Method: increment_cycle_count
URL: https://company.leading2lean.com/api/1.0/machines/increment_cycle_count/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to set an existing Machine's cycle count.
Parameters:
- id (Required if not using code/site) - The id for the existing machine.
- code (Required if not using id) - Specifies the code of the existing machine.
- site (Required if not using id) - Specifies the site the machine is in.
- cyclecount - The value to increment the existing cycle count by.
- skip_lastupdated - If set to 1, then the lastupdated value for the machine will not be updated, otherwise it is.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- machine - On success, returns the machine record.
- error (Optional) - Error message if success is false.
Machine Method: get_open_dispatches
URL: https://company.leading2lean.com/api/1.0/machines/get_open_dispatches/id/?auth=<API_Key>
HTTP Method: GET
Functionality: Get the number of open dispatches for a given machine. Parameters:
- id (Required) - The id for the machine.
- site (Required) - Specifies the site the machine is in.
- dispatchtype_ids (Optional) - A comma separated list of dispatchtype id's to filter by.
- get_data (Optional) - if 1 then the dispatch data payload is returned, non-1 values return only a count. Defaults to 1 if not specified.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- count - On success, is set to the number of currently open dispatches according to the filter options.
- data - On success, returns the list of dispatch records formated like the Dispatch get_event_data api.
- error (Optional) - Error message if success is false.
Machine Method: rename
URL: https://company.leading2lean.com/api/1.0/machines/rename/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to change an existing Machine's code. Note - this is an expensive call and should be used infrequently.
Parameters:
- id (Required if not using code/site) - The id for the existing machine.
- newcode (Required) - The new code to use for the machine.
- code (Required if not using id) - Specifies the code of the existing machine.
- site (Required if not using id) - Specifies the site the machine is in.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the machine record.
- error (Optional) - Error message if success is false.
Event Schedule Method: get_schedules
URL: https://company.leading2lean.com/api/1.0/eventschedule/get_schedules/id/?auth=<API_Key>
HTTP Method: GET
Parameters:
- id - The id for the event schedule. Blank if you want all schedules for the site.
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify site filter for query.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- data - On success, returns the event schedule info. The event schedule data looks like:
[ { "id": <Event Schedule id>, "description": <The description of the event schedule>, "active": <If the event schedule is active, true or false>, "dispatchtype_id": <Dispatch Type id>, "trade_id": <Trade id>, "category_ids": <A list of ids of the schedule categories set>, "scheduletype": <The type of schedule set>, "intervaltype": <The type of interval set>, "do_event_shadowing": <do event shadowing, true of false> } ]
- error (Optional) - Error message if success is false.
Event Schedule Machine Resource Method: add_resource
URL: https://company.leading2lean.com/api/1.0/eventschedulemachineresource/add_resource/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a simple way to assign a resource to an event schedule machine. The trade will be set to what ever the user's current trade is, if set.
Parameters:
- auth (Required) - This is your authentication (API Key).
- site (Required) - Specify the site.
- estimate (Required) - Specify the estimate (hours).
- user (Required) - Specify the user to add as a resource.
- schedule_machine (Required) - Specify the event schedule machine to add a resource to.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - The new resource created.
- error (Optional) - Error message if success is false.
Event Schedule Machine Resource Method: update_resource
URL: https://company.leading2lean.com/api/1.0/eventschedulemachineresource/update_resource/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a simple way to update a resource on an event schedule machine. The trade will be the new users current trade, if set.
Parameters:
- id (Required) - Specify the id for the Event Schedule Machine Resource that you would like to update.
- auth (Required) - This is your authentication (API Key).
- site (Required) - Specify the site.
- estimate (Required) - Specify the estimate (hours).
- user (Required) - Specify the new user to use as the assigned resource.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - The updated resource.
- error (Optional) - Error message if success is false.
Event Schedule Machine Method: get_machine_schedule_info
URL: https://company.leading2lean.com/api/1.0/eventschedulemachine/get_machine_schedule_info/id/?auth=<API_Key>
HTTP Method: GET
Parameters:
- id (Required) - The id for the machine schedule.
- auth (Required) – This is your authentication (API Key).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- data - On success, returns the schedule and next occurrence info. The schedule data looks like:
[ { "lastupdated": <Last updated timestamp>, "suspended": <Machine Schedule is suspended, true or false>, "open": <A dispatch is currently open, true or false>, "id": <machine schedule id>, "line_abbreviation": <Line abbreviation>, "occurrence_type": <Next occurrence type description>, "lastcompleted": <last completed timestamp>, "machine": <machine id>, "suspendedon": <Suspended on timestamp or null>, "createdby": <Schedule created by>, "line_code": <Line code>, "next_occurrence": { "scheduled": <Next occurrence scheduled timestamp>, "launch": <Next occurrence launch timestamp>, "due": <Next occurrence due timestamp>, "machine": { "id": <machine id>, "lastupdated": <Next occurrence lastupdated timestamp>, "created": <Next occurrence created timestamp> }, "estimated_hours": <Next occurrence estimated hours decimal>, "id": <next occurrence id> }, "suspendedby": <Suspended by, user or null>, "lastupdatedby": <Last updated by, user or null>, "tooling": <tooling id or null>, "lastlaunched": <Last launched timestamp>, "launchprior": <When a schedule is closed and cycles the due date forward, this is how many seconds before the due date that the launch date is set when not overridden by the launchprior settings for the schedule's occurrence type>, "scheduleprior": <When a schedule is closed and cycles the due date forward, this is how many seconds before the due date that the scheduled date is set when not overridden by the launchprior settings for the schedule's occurrence type>, "machine_code": <machine code>, "created": <created timestamp>, "eventschedule": <master schedule id>, "lastcyclecompleted": <The machine cycle value at the time the last schedule was completed&, integer or null>, "estimated_hours": <Master schedule estimated hours, decimal>, "occurrencecount": <Occurrence count integer>, "dispatch_type_code": <The dispatch type code that will be used when schedule is launched into a dispatch> } ]
- error (Optional) - Error message if success is false.
Event Schedule Machine Method: get_line_schedule_info
URL: https://company.leading2lean.com/api/1.0/eventschedulemachine/get_line_schedule_info/id/?auth=<API_Key>
HTTP Method: GET
Parameters:
- line_code (Required) - The code for the line machine schedule. Line codes override line_id.
- line_id (Required) - The id for the line machine schedule. Not required if line codes are provided.
- auth (Required) – This is your authentication (API Key).
- start (Required) - Date to start filting the machine schedules based on the scheduled date. 90 day max.
- end (Required) - Date to end filting the machine schedules based on the scheduled date. 90 day max.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- data - On success, returns the schedules and next occurrence info from all machines on the specified lines. The schedule data looks like:
[ { "area_id": <Area id>, "machine_description": <Machine description>, "scheduleprior": <When a schedule is closed and cycles the due date forward, this is how many seconds before the due date that the scheduled date is set when not overridden by the launchprior settings for the schedule's occurrence type>,, "area_description": <Area description>, "due": <due date timestamp>, "lastupdated": <last updated date timestamp>, "suspended": <Machine Schedule is suspended, true or false>, "open": <A dispatch is currently open, true or false>, "id": <machine schedule id>, "line_abbreviation": <Line abbreviation>, "launchprior": <When a schedule is closed and cycles the due date forward, this is how many seconds before the due date that the launch date is set when not overridden by the launchprior settings for the schedule's occurrence type>,, "occurrence_type": <Next occurrence type description>, "lastcompleted": <last completed timestamp>, "machine": <machine id>, "suspendedon": <Suspended on timestamp or null>, "createdby": <Schedule created by>, "scheduled": <Schedule date timestamp>, "line_code": <Line code>, "area_code": <Area code>, "next_occurrence": { "machine": { "id": <machine id>, "lastupdated": <Next occurrence lastupdated timestamp>, "created": <Next occurrence created timestamp> }, "scheduled": <Next occurrence scheduled timestamp>, "id": <next occurrence id>, "due": <Next occurrence due timestamp>, "launch": <Next occurrence launch timestamp> }, "suspendedby": <Suspended by, user or null>, "line_id": <Line id>, "lastupdatedby": <Last updated by, user or null>, "tooling": <Last updated by, user or null>, "lastlaunched": <Last launched timestamp>, "dispatches": [ <List of dispatch numbers> ], "resources": { "id": <Reosurce user id>, "name": <Resource display name> } "machine_code": <machine code>, "created": <created timestamp>, "eventschedule": { "category": [ { "code": <Event schedule category code>, "id": <Event schedule category id>, "name": <Event schedule category name> } ], "interval_type": <Event schedule interval type>, "description": <Event schedule description>, "interval":<Event schedule interval>, "trade": <Event Schedule Trade id>, "dispatch_type_code": <Event schedule Dispatch type code>, "active": <Event schedule active>, "type": <Event schedule type>, "id": <Event schedule id> }, "site": <Machine schedule site> "launch": <Machine schedule launch date timestamp>, "lastcyclecompleted": <The machine cycle value at the time the last schedule was completed&, integer or null>, "estimated_hours": <Master schedule estimated hours, decimal>, "occurrencecount": <Occurrence count integer>, "cycle_count": <Machine cycle count> } ]
- error (Optional) - Error message if success is false.
Event Schedule Machine Method: resume
URL: https://company.leading2lean.com/api/1.0/eventschedulemachine/resume/id/?auth=<API_Key>
HTTP Method: POST
Parameters:
- id (Required) - The id for the event schedule machine.
- auth (Required) – This is your authentication (API Key).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Event Schedule Machine Method: suspend
URL: https://company.leading2lean.com/api/1.0/eventschedulemachine/suspend/id/?auth=<API_Key>
HTTP Method: POST
Parameters:
- id (Required) - The id for the event schedule machine.
- auth (Required) – This is your authentication (API Key).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Event Schedule Machine Method: update_schedule
URL: https://company.leading2lean.com/api/1.0/eventschedulemachine/update_schedule/id/?auth=<API_Key>
Functionality: Provides a way to update the launch/scheduled/due date for an event schedulemachine. NOTE: This method might recreate the event schedule machine occurrences.
HTTP Method: POST
Parameters:
- id (Required) - The id for the event schedule machine.
- auth (Required) – This is your authentication (API Key).
- launch (launch/scheduled/due required) - Date to update the event schedule machine's launch date.
- scheduled (launch/scheduled/due required) - Date to update the event schedule machine's scheduled date.
- due (launch/scheduled/due required) - Date to update the event schedule machine's due date.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- data - On success, returns the updated scheduled occurrence information.
[ { "id": <Event Schedule Machine id>, "launch": <Event Schedule Machine launch date>, "scheduled": <Event Schedule Machine scheduled date>, "due": <Event Schedule Machine due date>, } ]
- error (Optional) - Error message if success is false.
Event Schedule Machine Occurrences Method: update_scheduled_occurrence
URL: https://company.leading2lean.com/api/1.0/eventschedulemachineoccurrence/update_scheduled_occurrence/id/?auth=<API_Key>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- launch (launch/scheduled/due required) - Date to update the scheduled occurrence's launch date.
- scheduled (launch/scheduled/due required) - Date to update the scheduled occurrence's scheduled date.
- due (launch/scheduled/due required) - Date to update the scheduled occurrence's due date.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- data - On success, returns the updated scheduled occurrence information.
[ { "id": <Scheduled Occurrence id>, "launch": <Scheduled Occurrence launch date>, "scheduled": <Scheduled Occurrence scheduled date>, "due": <Scheduled Occurrence due date>, } ]
- error (Optional) - Error message if success is false.
Event Schedule Occurrenceype Method: get_resource_schedule
URL: https://company.leading2lean.com/api/1.0/eventscheduleoccurrencetype/get_resource_schedule/id/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- id (Required) – Specify the id of the event schedule occurrence type.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- data - On success, returns a list of records for the resource schedule.
[ { "trade": <trade id>, "estimate": <estimate>, }, { "trade": <trade id>, "estimate": <estimate>, } ]
- error (Optional) - Error message if success is false.
Event Schedule Occurrenceype Method: set_resource_schedule
URL: https://company.leading2lean.com/api/1.0/eventscheduleoccurrencetype/set_resource_schedule/id/?auth=<API_Key>
HTTP Method: POST
Functionality: Provides a way to set a resource schedule on an occurrence type. NOTE: This will overwrite the currently set schedule.
Parameters:
- auth (Required) – This is your authentication (API Key).
- id (Required) – Specify the id of the event schedule occurrence type.
- schedule - A list of json objects containing trade and estimate key pair values. IE: [{"trade": 63, "estimate": 222},{"trade": 63, "estimate": 333}]
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Page Method: get_pages
URL: https://company.leading2lean.com/api/1.0/pages/get_pages/username/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Optional) – Optionally return messages only for the specified site code
- since (Optional) – Optionally return messages since this date using this format: "%Y-%m-%d %H:%M:%S" Example: 2013-04-24 15:30:05
- getFields (Optional) - Optionally set to 1 to return the notification fields that were used in sending the original notification with each Page object.
- dispatchesOnly (Optional) - Optionally set to 1 to only get pages that are associated with dispatches.
- getContact (Optional) - Optionally set to 1 to include the user contact information for each page.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- data - On success, returns the list of pages sent for the given user. The list looks like:
[ { 'id': <page id>, 'site': <site>, 'subject': '<page subject line>', 'sent': '<sent timestamp>', 'sentcount': <sent count (how many times this notification has been sent>, 'fields': <list of fields (key/value pairs) sent in the notification (only included with a getFields=1 parameter)> 'type': <type code for the paging configuration that generated this page (only included with a getContact=1 parameter) >, 'contact': <The user contact information used for the page (only included with a getContact=1 parameter)> 'dispatch': { 'number': <The dispatch number >, 'description': <The dispatch description >, 'reported': <The dispatch reported time in ISO8601 format>, 'machine': <The machine code the dispatch is for >, 'line': <The line code the machine is on >, 'area': <The area code the machine's line is in >, 'link': <A url to the dispatch screen >, 'dispatchtype_code': <The DispatchType code for the dispatch>, 'dispatchtype_color': <The background color for the dispatch type> } } ]
Where the dispatch section is optional and included only if the page is associated with a dispatch. This list is ordered by the page sent field in descending order. - error (Optional) - Error message if success is false.
- err (Optional) - Error code if success is false. Possible values (taken from standard posix errno values) are:
- 22: EINVAL, Bad parameter formats - usually the since parameter is formatted wrong.
- 1: EPERM, Permission denied - api caller doesn't have rights to see the requested information.
- 2: ENOENT, The specified user was not found.
- 19: ENODEV, The specified user device was not found. The device may have been unregistered.
Page Messages Method: get_messages
URL: https://company.leading2lean.com/api/1.0/pagemessages/get_messages/username/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Optional) – Optionally return messages only for the specified site code
- since (Optional) – Optionally return messages since this date using this format: "%Y-%m-%d %H:%M:%S" Example: 2013-04-24 15:30:05
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual record saved.
- error (optional) - Error message if success is false.
Pitches Method: load_from_template
URL: https://company.leading2lean.com/api/1.0/pitches/load_from_template/?auth=<API_Key>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- linecode (Required if not providing line_externalid) – Specify the line code for the line you are loading pitches
- line_externalid (Required if not providing linecode) – Specify the line externalid for the line you are loading pitches
- start (Required) – The date to load the template for using this format: "%Y-%m-%d" Example: 2019-04-24
- pitch_schedule_template (Required) – The id of the pitch_schedule_template being loaded.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Pitches Method: set_active
URL: https://company.leading2lean.com/api/1.0/pitches/set_active/id/?auth=<API_Key>
Http Method: POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- id (Required) – Specify the id of the pitch.
- active (Optional) – Set True/False value for this property. Default=True
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Pitches Method: set_demand
URL: https://company.leading2lean.com/api/1.0/pitches/set_demand/?auth=<API_Key>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- linecode (Required if not providing line_externalid) – Specify the line code for the line you are setting the demand
- line_externalid (Required if not providing linecode) – Specify the line externalid for the line you are setting the demand
- start (Required) – The start of the pitch range using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- end (Required) – The end of the reporting interval using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- shift (Optional) – Specify a shift id if you want to only apply this demand to pitches in the given shift
- demand (Required) – The total demand (Integer or Decimal) to be spread over the planned production minutes in the pitches between start (inclusive) and end (exclusive).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the a count of the records updated and the new cycle time.
- error (Optional) - Error message if success is false.
Pitches Method: set_demand_by_cycle_time
URL: https://company.leading2lean.com/api/1.0/pitches/set_demand_by_cycle_time/?auth=<API_Key>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- linecode (Required if not providing line_externalid) – Specify the line code for the line you are setting the demand
- line_externalid (Required if not providing linecode) – Specify the line externalid for the line you are setting the demand
- start (Required) – The start of the pitch range using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- end (Required) – The end of the reporting interval using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- shift (Optional) – Specify a shift id if you want to only apply this demand to pitches in the given shift
- cycle_time (Required) – The cycle time in seconds (Integer or Decimal) to build one part to be used to calculate the demand per pitch based on the planned production minutes between start (inclusive) and end (exclusive).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the a count of the records updated and the new cycle time.
- error (Optional) - Error message if success is false.
Pitches Method: set_demand_by_product_order_queue
URL: https://company.leading2lean.com/api/1.0/pitches/set_demand_by_product_order_queue/?auth=<API_Key>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- linecode (Required if not providing line_externalid) – Specify the line code for the line you are setting the demand
- line_externalid (Required if not providing linecode) – Specify the line externalid for the line you are setting the demand
- start (Required) – The start of the pitch range using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- end (Required) – The end of the reporting interval using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30. The end cannot be more than 7 days greater than the start.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the a count of the records updated and the new cycle time.
- error (Optional) - Error message if success is false.
Pitches Method: set_planned_operator_count
URL: https://company.leading2lean.com/api/1.0/pitches/set_planned_operator_count/?auth=<API_Key>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- linecode (Required if not providing line_externalid) – Specify the line code for the line you are setting the planned operator count
- line_externalid (Required if not providing linecode) – Specify the line externalid for the line you are setting the planned operator count
- start (Required) – The start of the pitch range using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- end (Required) – The end of the reporting interval using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- shift (Optional) – Specify a shift id if you want to only apply this planned operator count to pitches in the given shift
- operator_count (Required) – The planned operator count (Integer or Decimal) to be set for each pitch for pitches between start (inclusive) and end (exclusive).
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the a count of the records updated.
- error (Optional) - Error message if success is false.
Pitch Method: mostrecent
This method allows you to query for the most recent Pitch record for a given line.
URL: https://company.leading2lean.com/api/1.0/pitches/mostrecent/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code for the data you are reporting
- line (Required if not providing linecode or line_externalid) – Specify the line id you want to query on.
- linecode (Required if not providing line or line_externalid) – Specify the line code for the line you want to query on.
- line_externalid (Required if not providing line or linecode) – Specify the line externalid for the line you want to query on.
- daysback (Optional) – Specify the number of days back to look. Defaults to 7 and cannot exceed 28.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the most recent Pitch record for the given line.
- error (Optional) - Error message if success is false.
Pitch Details Method: record_details
URL: https://company.leading2lean.com/api/1.0/pitchdetails/record_details/?auth=<API_Key>
HTTP Method: GET or POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code for the data you are reporting
- linecode (Required if not providing line_externalid) – Specify the line code for the line you are reporting actuals
- line_externalid (Required if not providing linecode) – Specify the line externalid for the line you are reporting actuals
- start (Required) – The start of the reporting interval using this format: "%Y-%m-%d %H:%M:%S.%f" or "%Y-%m-%d %H:%M:%S" Example: 2013-04-24 15:30:05.153005 or 2013-04-24 15:30:05
- end (Required) – The end of the reporting interval using this format: "%Y-%m-%d %H:%M:%S.%f" or "%Y-%m-%d %H:%M:%S" Example: 2013-04-24 15:30:05.153005 or 2013-04-24 15:30:05. The end value must come after the start value.
- actual (Optional) – The decimal value (up to 2 digits after the .) representing the products produced I.e. 2.0, 1453.74, 54, etc. Defaults to 0.00
- scrap (Optional) – The decimal value (up to 2 digits after the .) representing the products produced I.e. 2.0, 1453.74, 54, etc. Defaults to 0.00
- operator_count (Optional) – The decimal value (up to 2 digits after the .) representing the products produced I.e. 2.0, 1453.74, 54, etc. Defaults to 0.00
- productcode (Required) – The product code/sku/model number being produced. Defaults to null.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual record saved.
- error (Optional) - Error message if success is false.
Pitch Details Method: mostrecent
This method allows you to query for the most recent Pitch Detail record for a given line.
URL: https://company.leading2lean.com/api/1.0/pitchdetails/mostrecent/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code for the data you are reporting
- line (Required if not providing linecode or line_externalid) – Specify the line id you want to query on.
- linecode (Required if not providing line or line_externalid) – Specify the line code for the line you want to query on.
- line_externalid (Required if not providing linecode) – Specify the line externalid for the line you want to query on.
- daysback (Optional) – Specify the number of days back to look. Defaults to 7 and cannot exceed 28.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the most recent Pitch Detail record for the given line.
- error (Optional) - Error message if success is false.
Product Orders Method: sync_order
URL: https://company.leading2lean.com/api/1.0/productorders/sync_order/id/?auth=<API_Key>
HTTP Method: GET or POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- id (Optional if adding, Required if updating) – Specify the id if you are updating an existing order. Can be in the path or the GET/POST arguments.
- site (Required) – Specify the site code for the data you are reporting
- productcode (Required) – Specify the product code for the product being ordered. If the product code doesn't exist in the system a new product with this code will be added.
- product_barcode_format (Optional) – Specify a barcode format to create/update the associated product (specified by productcode above). This value is saved in the product record for future API calls where this value is omitted.
- product_barcode_data (Optional) – Specify the barcode data to create/update the associated product (specified by productcode above). This value is saved in the product record for future API calls where this value is omitted.
- name (Required) – Specify the short name for the order.
- description (Optional) – Specify a longer order description / instructions.
- barcode_format (Optional) – Specify a barcode format for this Product Order.
- barcode_data (Optional) – Specify the barcode data for this Product Order.
- background_color (Optional) – Specify a new background color in html color format (FFFFFF) for the product. This value is saved in the product record for future API calls where this value is omitted.
- font_color (Optional) – Specify a new font color in html color format (FFFFFF) for the product. This value is saved in the product record for future API calls where this value is omitted.
- override_background_color (Optional) – Specify an override background color in html color format (FFFFFF) for this order. Override colors are used when displaying this order instead of the product colors.
- override_font_color (Optional) – Specify an override font color in html color format (FFFFFF) for this order. Override colors are used when displaying this order instead of the product colors.
- changeover_order (Optional) – Specify a new Preferred Changeover Order for the product. This value is saved in the product record for future API calls where this value is omitted. The decimal value (up to 2 digits after the .) representing the product's preferred changeover order as a numeric value with the top priority being the lowest number (defaults to 1.00). I.e. 1.00, 2.00, 2.54, etc.
- status (Optional) – Specify order status from the following choices ['new', 'planning', 'scheduled', 'ready to build', 'changeover/setup', 'work in progress', 'on hold', 'completed', 'canceled'], Defaults to new.
- schedule_date (Optional) – The schedule date to start producing the product, using this format: "%Y-%m-%d %H:%M" Example: 2016-04-24 15:30 NOTE: This parameter is for creation only. Subsequent update calls to this method with a valid id will cause the schedule_date field value to use the earliest scheduled build sequence date if there are build sequences or will be set to empty if there are no build sequences associated with the Product Order. This mimics the behavior in the UI.
- due_date (Optional) – The due end the product needs to be completed, using this format: "%Y-%m-%d %H:%M" Example: 2016-04-24 15:30 NOTE: This parameter is for creation only. Subsequent update calls to this method with a valid id will cause the due_date field value to use the latest due_date from the associated build sequences or will be set to empty if there are no build sequences. This mimics the behavior in the UI.
- order_quantity (Optional) – The decimal value (up to 2 digits after the .) representing the quantity of products ordered (to be built) I.e. 2.0, 1453.74, 54, etc. Defaults to 0.00
- externalid (Optional if adding, Required if updating without an id) – Specify the externalid for the order your syncing, will be used to lookup order for updating if id is not provided.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual record saved.
- error (optional) - Error message if success is false.
Product Orders Method: sync_ekanban_order
URL: https://ClientName.leading2lean.com/api/1.0/productorders/sync_ekanban_order/id/?auth=<token>
HTTP Method: GET or POST
Parameters:
- auth (Required) – This is your authentication token
- id (Optional if adding, Required if updating) – Specify the id if you are updating an existing order. Can be in the path or the GET/POST arguments.
- site (Required) – Specify the site code for the data you are reporting
- productcode (Required) – Specify the product code for the product being ordered. If the product code doesn't exist in the system a new product with this code will be added.
- product_barcode_format (Optional) – Specify a barcode format to create/update the associated product (specified by productcode above). This value is saved in the product record for future API calls where this value is omitted.
- product_barcode_data (Optional) – Specify the barcode data to create/update the associated product (specified by productcode above). This value is saved in the product record for future API calls where this value is omitted.
- name (Required) – Specify the short name for the order.
- barcode_format (Optional) – Specify a barcode format for this Product Order.
- barcode_data (Optional) – Specify the barcode data for this Product Order.
- ekanban_barcode_format (Optional) – Specify barcode format for all ekanban cards (build sequences) created during this API call.
- ekanban_barcode_data (Optional) – Specify the barcode data for all ekanban cards (build sequences) created during this API call.
- linecode (Optional) – Specify the line code that will be producing this order.
- line_externalid (Optional, used if not providing linecode) – Specify the line externalid that will be producing this order.
- linecodes_that_can_build (Optional) – Specify the line codes (separated by a comma) that can build this order. Example: Line1,Line2,Line3
- line_externalids_that_can_build (Optional, used if linecodes_that_can_build is not provided) – Specify the line externalids (separated by a comma) that can build this order. Example: ExternalID1,ExternalID2,ExternalID3
- background_color (Optional) – Specify a new background color in html color format (FFFFFF) for the product. This value is saved in the product record for future API calls where this value is omitted.
- font_color (Optional) – Specify a new font color in html color format (FFFFFF) for the product. This value is saved in the product record for future API calls where this value is omitted.
- override_background_color (Optional) – Specify an override background color in html color format (FFFFFF) for this order. Override colors are used when displaying this order instead of the product colors.
- override_font_color (Optional) – Specify an override font color in html color format (FFFFFF) for this order. Override colors are used when displaying this order instead of the product colors.
- changeover_order (Optional) – Specify a new Preferred Changeover Order for the product. This value is saved in the product record for future API calls where this value is omitted. The decimal value (up to 2 digits after the .) representing the product's preferred changeover order as a numeric value with the top priority being the lowest number (defaults to 1.00). I.e. 1.00, 2.00, 2.54, etc.
- description (Optional) – Specify a longer order description / instructions.
- status (Optional) – Specify order status from the following choices ['new', 'planning', 'scheduled', 'ready to build', 'changeover/setup', 'work in progress', 'on hold', 'completed', 'canceled'], Defaults to new.
- schedule_date (Optional) – The schedule date to start producing the product, using this format: "%Y-%m-%d %H:%M" Example: 2016-04-24 15:30
- due_date (Optional) – The due end the product needs to be completed, using this format: "%Y-%m-%d %H:%M" Example: 2016-04-24 15:30
- order_quantity (Required) – The decimal value (up to 2 digits after the .) representing the quantity of products ordered (to be built) I.e. 2.0, 1453.74, 54, etc.
- card_size (Required) – The decimal value (up to 2 digits after the .) representing the quantity of products to be built per eKanban card. I.e. 2.0, 1453.74, 54, etc.
- planned_operator_count (Optional) – The decimal value (up to 2 digits after the .) representing the number of operators planned to produce this order I.e. 2.0, 3.74, 5, etc. Defaults to 1.
- externalid (Optional if adding, Required if updating without an id) – Specify the externalid for the order your syncing, will be used to lookup order for updating if id is not provided.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual record saved.
- error (Optional) - Error message if success is false.
Product Order Build Sequence Method: sync_order_details
URL: https://company.leading2lean.com/api/1.0/buildsequence/sync_order_details/id/?auth=<API_Key>
HTTP Method: GET or POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- id (Optional if adding, Required if updating) – Specify the id if you are updating an existing order detail record. Can be in the path or the GET/POST arguments.
- site (Required) – Specify the site code for the data you are reporting
- product_order (Required) – Specify the id of the associated product order that this detail record will be linked with
- productcode (Required) – Specify the product code for the product being ordered. If the product code doesn't exist in the system a new product with this code will be added.
- product_barcode_format (Optional) – Specify a barcode format to create/update the associated product (specified by productcode above). This value is saved in the product record for future API calls where this value is omitted.
- product_barcode_data (Optional) – Specify the barcode data to create/update the associated product (specified by productcode above). This value is saved in the product record for future API calls where this value is omitted.
- status (Optional) – Specify order status from the following choices ['new', 'planning', 'scheduled', 'ready to build', 'changeover/setup', 'work in progress', 'on hold', 'completed', 'canceled'], Defaults to new.
- sequence (Optional) – Specify the sequence number for this detail record. Defaults to the max order detail sequence number for this order + 1.
- name (Required) – Specify the short name for the order.
- description (Optional) – Specify a longer order description / instructions.
- barcode_format (Optional) – Specify a barcode format for this Build Sequence.
- barcode_data (Optional) – Specify the barcode data for this Build Sequence.
- linecode (Required if not providing line_externalid) – Specify the line code that will be producing this order detail.
- line_externalid (Required if not providing linecode) – Specify the line externalid that will be producing this order detail.
- changeover_duration (Required/Integer) – Specify anticipated number of seconds for the line to setup/changeover to this order.
- cycle_time (Optional/Integer) – Specify anticipated number of seconds for the line produce 1 part for this order.
- schedule_start_date (Optional) – The schedule date to start producing the product, using this format: "%Y-%m-%d %H:%M:%S" Example: 2013-04-24 15:30:05
- schedule_end_date (Optional) – The schedule date to stop producing the product, using this format: "%Y-%m-%d %H:%M:%S" Example: 2013-04-24 15:30:05
- due_date (Optional) – The due end the product needs to be completed, using this format: "%Y-%m-%d %H:%M:%S" Example: 2013-04-24 15:30:05
- order_quantity (Optional) – The decimal value (up to 2 digits after the .) representing the quantity of products ordered (to be built) I.e. 2.0, 1453.74, 54, etc. Defaults to 0.00
- planned_operator_count (Optional) – The decimal value (up to 2 digits after the .) representing the number of operators planned to produce this order I.e. 2.0, 3.74, 5, etc. Defaults to 1.
- externalid (Optional if adding, Required if updating without an id) – Specify the externalid for the order your syncing, will be used to lookup order for updating if id is not provided.
- format=xml (Optional) – Returns the results in xml format instead of json.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual record saved.
- error (Optional) - Error message if success is false.
Scrap Detail Method: add_scrap_detail
URL: https://company.leading2lean.com/api/1.0/scrapdetail/add_scrap_detail/?auth=<API_Key>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code for the data you are reporting
- linecode (Required) – Specify the line code for the line you are reporting actuals
- scrap_datetime (Required) – The datetime the scrap occurred using this format: "%Y-%m-%d %H:%M:%S" Example: 2013-04-24 15:30:05
- scrap (Required) – The decimal value (up to 2 digits after the .) representing the scrap count to be added for this category I.e. 2.0, 1453.74, 54, etc. Defaults to 0.00
- scrapcategory (Required) – The scrap category code by which to categorize the scrap count being sent. If an existing record for this code and category is found, the scrap amount will be added to it.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the individual record saved.
- error (Optional) - Error message if success is false.
Spares Method: request_issue
Request a spare to be issued.
Note: Although dispatchnumber, dispatch_id, workordernumber, workorder_id, machine_code and line_code are optional, at least one of these parameters must be supplied in order for the spare request to be created successfully. If a dispatchnumber, dispatch_id, workordernumber or workorder_id is passed, machine_code and line_code will be ignored and the current line and machine associated with the Work Order or Dispatch will be used. If a machine_code is passed, line_code will be ignored and the line code currently associated with the machine looked up by the machine_code will be used.
URL: https://ClientName.leading2lean.com/api/1.0/spares/request_issue/(id not used)/?auth=<token>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication token.
- partnumber (Required) – Part number being requested.
- quantity (Required) – Quantity of spares being requested.
- location (Optional) – Location to issue the spare from. Will use the first valid location if not provided.
- dispatchnumber (Optional) – The Dispatch number the spare is being issued against.
- dispatch_id (Optional) – The Dispatch ID the spare is being issued against.
- workordernumber (Optional) – The Work Order number the spare is being issued against.
- workorder_id (Optional) – The Work Order ID the spare is being issued against.
- machine_code (Optional) – The machine code to issue the spare against.
- line_code (Optional) – The line code to issue the spare against.
- notify (Optional) – Specify if the spare request should be displayed in the Queue.
- comments (Optional) – Any additional comments to be stored in the spare request.
- category (Optional) – Consumption category for the spare. Will use the default consumption category if not provided.
- requestedby (Optional) - This is the username of the user requesting to issue the spare.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- Info - On success, returns success message.
- error (Optional) - Error message if success is false.
Spares Method: synchronize
URL: https://ClientName.leading2lean.com/api/1.0/spares/synchronize/id/?auth=<token>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication token
- status (Optional) - Sets the status of the spare issue. (ISSUE_REQUESTED=1,IN_PROCESS=2,COMPLETE=3,SYNCHRONIZED=6,ON_ORDER=7,RECEIVED=8, KIT_REQUESTED=10, KIT_RESERVED=11) If no status value is passed the status is set to SYNCHRONIZED.
- synchronized_on (Optional) - Sets the synchronized_on datetime value if the status of the spare is set to SYNCHRONIZED.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- Info - On success, returns success message.
- error (Optional) - Error message if success is false.
Spares Method: close
URL: https://ClientName.leading2lean.com/api/1.0/spares/close/id/?auth=<token>
HTTP Method: POST
Parameters:
- auth (Required) – This is your authentication token
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- Info - On success, returns success message.
- error (Optional) - Error message if success is false.
Technicians Method: set_availability (Deprecated)
Note: This API call is being replaced by Users Method: set_availability.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/technicians/set_availability/Username/
- URL Path Parameters:
- Username (Optional) - The login id for the given user.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- POST Arguments
- site (Required) – Specify the site code the user is located at.
- available=<True | False > (Optional) – Specify the availability status of the user - defaults to False.
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Tooling Method: add_possible_machines
This method allows you to add possible machines to a Tooling.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/tooling/add_possible_machines/id/
- URL Path Parameters:
- id - The id of the tooling to add the machine(s) to.
- POST Arguments
- machines (Required) - A comma delimited list of machine codes to add to a Tooling.
- Returns: A JSON object with the following fields:
- Í
- success - Returns either true or false.
- data - On success, returns the Tooling the machines were added to.
- error (Optional) - Error message if success is false.
Tooling Method: remove_possible_machines
This method allows you to remove possible machines assigned to a Tooling.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/tooling/remove_possible_machines/id/
- URL Path Parameters:
- id - The id of the tooling to remove the machine(s) from.
- POST Arguments
- machines (Required) - A comma delimited list of machine codes to remove from the Tooling.
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- data - On success, returns the Tooling the machines were removed from.
- error (Optional) - Error message if success is false.
Users Method: lastlogins
View last login information for users in a site, with optional filters for technicians, users, and stale logins.
URL: https://company.leading2lean.com/api/1.0/users/lastlogins/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify site filter for query.
- loginwindow (Optional) – Filter results by users who have not logged in within the given number of minutes.
- technicians(Optional) – Specify 1 to filter results by users who are technicians, and return back their technician information.
- loginid(Optional) – Specify the loginid for a given user to filter the results by.
- format=xml (Optional) - returns the results in xml format instead of json (default).
Returns:
By default the API will return a json object with the following fields:
- success - Returns either true or false.
- data - On success, returns the list of pages sent for the given user. The list looks like:
[ { 'loginid': <User's username>, 'firstname': <User's first name>, 'lastname': '<User's last name>', 'email': '<User's email address>', 'lastlogin': <datetime value for the last time the user logged in, formatted as"%Y-%m-%d %H:%M:%S" and in UTC>, 'technicianid': <User's technician id, if "technicians=1" was passed in the query arguments>, 'available': <User's current technician availability, if "technicians=1" was passed in the query arguments>, } ]
Where the dispatch section is optional and included only if the page is associated with a dispatch. This list is ordered by the page sent field in descending order. - count - the length of the data list.
- error (Optional) - Error message if success is false.
Users Method: clock_in
Clock the given user in to start a new time shift. Any open time shifts will be ended as well.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/clock_in/Username/
- URL Path Parameters:
- Username (Required) - The login id for the given user.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- POST Arguments
- site (Required) – Specify the site code the user is located at.
- (Line) - one of the following methods is Required to specify the line(s) the user is clocking into.
To specify multiple values, include the parameter name and value multiple times in the POST body:
linecode=line1
linecode=line2
...
- line_id – Specify the id for the line.
- linecode – Specify the code for the line.
- line_externalid – Specify the externalid for the line.
- costcentercode – Specify the cost center code for the line. All lines with the given costcenter will be included.
- (Machine) - you can optionally specify a list of machines to check into. To specify multiple values, include the parameter name and value multiple times in the POST body:
machinecode=machine1
machinecode=machine2
...
- machine_id – Specify the id for the machine.
- machinecode – Specify the code for the machine.
- machine_costcentercode – Specify the costcenter code for the machine. All machines with the given costcenter will be included.
- start=<datetime string> (Optional) – The ending date/time to set for the currently open time shifts. The value must follow this format: "%Y-%m-%d %H:%M:%S" using a time in the site's timezone. If not specified, then the current date/time will be used. Example: "2013-04-24 15:30:05"
- end=<datetime string> (Optional) – The ending date/time to set for the currently open time shifts. The value must follow this format: "%Y-%m-%d %H:%M:%S" using a time in the site's timezone. If not specified, then the time shift will be left open. Example: "2013-04-24 15:30:05"
- Note - if you specify end, it must be chronologically later than start, or the current date/time if start is not specified.
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
- lines - If success is true, a list of lines (partial information) that the system clocked the user in to.
Users Method: clock_in_by_externalid
Clock the given user (identifed by externalid) in to start a new time shift. Any open time shifts will be ended as well. This method is the same as Users Method: clock_in with the exception of the URL and that you pass the users externalid in place of the username in the URL.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/clock_in_by_externalid/externalid/
Users Method: clock_out
Clock the given user out of any currently open user time records.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/clock_out/Username/
- URL Path Parameters:
- Username (Required) - The login id for the given user.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- POST Arguments
- site (Required) – Specify the site code the user is located at.
- end=<datetime string> (Optional) – The ending date/time to set for the currently open time shifts. Must follow this format: "%Y-%m-%d %H:%M:%S" using a time in the site's timezone. Defaults to the current date/time. Example: "2013-04-24 15:30:05"
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Users Method: clock_out_by_externalid
Clock the given user (identifed by externalid) out of any currently open user time records. This method is the same as Users Method: clock_out with the exception of the URL and that you pass the users externalid in place of the username in the URL.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/clock_out_by_externalid/externalid/
Users Method: set_active
This method allows you to enable or disable a user in the system by setting the active field to True or False. In additional to your authentication (API Key), this method also requires the post data to be signed cryptographically. For more details please refer to the authentication section on request signatures using a Secret Key.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/set_active/
- URL Path Parameters:
- None
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- Request Signature: Required
- Request Format before Signing:
- Replace variables like <username> with the actual value for the username. "\n" represents a newline character.
- <server>\n<expiration>\n<username>\n<active>\n
- Example:
- Secret Key: testkey
- Server: test-server
- Expiration: 2016-03-31 13:59:59
- Data: test-server\n2016-03-31 13:59:59\njohnsmith\nTrue\n
- Signature: A+ws1d2IhNvitJyQaW3CswF03Rdy6hXusrCUPwfJuAOuCKVbxVUXk3dDLWZMBHEIutuXi5nBNf4SYySXnS4HyQ==
- POST Arguments
- username (Required) - The login id for the given user.
- active (Required) - Either "True" or "False".
- _expiration=<datetime string> (Required) – The expiration date/time of the request. The value must follow this format: "%Y-%m-%d %H:%M:%S". Example: "2013-04-24 15:30:05"
- _server (Required) - The server name associated with the Secret Key you are signing this request with. This may be different from the hostname in the url used to access this API.
- _signature (Required) - The request signature generated cryptographically using the Secret Key issued to you to use this API.
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
- data - If success is true, the user record that was created.
Users Method: set_availability
Set the available status for the given User record.
Note: This API call replaces the deprecated Technicians Method: set_availability call.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/set_availability/Username/
- URL Path Parameters:
- Username (Required) - The login id for the given user.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- POST Arguments
- site (Required) – Specify the site code the user is located at.
- available=<True | False > (Optional) – Specify the availability status of the user - defaults to False.
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Users Method: set_availability_by_externalid
Set the available status for the given User record (identifed by externalid). This method is the same as Users Method: set_availability with the exception of the URL and that you pass the users externalid in place of the username in the URL.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/set_availability_by_externalid/externalid/
Users Method: set_externalid
Sets the user's externalid.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/set_externalid/Username/
- URL Path Parameters:
- Username (Required) - The login id for the given user.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- POST Arguments
- externalid=<externalid> (Required) – Specify the externalid to set on the user record.
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
Users Method: reset_password
This method allows you to send a password reset email to an active user. The user must have an email address configured. This does NOT reset their password, but instead allows you to trigger the password reset workflow for a given user.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/reset_password/Username/
- URL Path Parameters:
- username: The username of the user to send the password reset for.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
Users Method: set_resource_site
Sets a user as a resource on a site.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/users/set_resource_site/Username/
- URL Path Parameters:
- Username (Required) - The login id for the given user.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- POST Arguments
- site (Required) - Specify the site code of the new resource site assignment.
- active <True | False> (Optional) - The user will be an active resource on the site. Defaults to True
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
WorkOrders Method: add_note
Adds a note to a workorder.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/workorders/add_note/id/
- URL Path Parameters:
- id (Required) - The id for the given workorder.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- POST Arguments
- note (Required) - This is the note you want to add to the Work Order.
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- error (Optional) - Error message if success is false.
WorkOrders Method: add_external_cost
Adds an external cost to a workorder.
Request Details
- HTTP Method: POST
- URL Path: /api/1.0/workorders/add_external_cost/id/
- URL Path Parameters:
- id (Required) - The id for the given workorder.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- POST Arguments
- expense_date (Required) - This is the expense date for the external cost.
- description (Required) - This is the description for the external cost.
- name (Required) - This is the name of the external cost.
- vendor (Required) - This is the id for the vendor of the external cost.
- category (Optional) - This is the id of the external cost category.
- cost (Required) - This is the cost.
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- data - On success, returns the individual external cost record that was added to the workorder.
- error (Optional) - Error message if success is false.
WorkOrders Method: get_external_costs
Get's the external costs on a workorder.
Request Details
- HTTP Method: GET
- URL Path: /api/1.0/workorders/get_external_costs/id/
- URL Path Parameters:
- id (Required) - The id for the given workorder.
- URL Query Arguments
- auth=<API_Key> (Required) - This is your authentication (API Key).
- format=xml (Optional) - returns the results in xml format instead of json (default).
- Returns: A JSON object with the following fields:
- success - Returns either true or false.
- data - On success, returns the workorder's external cost records.
- error (Optional) - Error message if success is false.
Reporting API Documentation
Below is a list of supported reporting API methods with access to summarized reporting data that is useful for external reporting uses.
- Production: Daily Summary Data by Line
- Production: Weekly Summary Data by Line
- Production: Days Since Last Scrap
- Production: Max Days Since Last Scrap
- Production: Days Since Last Dispatch
- Production: OEE Aggregate Sites
- User Skills: Training Duration
- User Skills: Level Count
- Skills Data: Skills Info
- Skills Data: User Training
Reporting Method: Production: Weekly Summary Data by Line
URL: https://company.leading2lean.com/api/1.0/reporting/production/weekly_summary_data_by_line/?auth=<API_Key>
HTTP Method: GET or POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- date (Required) – The date that falls within the production week that data will be returned for. Using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- linecode (Required if no line_id or line_externalid is provided) – Filter by lines by specifying a list of comma-delimited line codes. Example: linecode=line-a,line-b,line-c
- line_externalid (Required if no linecode or line_id is provided) – Filter by a list of lines by specifying a list of comma-delimited line externalids. Example: line_externalid=line-ext-1,line-ext-2,line-ext-3
- line_id (Required if no linecode or line_externalid is provided) – Filter by a list of lines by specifying a list of comma-delimited line ids. Example: line_id=21,15,47
- costcentercode (Optional) – Optionally filter by a list of lines by specifying a list of comma-delimited cost center codes. Example: costcentercode=RAW-6,ASSEMBLY-45,PAINT-23
- format=xml (Optional) – Returns the results in xml format instead of json.
Notes and Limitations:
- Production administrators for each site have the ability in the Production Settings screen to rename various production metrics to meet their needs. While these don’t change very often, this API has been designed to use the underlying L2L metric names to avoid breaking integrations when these metrics get renamed in the user interface. It is your responsibility to ensure you are using the correct labels on this metric data when you display it.
- For a full description of each production metric and it’s formula, please see refer to the Production Settings screen and our Support website.
- The fields available will increase overtime as we add new metrics to the system over time.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the weekly line statistics for the given production week based on the date and line parameters.
- Example weekly record:
{ "area_id": 217, "teff": "0.00", "pitch_pace": "0", "average_demand": "50", "peff": "105", "pph": "488", "ppp": "100", "earned_hours": "8", "labor_efficiency": "105", "scrap": "4.00", "lhpu": "0", "scrap_percent": "0", "npm": "103", "ppmh": "239", "lmpu": "0", "line_id": 2480, "line_categories": [1], "demand": "3709.00", "past_due": "194.00", "downtime_minutes": "50.00", "actual": "3903.00", "operational_availability": "90", "planned_production_downtime_minutes": "10000.00", "yield": "100", "tpu": "0.225", "pitch_count": "70", "run_rate": "7", }
- Example weekly record:
- error (Optional) - Error message if success is false.
Reporting Method: Production: Daily Summary Data by Line
URL: https://company.leading2lean.com/api/1.0/reporting/production/daily_summary_data_by_line/?auth=<API_Key>
HTTP Method: GET or POST
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- start (Required) – The start of the pitch range using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- end (Required) – The end of the reporting interval using this format: "%Y-%m-%d %H:%M" Example: 2019-04-24 15:30
- linecode (Optional) – Optionally filter by a list of lines by specifying a list of comma-delimited line codes. Example: linecode=line-a,line-b,line-c
- line_externalid (Optional) – Optionally filter by a list of lines by specifying a list of comma-delimited line externalids. Example: line_externalid=line-ext-1,line-ext-2,line-ext-3
- line_id (Optional) – Optionally filter by a list of lines by specifying a list of comma-delimited line ids. Example: line_id=21,15,47
- costcentercode (Optional) – Optionally filter by a list of lines by specifying a list of comma-delimited cost center codes. Example: costcentercode=RAW-6,ASSEMBLY-45,PAINT-23
- show_shifts (Optional) – Specify true if you want the output to include a separate row for each shift with data within the date range
- show_products (Optional) – Specify true if you want the output to include a separate row for each product with data within the date range
- format=xml (Optional) – Returns the results in xml format instead of json.
Notes and Limitations:
- To reduce load on the system, the maximum duration (end – start) must be 7 days or less.
- Production administrators for each site have the ability in the Production Settings screen to rename various production metrics to meet their needs. While these don’t change very often, this API has been designed to use the underlying L2L metric names to avoid breaking integrations when these metrics get renamed in the user interface. It is your responsibility to ensure you are using the correct labels on this metric data when you display it.
- For a full description of each production metric and it’s formula, please see refer to the Production Settings screen and our Support website.
- The fields available will increase overtime as we add new metrics to the system over time.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the a count of the records updated and the new cycle time.
- If the show_shifts parameter field is set to true, the output will include the “shift_id” and “shift” fields.
- If the show_products parameter field is set to true, the output will include the “product_id” and “product” fields.
- Example daily record:
{ "actual": "3903.00", "area": "Area 1", "area_id": 1, "changeover_actual": "0", "changeover_duration": "0", "date": "2019-03-01T07:00:00", "demand": "3709.00", "downtime_minutes": "50.00", "earned_hours": "8", "labor_efficiency": "105", "line": "line-a", "line_id": 16, "line_categories": [1], "lhpu": "0", "lmpu": "0", "nonproduction_minutes": "0.00", "npm": "103", "operational_availability": "90", "operator_count": "2.0437500000000000", "overall_equipment_effectiveness": "89", "past_due": "194.00", "peff": "105", "pitch_count": 8, "planned_production_minutes": "480.00", "pph": "488", "ppmh": "239", "ppp": "100", "product": "Widget A", "product_id": 1, "products": 1, "scrap": "4.00", "scrap_percent": "0", "shift": "Day Shift", "shift_id": 1, "shifts": 1, "site": 23, "run_rate": "7", "takt_time": "8", "teff": "89", "tpu": "0.225", "yield": "100", "pitch_pace": "1" }
- error (Optional) - Error message if success is false.
Reporting Method: Production: Days Since Last Scrap
URL: https://company.leading2lean.com/api/1.0/reporting/production/days_since_last_scrap/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- area_id= (Optional*) - Limit the search to dispatches for lines in the given area.
- line_code (Optional*) – Optionally filter by a list of lines by specifying a list of comma-delimited line codes. Example: linecode=line-a,line-b,line-c
- line_externalid (Optional*) – Optionally filter by a list of lines by specifying a list of comma-delimited line externalids. Example: line_externalid=line-ext-1,line-ext-2,line-ext-3
- line_id(Optional*) – Optionally filter by a list of lines by specifying a list of comma-delimited line ids. Example: line_id=21,15,47
- format=xml (Optional) – Returns the results in xml format instead of json.
Notes and Limitations:
- *To reduce load on the system, you must specify either an area (all lines in the area), or one of the three line filters.
- To reduce load on the system the report only returns results over the past 365 days. This mean if there was scrap reported 365 days ago, the value of production_days_since will be 0.
- Production administrators for each site have the ability in the Production Settings screen to rename various production metrics to meet their needs. While these don’t change very often, this API has been designed to use the underlying L2L metric names to avoid breaking integrations when these metrics get renamed in the user interface. It is your responsibility to ensure you are using the correct labels on this metric data when you display it.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the count of production days days since scrap was reported for lines.
-
{ "line_id": 28, "line_code": "CODE 1", "line_categories": [1], "production_days_since": 29, "last_occurred": "2019-03-2019 01:00:00", "line_description": "Description text for line" }
-
- error (Optional) - Error message if success is false.
Reporting Method: Production: Max Days Since Last Scrap
URL: https://company.leading2lean.com/api/1.0/reporting/production/max_days_since_last_scrap/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- line_code (Optional*) – Optionally filter by a line by specifying a line code. Example: linecode=line-a
- line_externalid (Optional*) – Optionally filter by a line by specifying a line externalid. Example: line_externalid=line-ext-1
- line_id (Optional*) – Optionally filter by a line by specifying a line id. Example: line_id=21
- start (Optional) - The start date of the time frame to find the max days since last scrap formatted as: "%Y-%m-%d %H:%M" Example: 2019-04-24 05:30
- end (Optional) - The end date of the time frame to find the max days since last scrap formatted as: "%Y-%m-%d %H:%M" Example: 2019-04-30 04:29
- format=xml (Optional) – Returns the results in xml format instead of json.
Notes and Limitations:
- *To reduce load on the system, you must specify one of the three line filters.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the count of production days days since scrap was reported for lines.
-
{ "line_id": 28, "line_code": "CODE 1", "line_categories": [1], "max_production_days_since": 29, "line_description": "Description text for line" }
-
- error (Optional) - Error message if success is false.
Reporting Method: Production: Days Since Last Dispatch
URL: https://company.leading2lean.com/api/1.0/reporting/production/days_since_last_dispatch/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- dispatchtype_id (Required) - Specify the dispatch type id to filter for dispatch type.
- area_id= (Optional*) - Limit the search to dispatches for lines in the given area.
- linecode (Optional*) – Optionally filter by a list of lines by specifying a list of comma-delimited line codes. Example: linecode=line-a,line-b,line-c
- line_externalid (Optional*) – Optionally filter by a list of lines by specifying a list of comma-delimited line externalids. Example: line_externalid=line-ext-1,line-ext-2,line-ext-3
- line_id(Optional*) – Optionally filter by a list of lines by specifying a list of comma-delimited line ids. Example: line_id=21,15,47
- format=xml (Optional) – Returns the results in xml format instead of json.
Notes and Limitations:
- *To reduce load on the system, you must specify either an area (all lines in the area), or one of the three line filters, and a dispatch type id.
- To reduce load on the system the report only returns results over the past 365 days. This mean if there was scrap reported 365 days ago, the value of production_days_since will be 0.
- Production administrators for each site have the ability in the Production Settings screen to rename various production metrics to meet their needs. While these don’t change very often, this API has been designed to use the underlying L2L metric names to avoid breaking integrations when these metrics get renamed in the user interface. It is your responsibility to ensure you are using the correct labels on this metric data when you display it.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data -
- data - On success, returns the count of production days days since dispatch was reported for lines.
-
{ "line_id": 28, "line_code": "CODE 1", "line_categories": [1], "production_days_since": 29, "last_occurred": "2019-03-2019 01:00:00", "line_description": "Description text for line" }
-
- error (Optional) - Error message if success is false.
Reporting Method: Production: Days Since Last Scrap
URL: https://company.leading2lean.com/api/1.0/reporting/production/oee_sites/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site to use for base calculations
- start (Required) – The start date to use for pitches in a formatted as: "%Y-%m-%d %H:%M" Example: 2019-04-24 05:30
- end (Required) – The end date to use for pitches in a formatted as: "%Y-%m-%d %H:%M" Example: 2019-04-30 04:29
- sites – The sites to pull data from. If none is sent, only the site parameter will be used.
- format=xml (Optional) – Returns the results in xml format instead of json.
Notes and Limitations:
- To reduce load on the system, the maximum amount of days between start and end must be 31 or less.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns aggregate of all sites data as overall_data, aggregate of each individual site in an array as site_data, and aggregate daily data in an array as chart_data.
- payload - Each piece of data has a payload object that contains the following data for the specified time/aggregate along with the sites sent in color thresholds for their values:
-
{ "payload": { "quality_yellow_green": 90.0, "oa_red_yellow": 80.0, "oee_red_yellow": 80.0, "oee_yellow_green": 90.0, "oa": 88, "performance_red_yellow": 80.0, "oa_yellow_green": 90.0, "performance_yellow_green": 90.0, "performance": 49, "quality": 100, "quality_red_yellow": 80.0, "oee": 43 } }
-
- error (Optional) - Error message if success is false.
Reporting Method: User Skills: Training Duration
URL: https://company.leading2lean.com/api/1.0/reporting/userskills/training_duration/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- skill_code (Optional*) – Optionally filter by a list of skills by specifying a list of comma-delimited skill codes. Example: code=skill-a,skill-b,skill-c
- skill_externalid (Optional*) – Optionally filter by a skills of lines by specifying a list of comma-delimited skill external ids. Example: external_id=skill-ext-1,skill-ext-2,skill-ext-3
- skill_id (Optional*) – Optionally filter by a list of skills by specifying a list of comma-delimited skill ids. Example: id=21,15,47
- format=xml (Optional) – Returns the results in xml format instead of json.
Notes and Limitations:
- *To reduce load on the system you must filter between 1-50 skills using skill codes, skill external ids, or skill ids.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the all userskills under specified skills and their training duration
- Example daily record:
{ "skill_code": "Skill A", "user_id": 1212, "trained_on": "2019-09-05 10:48:00", "training_duration_minutes": 36, "skill_revision": 4, "skill_level_name": "Trainee", "created_on": "2019-09-05 10:43:46", "skill_level": 1, "skill_description": "How to do skill A", "loginid": "132454" }
- Example daily record:
- error (Optional) - Error message if success is false.
Reporting Method: User Skills: Level Count
URL: https://company.leading2lean.com/api/1.0/reporting/userskills/skill_count/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- skill_code (Optional*) – Optionally filter by a list of skills by specifying a list of comma-delimited skill codes. Example: code=skill-a,skill-b,skill-c
- skill_externalid (Optional*) – Optionally filter by a skills of lines by specifying a list of comma-delimited skill external ids. Example: external_id=skill-ext-1,skill-ext-2,skill-ext-3
- skill_id (Optional*) – Optionally filter by a list of skills by specifying a list of comma-delimited skill ids. Example: id=21,15,47
- role_code (Optional*) – Optionally filter by a list of roles assigned to a by specifying a list of comma-delimited role codes. Example: code=role-a,role-b,role-c
- role_externalid (Optional*) – Optionally filter by a roles assigned to a skill of lines by specifying a list of comma-delimited role external ids. Example: external_id=role-ext-1,role-ext-2,role-ext-3
- role_id (Optional*) – Optionally filter by a list of roles assigned with a skill by specifying a list of comma-delimited role ids. Example: id=21,15,47
- line_code (Optional*) – Optionally filter by a list of lines assigned to a by specifying a list of comma-delimited line codes. Example: code=line-a,line-b,line-c
- line_externalid (Optional*) – Optionally filter by a lines assigned to a skill of lines by specifying a list of comma-delimited line external ids. Example: external_id=line-ext-1,line-ext-2,line-ext-3
- line_id (Optional*) – Optionally filter by a list of lines assigned with a skill by specifying a list of comma-delimited line ids. Example: id=21,15,47
- format=xml (Optional) – Returns the results in xml format instead of json.
Notes and Limitations:
- *To reduce load on the system you must filter between 1-50 skills using skill/role/line codes, ids, external ids.
Returns:
By default the API will return a json object with the following fields.
- success - Returns either true or false.
- data - On success, returns the a count of user skills for each skill level.
- Example daily record:
{ "skill_id": 354, "skill_code": "Skill Code A", "levels": [ { "count": 15, "name": "In Training", "level": 1 }, { "count": 23, "name": "Trained", "level": 2 } ] }
- Example daily record:
- error (Optional) - Error message if success is false.
Reporting Method: Skills Data: Skills Info
URL: https://company.leading2lean.com/api/1.0/reporting/skillsdata/skillsinfo/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- limit (Optional*) – Specify the number of items to return in the response. The maximum is 5000, defaults to 1000.
- since (Optional*) – A datetime parameter following the standard API datetime format to limit the response to just data since the last call sequence.
- lastid (Optional*) – This should be set to the lastid value from each previous call during a call sequence, or should not be set for the initial call.
Notes:
- This API is intended for use in caching skills information in a separate system. Each time data needs to be updated, you can iterate over the whole data set or just get changes since the last call sequence. The following is a small example of how to use this api to load all skills data, and then get updates using python 3.7 compatible code. This example is simplified for documentation and would need to use a real datastore, error checking, and rate limiting logic.
from datetime import datetime import requests def start_skills_cache(mycompany, apikey, site, limit=4000): url = f'https://{mycompany}.leading2lean.com/api/1.0/reporting/skillsdata/skillsinfo/' params = {'auth': apikey, 'site': site, 'limit': limit} skills = dict() lastid = None while True: resp = requests.get(url, params=params) respjson = resp.json() for si in respjson['data']: lastid = si['id'] if lastid in skills: raise Exception("Already got id: %d, %r" % (lastid, si)) si['lastupdated_dt'] = datetime.strptime(si['lastupdated'], "%Y-%m-%d %H:%M:%S") skills[lastid] = si print('Skills count: %d after %d more results' % (len(skills), len(respjson['data']))) # this is the sign we've gotten all the data, we can stop now if len(respjson['data']) < limit: break # set the lastid for the next call params['lastid'] = lastid return skills def update_skills_cache(skills, mycompany, apikey, site, limit=4000): url = f'https://{mycompany}.leading2lean.com/api/1.0/reporting/skillsdata/skillsinfo/' # we grab what the current max lastupdated value is so we can just process the updated skills max_lastupdated_key = max(skills.keys(), key=(lambda k: skills[k]['lastupdated_dt'])) params = {'auth': apikey, 'site': site, 'limit': limit, 'since': skills[max_lastupdated_key]['lastupdated']} while True: resp = requests.get(url, params=params) respjson = resp.json() for si in respjson['data']: skills[si['id']] = si si['lastupdated_dt'] = datetime.strptime(si['lastupdated'], "%Y-%m-%d %H:%M:%S") lastid = si['id'] print('Skills updates:', len(respjson['data'])) if len(respjson['data']) < limit: break params['lastid'] = lastid if __name__ == "__main__": company = 'mycompany' apikey = 'myapikey' site = 1 skills = start_skills_cache(company, apikey, site) update_skills_cache(skills, company, apikey, site)
Returns:
This API supports json only and will return a json object as follows:
{ 'success': <bool - True if the API call succeeded, false otherwise>, 'error': <string - optional error message if success if false>, 'data': [ { 'id': <int - Skill Internal ID>, 'code': '<string - Skill Code>', 'description': '<string - Skill Description>', 'externalid': '<string - Skill External ID>', 'created': '<datetime string - Skill record creation date>', 'lastupdated': '<datetime string - Skill record lastupdated date>', 'applies_to_all_products': <bool - does this skill apply to all products>, # this is the skills category information for the skill 'category': { 'id': <int - Skills Category Internal ID>, 'code': '<string - Skills Category Code>', 'name': '<string - Skills Category Name>', } # this is a list of ProductComponents this skill applies to 'productcomponents': [ { 'id': <int - ProductComponent Internal ID>, 'code': '<string - ProductComponent Code>', }, ... ], # this is a list of active Skill Revisions that have been made for this Skill 'revisions': [ { 'id': <int - Skill Revision Internal ID>, 'number': <int - Skill Revision Number>, 'externalid': '<string - Skill Revision External ID>', 'effective_start': '<datetime string - Skill Revision start date>', 'effective_end': '<datetime string - Skill Revision end date>', 'retrain_days': <int - The number of days until a user has to be retrained since their last training>, 'created': '<datetime string - Skill Revision record creation date>', 'lastupdated': '<datetime string - Skill Revision record lastupdated date>', }, ... ], # this is a list of Skill Level Required rules for this Skill. These can be linked to roles, lines, or # machines. 'requirements': [ { 'id': <int - Skill Level Requirement Internal ID>, 'created': '<datetime string - Skill Level Requirement record creation date>', 'lastupdated': '<datetime string - Skill Level Requirement record lastupdated date>', 'minimum_skill_level': { 'level': <int - Skill Level required for Skill>, 'name': '<string - Skill Level name>', 'description': '<string - Skill Level Description>', }, 'roles': [ { 'id': <int - Role Internal ID>, 'code': '<string - Role Code>', 'description': '<string - Role Description>', }, ... ], 'lines': [ { 'id': <int - Line Internal ID>, 'code': '<string - Line Code>', 'description': '<string - Line Description>', }, ... ], 'machines': [ { 'id': <int - Machine Internal ID>, 'code': '<string - Machine Code>', 'description': '<string - Machine Description>', }, ... ] }, ... ], }, ... ] }
Reporting Method: Skills Data: User Training
URL: https://company.leading2lean.com/api/1.0/reporting/skillsdata/usertraining/?auth=<API_Key>
HTTP Method: GET
Parameters:
- auth (Required) – This is your authentication (API Key).
- site (Required) – Specify the site code
- limit (Optional*) – Specify the number of items to return in the response. The maximum is 5000, defaults to 1000.
- since (Optional*) – A datetime parameter following the standard API datetime format to limit the response to just data since the last call sequence.
- lastid (Optional*) – This should be set to the lastid value from each previous call during a call sequence, or should not be set for the initial call.
Notes:
- This API is intended for use in caching User training information in a separate system. Each time data needs to be updated, you can iterate over the whole data set or just get changes since the last call sequence. The following is a small example of how to use this api to load all skills data, and then get updates using python 3.7 compatible code. This example is simplified for documentation and would need to use a real datastore, error checking, and rate limiting logic.
from datetime import datetime import requests def start_usertraining_cache(mycompany, apikey, site, limit=4000): url = f'https://{mycompany}.leading2lean.com/api/1.0/reporting/skillsdata/usertraining/' params = {'auth': apikey, 'site': site, 'limit': limit} usertraining = dict() lastid = None while True: resp = requests.get(url, params=params) respjson = resp.json() for ut in respjson['data']: lastid = ut['id'] if lastid in usertraining: raise Exception("Already got id: %d, %r" % (lastid, ut)) ut['lastupdated_dt'] = datetime.strptime(ut['lastupdated'], "%Y-%m-%d %H:%M:%S") usertraining[lastid] = ut print('User Training Event count: %d after %d more results' % (len(usertraining), len(respjson['data']))) # this is the sign we've gotten all the data, we can stop now if len(respjson['data']) < limit: break # set the lastid for the next call params['lastid'] = lastid return usertraining def update_usertraining_cache(usertraining, mycompany, apikey, site, limit=4000): url = f'https://{mycompany}.leading2lean.com/api/1.0/reporting/skillsdata/usertraining/' # we grab what the current max lastupdated value is so we can just process the updated skills max_lastupdated_key = max(usertraining.keys(), key=(lambda k: usertraining[k]['lastupdated_dt'])) params = {'auth': apikey, 'site': site, 'limit': limit, 'since': usertraining[max_lastupdated_key]['lastupdated']} while True: resp = requests.get(url, params=params) respjson = resp.json() for ut in respjson['data']: usertraining[ut['id']] = ut ut['lastupdated_dt'] = datetime.strptime(ut['lastupdated'], "%Y-%m-%d %H:%M:%S") lastid = ut['id'] print('User Training Event updates:', len(respjson['data'])) if len(respjson['data']) < limit: break # set the lastid for the next call params['lastid'] = lastid if __name__ == "__main__": company = 'mycompany' apikey = 'myapikey' site = 1 skills = start_skills_cache(company, apikey, site) update_skills_cache(skills, company, apikey, site)
Returns:
This API supports json only and will return a json object as follows:
{ 'success': <bool - True if the API call succeeded, false otherwise>, 'error': <string - optional error message if success if false>, 'data': [ { 'id': <int - Internal ID for the User Training Event>, 'user_id': <int - Internal ID for the user trained>, 'user_loginid': '<string - username of the user trained>', 'skill_id': <int - the internal ID of the Skill the user training was for>, 'skill_level': <int - the level the user was trained at>, 'skill_level_name': '<string - the name of the level the user was trained at>, 'skill_revision_id': <int - Internal ID for the Skill Revision used>, 'trainer_user_id': <int - Internal ID for the trainer doing the training (optional)>, 'trainer_user_loginid': '<string - username of the trainer doing the training (optional)>, 'trained_on': '<datetime string - date training event occurred>', 'training_duration': <int - number of minutes that training event took>, 'acknowledged': <null (user has not acknowleged training), true (user acknowledges being trained), or false (user disagrees with being trained)>, 'acknowledged_on': '<datetime string - date user acknowledged training event>', 'created': '<datetime string - Skill Training Event record creation date>', 'lastupdated': '<datetime string - Skill Training Event record last updated date>', 'retrain_date': '<datetime string - date the user will need retraining>', 'last_used_skill', '<datetime string - date the user last used the referenced skill>', 'last_skill_reset', '<datetime string - the date the user training was last reset>', }, ... ] }
Reporting API Documentation
Below is a list of supported reporting API methods with access to summarized reporting data that is useful for external reporting uses.
- Production: Daily Summary Data by Line
- Production: Weekly Summary Data by Line
- Production: Days Since Last Scrap
- Production: Max Days Since Last Scrap
- Production: Days Since Last Dispatch
- Production: OEE Aggregate Sites
- User Skills: Training Duration
- User Skills: Level Count
- Skills Data: Skills Info
- Skills Data: User Training
Supported Barcode Formats
Below is a list of supported barcode formats for use with production model APIs.
Format | Description |
---|---|
auspost | AusPost 4 State Customer Code |
azteccode | Aztec Code |
aztecrune | Aztec Runes |
bc412 | BC412 |
coop2of5 | COOP 2 of 5 |
channelcode | Channel Code |
rationalizedCodabar | Codabar |
codablockf | Codablock F |
code11 | Code 11 |
code128 | Code 128 |
code16k | Code 16K |
code2of5 | Code 25 |
code39 | Code 39 |
code39ext | Code 39 Extended |
code49 | Code 49 |
code93 | Code 93 |
code93ext | Code 93 Extended |
codeone | Code One |
azteccodecompact | Compact Aztec Code |
pdf417compact | Compact PDF417 |
raw | Custom 1D symbology |
daft | Custom 4 state symbology |
datamatrix | Data Matrix |
datamatrixrectangular | Data Matrix Rectangular |
datalogic2of5 | Datalogic 2 of 5 |
identcode | Deutsche Post Identcode |
leitcode | Deutsche Post Leitcode |
dotcode | DotCode |
ean13 | EAN-13 |
ean13composite | EAN-13 Composite |
ean2 | EAN-2 (2 digit addon) |
ean5 | EAN-5 (5 digit addon) |
ean8 | EAN-8 |
ean8composite | EAN-8 Composite |
flattermarken | Flattermarken |
gs1-cc | GS1 Composite 2D Component |
gs1datamatrix | GS1 Data Matrix |
gs1datamatrixrectangular | GS1 Data Matrix Rectangular |
databarexpanded | GS1 DataBar Expanded |
databarexpandedcomposite | GS1 DataBar Expanded Composite |
databarexpandedstacked | GS1 DataBar Expanded Stacked |
databarexpandedstackedcomposite | GS1 DataBar Expanded Stacked Composite |
databarlimited | GS1 DataBar Limited |
databarlimitedcomposite | GS1 DataBar Limited Composite |
databaromni | GS1 DataBar Omnidirectional |
databaromnicomposite | GS1 DataBar Omnidirectional Composite |
databarstacked | GS1 DataBar Stacked |
databarstackedcomposite | GS1 DataBar Stacked Composite |
databarstackedomni | GS1 DataBar Stacked Omnidirectional |
databarstackedomnicomposite | GS1 DataBar Stacked Omnidirectional Composite |
databartruncated | GS1 DataBar Truncated |
databartruncatedcomposite | GS1 DataBar Truncated Composite |
gs1northamericancoupon | GS1 North American Coupon |
gs1qrcode | GS1 QR Code |
gs1-128 | GS1-128 |
gs1-128composite | GS1-128 Composite |
ean14 | GS1-14 |
hibcazteccode | HIBC Aztec Code |
hibccodablockf | HIBC Codablock F |
hibccode128 | HIBC Code 128 |
hibccode39 | HIBC Code 39 |
hibcdatamatrix | HIBC Data Matrix |
hibcdatamatrixrectangular | HIBC Data Matrix Rectangular |
hibcmicropdf417 | HIBC MicroPDF417 |
hibcpdf417 | HIBC PDF417 |
hibcqrcode | HIBC QR Code |
hanxin | Han Xin Code |
iata2of5 | IATA 2 of 5 |
isbn | ISBN |
ismn | ISMN |
issn | ISSN |
itf14 | ITF-14 |
industrial2of5 | Industrial 2 of 5 |
interleaved2of5 | Interleaved 2 of 5 (ITF) |
code32 | Italian Pharmacode |
japanpost | Japan Post 4 State Customer Code |
msi | MSI Modified Plessey |
matrix2of5 | Matrix 2 of 5 |
maxicode | MaxiCode |
microqrcode | Micro QR Code |
micropdf417 | MicroPDF417 |
symbol | Miscellaneous symbols |
pdf417 | PDF417 |
pharmacode | Pharmaceutical Binary Code |
pzn | Pharmazentralnummer (PZN) |
plessey | Plessey UK |
posicode | PosiCode |
qrcode | QR Code |
kix | Royal Dutch TPG Post KIX |
royalmail | Royal Mail 4 State Customer Code |
sscc18 | SSCC-18 |
telepen | Telepen |
telepennumeric | Telepen Numeric |
pharmacode2 | Two-track Pharmacode |
upca | UPC-A |
upcacomposite | UPC-A Composite |
upce | UPC-E |
upcecomposite | UPC-E Composite |
onecode | USPS Intelligent Mail |
planet | USPS PLANET |
postnet | USPS POSTNET |