Manufacturing Execution System (MES) : Web Api

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 110

Manufacturing Execution System (MES)

Web API

Reference

Version 6.0
June, 2018
© 2018 AVEVA Group plc or its subsidiaries. All rights reserved.
The Schneider Electric industrial soft ware business and AVEVA have merged to trade as AVEVA Group
plc, a UK listed company. The Schneider Electric and Life is On trademarks are owned by Schneider
Electric and are being licensed to AVEVA by Schneider Electric.
No part of this documentation shall be reproduced, stored in a ret rieval system, or transmitted by any
means, electronic, mechanical, photocopying, rec ording, or otherwise, without the prior written
permission of AVEVA. No liability is assumed with respect to the use of the information contained herein.
Although precaution has been taken in the preparation of this documentation, AV EVA assumes no
responsibility for errors or omissions. The information in this documentation is subject to change without
notice and does not represent a commitment on the part of AVEVA. The soft ware described in this
documentation is furnished under a license agreement. This soft ware may be used or copied only in
accordance with the terms of such license agreement.
ArchestrA, Aquis, Avantis, DYNS IM, eDNA, EYESIM, InBatch, InduSoft, InStep, IntelaTrac, InTouch,
PIPEPHASE, PRiSM, PRO/II, PROV IS ION, ROMeo, SIM4ME, SimCentral, SimSci, Skelta,
SmartGlance, Spiral Software, Termis, WindowMaker, WindowViewer, and Wonderware are trademarks
of AVEVA and/or its subsidiaries. An extensive listing of AVEVA trademarks can be found at:
https://sw.aveva.com/legal. All other brands may be trademarks of their respective owners.
Publication date: 6/29/2018
Contact Information
AVEVA Group plc
High Cross
Madingley Road
Cambridge
CB3 OHB. UK
https://sw.aveva.com/
For information on how to cont act sales, customer training, and technical support, see
https://sw.aveva.com/contact.
MES Web API Reference

Contents
Chapter 1 Introduction........................................................................................................... 7
About the MES Web API ........................................................................................................... 7
Method Format and Syntax ........................................................................................................ 7
Error Messages ........................................................................................................................ 8

Chapter 2 Entity and Line Endpoints .................................................................................. 9


Get Entities By Filter ................................................................................................................. 9
Get an Entity by Its ID ............................................................................................................. 11
Get the Status of an Entity ....................................................................................................... 13
Get the Shifts for an Entity ....................................................................................................... 15
Get Information About All Lines or a Specific Line ..................................................................... 15
Get Entities in a Line ............................................................................................................... 17
Get Production or Bottleneck Entities on a Line ......................................................................... 18
Get Potential Parent Entities of a Line ...................................................................................... 21
Get All Available Entities for a Line ........................................................................................... 21

Chapter 3 Production Endpoints ....................................................................................... 25


Get Items ............................................................................................................................... 25
Get All Item Classes ................................................................................................................ 27
Get Items Produced on a Line.................................................................................................. 28
Get Item-Process Links and Their Status .................................................................................. 29
Get Item Reasons ................................................................................................................... 31
Get All Item Reason Groups .................................................................................................... 32
Get BOM Versions .................................................................................................................. 33
Get Operation Specification Versions for a Process................................................................... 34
WorkOrder Endpoint ............................................................................................................... 35
Get Work Orders Filtered by Overall Status, Line, and Time Period ...................................... 35
Get Work Orders Filtered by Job-Related Status, Line, Time Period, and Other Parameters .. 39
Get Work Orders Run on a Line ............................................................................................... 44
Jobs Endpoint ......................................................................................................................... 46
Get the Jobs for a Work Order ........................................................................................... 46
Get a Specific Job ............................................................................................................. 46
Jobs Endpoints Return Value ............................................................................................. 47
Get Jobs in the Job Queue ...................................................................................................... 49
Get Job BOM Data.................................................................................................................. 54

Version 6.0 3
MES Web API Reference Contents

Get Job BOM Substitute Data .................................................................................................. 58


Get Job Specific ations ............................................................................................................. 59
Get the Job States .................................................................................................................. 61
Get the Job Executor Record for an Entity ................................................................................ 62
Get Item Production for a Job .................................................................................................. 63
Get Item Consumption for a Job............................................................................................... 67

Chapter 4 Utilization Endpoints ......................................................................................... 71


Get Utilization States ............................................................................................................... 71
Get Utilization Reason Groups ................................................................................................. 73
Get Utilization Reasons ........................................................................................................... 74
Get Utilization Reasons as Key/Value Pairs .............................................................................. 76
Get Utilization Reason Cat egory Sets of Values ........................................................................ 76
Get Allowable Utilization Reasons for an Entity ......................................................................... 77
Get All Utilization Executor Records ......................................................................................... 77
Get the Utilization Executor Record for an Entity ....................................................................... 78
Get the OEE Executor Record for an Entity .............................................................................. 80
Get the Utilization History E vents for an Entity .......................................................................... 81
Get a Specific Utilization History E vent ..................................................................................... 83
Get Utilization Counts and Durations for an Entity or Line .......................................................... 85
KPI Endpoint .......................................................................................................................... 87
Get Selected KPI Data for an Entity .................................................................................... 87
Get All KPI Data for a Line ................................................................................................. 88
KPI Endpoint Return Value ................................................................................................ 89

Chapter 5 Attribute Endpoints............................................................................................ 91


Get All Attributes ..................................................................................................................... 91
Get All Attribute Sets ............................................................................................................... 92
Get the Attributes for an Entity ................................................................................................. 92
Get a System Attribute ............................................................................................................ 93

Chapter 6 User, Language, and License Endpoints ...................................................... 95


Get a User’s Default Language ................................................................................................ 95
Get a User’s Entity Access Information ..................................................................................... 96
Get a User’s Line Access Information ....................................................................................... 96
Get All User Groups ................................................................................................................ 97
Get Access Information for User Groups to a Line (api/line) ....................................................... 98
Get Access Information for User Groups to a Line (api/GroupLineAccess) .................................. 98
Get the Privilege Status for a User ........................................................................................... 99
Get Translated Strings........................................................................................................... 100
Get MES Licenses ................................................................................................................ 100

4 Version 6.0
Contents MES Web API Reference

Chapter 7 Stored Procedure Endpoints ......................................................................... 103


Get the Dataset from an MES Stored Proc edure ..................................................................... 103
Get Data Using an XML Request to Call a Stored Procedure ................................................... 104
Specifying the MES Stored Procedure in the XML Request ................................................ 104
GetAll XML String Format and Example ............................................................................ 105
GetByKey XML String Format and Example ...................................................................... 105
GetSpecific XML String Format and Example .................................................................... 106
Get Data by Specifying the MES Table ................................................................................... 107

Chapter 8 Enumerations ................................................................................................... 109


LineCountsAndDurationGraphType Enumeration .................................................................... 109
Time Period FilterType Enumeration ...................................................................................... 109

Version 6.0 5
MES Web API Reference

C HAPTER 1
Introduction
In This Chapter
About the MES Web API ................................................................................................................. 7
Method Format and Syntax ............................................................................................................. 7
Error Messages .............................................................................................................................. 8

About the MES Web API


The Manufacturing Execution System (MES) Web API provides user access to the MES database
through a support ed interface. The Web API is not a complete API for all functionality of the product and
is being developed over multiple releases of the product. For a complete AP I, use the MES Stateless
API. This Web API exposes the methods used by the MES Web Portal and model -driven MES content
hosted in Enterprise Console.

Note: Only the endpoints included in this document are currently supported.

Method Format and Syntax


The MES Web API includes mostly Get methods to retrieve information from the MES dat abase. These
methods either return a JS ON object or a JSON array. Some Get methods require passing in a filt er
parameter while others have no filter or optional filte r paramet ers. The general format of the Web API is:
API/<end point>?Filter=FilterValue&Filter2=Filter2Value
This document lists all the <end point> names and the corresponding filter parameters. The end point
name is followed by the ? symbol to indicate the start of the filters. If no filters are needed, then do not
include the ? symbol.
To include multiple filters, separate each with the & symbol.
Endpoint entries are case insensitive.
Throughout this document, the syntax section will indicate user-provided text within angle brackets (e.g.,
<description> ). When making the Web API call, do not include the symbols with the text. See the
examples if more clarification is needed.
The MES Web API includes a few Put methods to insert or update dat a within the MES database. These
are used exclusively by the MES Web Port al to execute trans actions such as start a job, report
production, or record a change in utilization reason.
Method Format and Syntax: Skelta
When using the MES Web API endpoints as Skelta lookups, the parameter names must be enclos ed in
curly brackets {}.
For example, the following endpoint:
api/AvailableLineEnts?name=Roaster12
would look like this when used as a Skelta lookup:
api/AvailableLineEnts?name={name}

Version 6.0 7
MES Web API Reference Introduction

Error Messages
The type of error messages returned by a Web API call depend on the type of met hod called.
 If the method that requires a process ID and you supply a null, you will get a message that the
process ID cannot be null or empty.
 If the message requires a paramet er that was not supplied, you will get a 404 error that the page is
not found as the Web API will not be able to be loc ated because the paramet er is missing.
 If the method has a parameter that is a string and the parameter value is null or empty, or if the value
for a parameter that is an integer or float is out of range (for example, -1 is supplied but the value
must be equal to or greater than 0), an exception will be thrown and the error message that is
returned will be from the database.

8 Version 6.0
MES Web API Reference

C HAPTER 2
Entity and Line Endpoints
In This Chapter
Get Entities By Filter ....................................................................................................................... 9
Get an Entity by Its ID ................................................................................................................... 11
Get the Status of an Entity............................................................................................................. 13
Get the Shifts for an Entity............................................................................................................. 15
Get Information About All Lines or a Specific Line ........................................................................... 15
Get Entities in a Line ..................................................................................................................... 17
Get Production or Bottleneck Entities on a Line .............................................................................. 18
Get Potential Parent Entities of a Line ............................................................................................ 21
Get All Available Entities for a Line ................................................................................................ 21

Get Entities By Filter


Gets one or more entities, as specified by the entity name, description, and canStore filter parameters.
Passing no filter parameters will retrieve all entities.
Syntax
api/entity?name=<entity name>&description=<entity description>&canStore=<true
or false>
Parameters
name
Optional string. An entity name.
This can be a partial name, in which case all entities whose name includes this string will be
considered a match.
description
Optional string. An entity description.
This can be a partial description, in which case all entities whose description includes this string will
be considered a match.
canStore
Optional Boolean. A flag that indicat es whether the entities can serve as a st orage location.
Examples
Get all entities:
api/entity
Get all entities whose name includes Roaster:
api/entity?name=Roaster
Examples: Skelta Lookup
Get all entities:
api/entity
Get all entities, filtered by an entity name:
api/entity?name={name}

Version 6.0 9
MES Web API Reference Entity and Line Endpoints

Return Value
Returns a JSON object that contains the following information for all entities or the specified entity. If no
matching entities are found, an empty object is returned.

Data Name Description

EntID An integer that is the ID of the entity.


EntName A string that is the name of the entity.
EntDescription A string that is the description of the entity.
ParentID An integer that is the ID of the parent from which this entity will inherit
entity associations that can only be inherited from one parent entity, such
as a shift schedule. For a top-level entity, the value will be null.

PreferredParent A Boolean that indicates whether the parent entity identified by the
ParentID column value is the preferred parent.
For entities with multiple parents, the default parent entity —or preferred
parent—determines at which parent entity the system will look when
determining the entity's inherited associations.
 If the preferred parent has the entity associations that can only be
inherited from one parent entity, such as a shift schedule, this flag
will be true.
 If the preferred parent does not have any of the entity associations
that can only be inherited from one parent entity, such as a shift
schedule, the system looks up through the preferred parent's
ancestors for a parent that does. That parent will be the one
identified by the ParentID column value and this flag will be false.
CanSchedJobs A Boolean that indicates whether jobs can be scheduled to this entity.

CanRunJobs A Boolean that indicates whether jobs can be run on this entity.
CanCaptureUtil A Boolean that indicat es whether utilization data can be captured on this
entity.
CanCaptureLabor A Boolean that indicates whether labor data can be captured on this
entity.
CanTrackOEE A Boolean that indicates whether OEE statistics can be captured on this
entity.
CanSchedS hifts A Boolean that indicates whether shifts can be scheduled for this entity.

CanStore A Boolean that indicates whether this entity can be a "warehouse" or


storage location.
CanLogData A Boolean that indicates whether this entity can log data.
CanS hip A Boolean that indicates whether shipments can be made from this
entity.
CanReceive A Boolean that indicates whether material can be received at this entity.

10 Version 6.0
Entity and Line Endpoints MES Web API Reference

Data Name Description

CanCopyFolders A Boolean that indicates whether files in folders for this entity can be
copied to its download directories.
CanCaptureQMDat a A Boolean that indicates whether this entity can capture QM data and
have sample requests generated for it.
Spare1 A string that is the contents of the spare1 field.
Spare2 A string that is the contents of the spare2 field.
Spare3 A string that is the contents of the spare3 field.
Spare4 A string that is the contents of the spare4 field.
IndenticalJobExecs An integer that is the maximum number of jobs that can be run at the
same time on this entity. For an entity on a line, this value will be either 0
or 1.
If 0 is returned, it has the same meaning as 1; that is, only one job c an be
run at a time on the entity.
last_edit_at A datetime, in UTC, that identifies when the record was added or last
modified.
exact_match A Boolean that indicates whether the entity can run jobs, can capture
utilization, can track OEE, has only one job position, is not linked to any
line (as a parent or child), has a non-null default production rate, and
matches the filter criteria.
Entities for which this flag is true are eligible to be added to a line.

Get an Entity by Its ID


Gets the entity specified by the entity ID.
Syntax
api/entity/<entityID>
Parameters
entityID
Required integer. The entity ID.
Examples
To get the entity with an ID of 28:
api/entity/28
Examples: Skelta Lookup
To get an entity:
api/entity/{entityID}
Return Value
Returns a JSON object that contains the following information for the specified entity. If no matching
entity is found, an empty object is returned.

Data Name Description

EntID An integer that is the ID of the entity.

Version 6.0 11
MES Web API Reference Entity and Line Endpoints

Data Name Description

EntName A string that is the name of the entity.


EntDescription A string that is the description of the entity.
ParentID An integer that is the ID of the parent from which this entity will inherit
entity associations that can only be inherited fr om one parent entity, such
as a shift schedule. For a top-level entity, the value will be null.

PreferredParent A Boolean that indicates whether the parent entity identified by the
ParentID column value is the preferred parent.
For entities with multiple parents, the default parent entity —or preferred
parent—determines at which parent entity the system will look when
determining the entity's inherited associations.
 If the preferred parent has the entity associations that can only be
inherited from one parent entity, such as a shift schedule, this flag
will be true.
 If the preferred parent does not have any of the entity associations
that can only be inherited from one parent entity, such as a shift
schedule, the system looks up through the preferred parent's
ancestors for a parent that does. That parent will be the one
identified by the ParentID column value and this flag will be false.
CanSchedJobs A Boolean that indicates whether jobs can be scheduled to this entity.

CanRunJobs A Boolean that indicates whether jobs can be run on this entity.
CanCaptureUtil A Boolean that indicat es whether utilization data can be captured on this
entity.
CanCaptureLabor A Boolean that indicates whether labor data can be captured on this
entity.
CanTrackOEE A Boolean that indicates whether OEE statistics can be captured on this
entity.
CanSchedS hifts A Boolean that indicates whether shifts can be scheduled for this entity.

CanStore A Boolean that indicates whether this entity can be a "warehouse" or


storage location.
CanLogData A Boolean that indicates whether this entity can log data.
CanS hip A Boolean that indicates whether shipments can be made from this
entity.
CanReceive A Boolean that indicates whether material can be received at this entity.

CanCopyFolders A Boolean that indicates whether files in folders for this entity can be
copied to its download directories.
CanCaptureQMDat a A Boolean that indicates whether this entity can capture QM data and
have sample requests generated for it.
Spare1 A string that is the contents of the spare1 field.
Spare2 A string that is the contents of the spare2 field.

12 Version 6.0
Entity and Line Endpoints MES Web API Reference

Data Name Description

Spare3 A string that is the contents of the spare3 field.


Spare4 A string that is the contents of the spare4 field.
IndenticalJobExecs An integer that is the maximum number of jobs that can be run at the
same time on this entity. For an entity on a line, this value will be either 0
or 1.
If 0 is returned, it has the same meaning as 1; that is, only one job c an be
run at a time on the entity.
last_edit_at A datetime, in UTC, that identifies when the record was added or last
modified.
exact_match A Boolean that indicates whether the entity can run jobs, can capture util,
can track OEE, has only one job position, is not linked to any line (as a
parent or child), has a non-null default production rate, and matches the
filter criteria.
Entities for which this flag is true are eligible to be added to a line.

Get the Status of an Entity


Gets status information about an entity, as specified by the entity ID.
Syntax
api/entity/<entityId>/EntityStatus
Parameters
entityId
Required integer. The entity ID.
Examples
To get the status of the entity with an ID of 28:
api/entity/28/EntityStatus
Examples: Skelta Lookup
To get the status of an entity:
api/entity/{entityId}/EntityStatus
Return Value
Returns a JSON object that contains the following information for the specified entity. If no matching
entity is found, an empty object is returned. If the entity is running more than one job, then the object will
contain separate sets of entity information for each job.

Data Name Description

ent_id An integer that is the ID of the entity.


ent_name A string that is the name of the entity.
reas_cd An integer that is the current reason for the given entity, from the
Util_Exec table.
reas_desc A string that is the description of the current reason for the given
entity, from the Util_Exec table.

Version 6.0 13
MES Web API Reference Entity and Line Endpoints

Data Name Description

state_desc A string that is the description of the current utilization state for the given
entity, from the Util_State table.
state_color An HTML color string that indicates the current utilization state’s RGB
background color in the user int erface, from the Util_State table.
cur_wo_id A string that is the current work order on the entity, from the Job_Exec
table.
job_desc A string that is the description of the job that is currently running on the
entity.
cur_oper_id A string that is the current operation on the entity, from the Job_Exec
table.
cur_seq_no An integer that is the current operation split, from the Job_Exec table.
item_id A string that is the item resulting from the job on the entity, from the Job
table.
item_display A string that is a value that indicat es what format to use when identifying
the item in the user interface. The format values are defined in the
system attribute Item display (attr_id 210 in the System_Attr table).
Possible values and their formats are:
0 = item_id
1 = item_desc
2 = item_id (item_desc)
3 = item_desc(item_id)

qty_prod A double that is the quantity of acceptable product made so far, from the
Job table. It does not include rejects.
qty_reqd A double that is the quantity of product required, from the Job table.
qty_rejected A double that is the quantity of rejected product so far, from the Job table.
qty_remaining A double that is the quantity defined as the difference between the start
quantity and the sum of the quantity produced and the quantity rejected
(qty_start - (qty_prod + quantity rejected)).
qty_to_do A double that is the quantity of item still required to be made (qty_reqd -
qty_prod).
qty_at_start A double that is the quantity of item that is expected to be produced if
there are no scrap/ waste/rejects, from the Job table.
uom_id An integer that is the ID of the unit of measure. If the job UOM ID is
non-null, then this value comes from the Job table; otherwise, this value
comes from the Item table.
uom_desc A string that is the description of the unit of measure, from t he Uom table.

uom_abbr A string that is the abbreviation of the unit of measure, from the Uom
table.
num_decimals An integer that is the number of decimals for formatting numeric values.

14 Version 6.0
Entity and Line Endpoints MES Web API Reference

Data Name Description

num_decimals_good_pp An integer that is the value of the system attribute Max decimals of good
piece part entries (attr_id 326 in the System_Attr table) and is used when
the num_decimals column is 0.

Get the Shifts for an Entity


If they exist, gets the current shift and the previous non -zero shift for an entity, as specified by the entity
ID. The current shift can be distinguished from the previous shift by the fact that the current shift has no
end time.
Syntax
api/entity/<entityID>/shiftHistory
Parameters
entityID
Required integer. The entity ID.
Examples
To get the shifts for the entity with an ID of 15:
api/entity/15/shiftHistory
Examples: Skelta Lookups
To get the shifts for an entity:
api/entity/{entityID}/shiftHistory
Return Value
Returns a JSON object that contains the following shift information for the specified entity. If no matching
entity is found, an empty object is returned.

Data Name Description

ent_id An integer that is the ID of the entity.


ent_name A string that is the entity name.
shift_id An integer that is the shift ID.
shift_desc A string that is the shift description. If the entity is not in a shift, then the
string will be No Shift (or its translated equivalent ).
shift_start_utc A datetime that is the shift start time, in UTC. If the entity is not in a shift,
then this value will be when the previous shift ended.
shift_end_utc A datetime that is the shift end time, in UTC.

Get Information About All Lines or a Specific Line


Gets information about all lines or for the specified line.
Syntax
api/line/<lineID>
Parameters
lineId
Optional integer. A line ID, to retrieve only the information for a specific line.

Version 6.0 15
MES Web API Reference Entity and Line Endpoints

Examples
To get information for all lines:
api/line
To get information for the line with an ID of 12:
api/line/12
Examples: Skelta Lookups
To get information for all lines:
api/line
To get information for one line:
api/line/{lineId}
Return Value
Returns a JSON object that contains the following information for all lines or the specified line. If no
matching line is found, an empty object is returned.

Data Name Description

LineID An integer that is the ID of the line.


LineName A string that is the name of the line.
LineClass A Boolean that specifies whether the line is a line class.
Line classes are not currently supported.
OriginLineClassID An integer that is the ID of the line class from which this line was
instantiated. This value is null for line classes and for lines that were not
instantiated from a line class.
Line classes are not currently supported.
LaborLoad An integer that specifies the number of people required to run the line
that is report ed to ERP.
MaxWo An integer that specifies the maximum number of simultaneous work
orders permitted on the line.
ProdEnt ID An integer that identifies the entity that is the source of the production
amount for the line.
std_item_id A string that identifies the standard item to use for reporting the
production rate.
batch_size A double that identifies the standard batch size for reporting the
production rate.
prod_uom An integer that represents the production unit of meas ure:
0 = hours/batch
1 = minutes/batch
2 = seconds/batch
3 = batches/hour
4 = batches/minute
5 = batches/second

16 Version 6.0
Entity and Line Endpoints MES Web API Reference

Data Name Description

BottleneckEntID An integer that identifies the entity that is designated as the bottleneck on
the line. Other entities in the same child order position as the bottleneck
entity will also be considered to be bottleneck entities.
TargetUtil A double that repres ents the KPI target for utilization (availability).

TargetQual A double that repres ents the KPI target for quality.

TargetPerf A double that repres ents the KPI target for performance.

TargetOee A double that repres ents the KPI target for OEE.

Spare1 A string that is the contents of the spare1 field.


Spare2 A string that is the contents of the spare2 field.
Spare3 A string that is the contents of the spare3 field.
Spare4 A string that is the contents of the spare4 field.
LineE ntLinks An array that is a list of the line-entity links for the line. The array structure
is the same as that for the object that is returned by the endpoint
described in Get Entities in a Line on page 17.

Get Entities in a Line


Gets all entities or a specific entity that have been assigned to a line by retrieving Line -Entity link
information for the specified line.
Syntax
api/line/<lineID>/entity/<entityID>
Parameters
lineID
Required integer. The line ID.
entityID
Optional integer. The entity ID, to retrieve the link information for only a specific entity.
Examples
To get link information for all entities in a line with an ID of 13:
api/line/13/entity
To get link information only for the entity with an ID of 28 in a line with an ID of 13:
api/line/13/entity/28
Examples: Skelta Lookups
To get link information for all entities in a line:
api/line/{lineID}/entity
To get link information only for one entity in a line:
api/line/{lineID}/entity/{entityID}
Return Value
Returns a dataset that contains dat arows for each entity or for a specific entity in the specified line, from
the Line_Ent_Link table. If no line-entity link records are not found, an empty dataset is returned.

Version 6.0 17
MES Web API Reference Entity and Line Endpoints

Returns a JSON object that contains the following link information for each entity or for a specific entity in
the specified line. If no matching line-entity link is found, an empty object is returned.

Data Name Description

LineID An integer that is the ID of the line.


EntID An integer that is the ID of the entity or entity class.
ChildOrder An integer that returns the relative order number of the entity in a line.

InputPct A double that indicates for parallel entities in a line how much of the
outflow from the set of child entities with the same parent and a
child_order that is the next lower value to this one goes to the child entity.

LineIsChild A Boolean that indicates whet her the entity belongs to the line. If true, the
entity belongs to the line. If false, the entity is the parent of the line (e. g.,
the entity is a building or a site).
SegmentNo An integer that is the line segment number of the line of which the entity
is a part. This value will be null (the default) if the entity is not part of a line
segment. It will always be null if the line_is_child flag is true.
It should not be possible to save a line for which this value is not null for
at least two adjacent child_order values (i.e., no segments that are only
one position long).

EntEnabled A Boolean that, if true (t he default), indicat es that the entity is not to be
bypassed by work orders and, if false, it is to be bypassed by work
orders. This flag is meaningless if line_is_child is true.

CanB eBottleneck A Boolean that, if true (t he default), indicat es that the entity is to be
considered when determining the bottleneck entity for a line. If the entity
cannot run jobs, then the flag will be false.
This flag is not meaningful if line_is_child is true.
For an entity class, this flag's setting serves as a default setting for
entities selected from that class.

Reorder A Boolean that is always false. Currently not implemented.


LastEditAt A datetime that identifies when the rec ord was added or last modified.
MyEntity A JSON array, with each entity in the line being a separat e JSON record
that contains the MyEntity record. For example, if the call is
api\line13\entity, the JSON array would be [{lineID: 13,
entID:1....MyEntity{...}}, {lineID: 13, ent ID2...MyEntity{...}}]. For the
columns returned in each MyEntity record, see the return value for Get
an Entity by Its ID on page 11.

Get Production or Bottleneck Entities on a Line


Gets the production or bottleneck entities on a line.

18 Version 6.0
Entity and Line Endpoints MES Web API Reference

Syntax
api/line/<lineID>/lineEntitySource
?sourceType=<source type>
&filterType=<time period filter>
&filterDuration=<duration for LastNHours filter type>
Parameters
lineID
Required integer. The line ID.
sourceType
Required string. The type of entity to retrieve:
o Production: Retrieve all entities that represent the source of production in the specified line.
o Bottleneck: Retrieve all of the entities of the specified line whose performance count is to be
used for the line's performance calculations based on currently running work orders and line
configuration.
filterType
Optional integer. The ID of the time period filter type to use. For a list of the available filter types, see
Time Period FilterType Enumeration on page 109.
If no filter type is specified, the default value is 2, Current Shift.
filterDuration
Optional integer. If the filter type is set to 1, LastNHours, this is the value for N (that is, the number of
hours). If no value is provided, the default value of 1 hour is used.
Examples
To get the entities in a line with an ID of 13 that have been production entities during the current shift:
api/line/13/lineEntitySource?sourceType=Production
To get the entities in a line with an ID of 13 that have been bottleneck entities within the las t hour:
api/line/13/lineEntitySource
?sourceType=Bottleneck&filterType=0
Examples: Skelta Lookups
To get the entities in a line that have been production or bottleneck entities during the current shift:
api/line/{lineID}/lineEntitySource?sourceType={sourceType}
To get the entities in a line that have been production or bottleneck entities within a time filter:
api/line/{lineID}/lineEntitySource?sourceType={sourceType}&filterType={filte
rType}
Return Value
Returns a JSON object that contains the following information for each entity that matches the filter
parameters, from the Line_Ent_Link table. If no matching entities are found, an empty object is returned
The fields of the returned object are described in the two tables below, depending on whether production
or bottleneck entities are being retrieved.
Production Entities Being Returned

Data Name Description

ent_id An integer that is the ID of the entity.

Bottleneck Entities Being Returned

Version 6.0 19
MES Web API Reference Entity and Line Endpoints

Data Name Description

ent_id An integer that is the ID of the entity.


ent_name A string that is the name of the entity.
slowest_performance_rate A floating point value that represents the slowest performanc e rate on
the line.
If an entity is designated to be a bottleneck, then the production rate
obtained for that entity is returned. Otherwise, the slowest production
rate determined from the line is returned.
std_item_id A string that identifies the standard item to use for reporting the
production rate.
std_item_display A string that is a value that indicat es what format to use when identifying
the item in the user interface. The format values are defined in the
system attribute Item display (attr_id 210 in the System_Attr table).
Possible values and their formats are:
0 = item_id
1 = item_desc
2 = item_id (item_desc)
3 = item_desc(item_id)
batch_size A double that identifies the standard batch size for reporting the
production rate.
batch_size_label A string that is the unit of meas ure for the batch size, based on the
standard item.
prod_uom An integer that represents the production unit of meas ure:
0 = hours/batch
1 = minutes/batch
2 = seconds/batch
3 = batches/hour
4 = batches/minute
5 = batches/second
reas_cd An integer that is the ID of the utilization reason associated with the
bottleneck entity or entities that is the most recent and highest priority.
reas_desc A string that is the description of the utilization reason associated with t he
bottleneck entity or entities that is the most recent and highest priority.

state_cd An integer that is the ID of the utilization state associated with the most
recent and highest priority reas on deduced from the bottleneck entity or
entities.
state_desc A string that is the description of the utilization state associated with the
most recent and highest priority reason deduced from the bottleneck
entity or entities.

20 Version 6.0
Entity and Line Endpoints MES Web API Reference

Data Name Description

color An integer that identifies the dis play color configured for the utilization
state associated with the most recent and highest priority reason
deduced from the bottleneck entity or entities.
warning A string that identifies the warning message shown in the client when the
bottleneck rat e cannot be calculated.

Get Potential Parent Entities of a Line


Gets all entities that could be assigned as the parent entity of a line.
The entity that is the parent of the line is the entity from which the line and its entities inherit their shift
schedules. Only entities that can schedule shifts or their descendants , which inherit the capability to
schedule shifts, can be a parent entity of a line.
Syntax
api/lines/parentEntity
Return Value
Returns a JSON object that contains the following information for each entity that can be a parent entity
of a line. If no matching entities are found, an empty object is returned

Data Name Description

ent_id An integer that is the ID of the entity.


ent_name A string that is the name of the entity.

Get All Available Entities for a Line


Gets all entities that can be added to a line.
To be included in the ret urned JSON object, the entities must have the following properties:
 Can run jobs
 Can capture_utilization
 Can track OEE
 Have only one job position
 Are not linked to any line (as parents or children)
 Have a non-null default production rate
Syntax
api/AvailableLineEnts?name=<entity name>
&description=<entity description>
&canStore=<true or false>
Parameters
name
Optional string. An entity name.
This can be a partial name, in which case all entities whose name includes this string will be
considered a match.

Version 6.0 21
MES Web API Reference Entity and Line Endpoints

description
Optional string. An entity description.
This can be a partial description, in which case all entities whose description includes this string will
be considered a match.
canStore
Optional Boolean. A flag that indicat es whether the entities can serve as a storage location.
Examples
Get all entities that can be added to a line (no filter parameters):
api/AvailableLineEnts
Get all entities whose name contains Roaster12:
api/AvailableLineEnts?name=Roaster12
Get all entities whose name contains Roaster12 and that can serve as a storage location:
api/AvailableLineEnts?name=Roaster12&canStore=true
Examples: Skelta Lookups
Get all entities that can be added to a line (no filter parameters):
api/AvailableLineEnts
Get all entities filtered by an entity name:
api/AvailableLineEnts?name={name}
Get all entities filtered by a name and whet her they can serve as a storage location:
api/AvailableLineEnts?name={name}&canStore={canStore}
Return Value
Returns a JSON object that contains the following information for each entity that satisfies the specified
filter criteria, from the Ent table. If no matching entities are found, an empty object is returned.

Data Name Description

EntID An integer that is the ID of the entity.


EntName A string that is the name of the entity.
EntDescription A string that is the description of the entity.
ParentID An integer that is the ID of the parent from which this entity will inherit
entity associations that can only be inherited from one parent entity, such
as a shift schedule. For a top-level entity, the value will be null.

PreferredParent A Boolean that indicates whether the parent entity identified by the
ParentID column value is the preferred parent.
For entities with multiple parents, the default parent entity —or preferred
parent—determines at which parent entity the system will look when
determining the entity's inherited associations.
 If the preferred parent has the entity associations that can only be
inherited from one parent entity, such as a shift schedule, this flag
will be true.
 If the preferred parent does not have any of the entity associations
that can only be inherited from one parent entity, such as a shift
schedule, the system looks up through the preferred parent's
ancestors for a parent that does. That parent will be the one
identified by the ParentID column value and this flag will be false.

22 Version 6.0
Entity and Line Endpoints MES Web API Reference

Data Name Description

CanSchedJobs A Boolean that indicates whether the jobs can be scheduled t o this entity.

CanRunJobs A Boolean that indicates whether the jobs can be run on this entity. For
an entity on a line, this value will always be True.
CanCaptureUtil A Boolean that indicates whether the utilization data can be captured on
this entity. For an entity on a line, this value will always be True.
CanCaptureLabor A Boolean that indicates whether the labor data can be captured on this
entity.
CanTrackOEE A Boolean that indicates whether the OEE statistics can be captured on
this entity. For an entity on a line, this value will always be True.
CanSchedS hifts A Boolean that indicates whether shifts can be scheduled for this entity.

CanStore A Boolean that indicates whether this entity can be a "warehouse" or


storage location.
CanLogData A Boolean that indicates whether this entity can log data.
CanS hip A Boolean that indicates whether shipments can be made from this
entity.
CanReceive A Boolean that indicates whether material can be received at this entity.

CanCopyFolders A Boolean that indicates whether files in folders for this entity can be
copied to its download directories.
CanCaptureQMDat a A Boolean that indicates whether this entity can capture QM data and
have sample requests generated for it.
Spare1 A string that is the contents of the spare1 field.
Spare2 A string that is the contents of the spare2 field.
Spare3 A string that is the contents of the spare3 field.
Spare4 A string that is the contents of the spare4 field.
IndenticalJobExecs An integer that is the maximum number of jobs that can be run at the
same time on this entity. For an entity on a line, this value will be either 0
or 1.
If 0 is returned, it has the same meaning as 1; that is, only one job c an be
run at a time on the entity.
last_edit_at A datetime, in UTC, that identifies when the record was added or last
modified.
exact_match A Boolean that indicates whether the entities that can run jobs, can
capture util, can track OEE, have only one job position, are not linked to
any line (as parents or children), have a non-null default production rate,
and match the filter criteria.
Entities for whic h this flag is true are eligible to be added to a line. So for
this endpoint, this value will always be true.

Version 6.0 23
MES Web API Reference

C HAPTER 3
Production Endpoints
In This Chapter
Get Items ..................................................................................................................................... 25
Get All Item Classes ..................................................................................................................... 27
Get Items Produced on a Line ....................................................................................................... 28
Get Item-Process Links and Their Status........................................................................................ 29
Get Item Reasons ......................................................................................................................... 31
Get All Item Reason Groups .......................................................................................................... 32
Get BOM Versions ........................................................................................................................ 33
Get Operation Specification Versions for a Process ........................................................................ 34
WorkOrder Endpoint ..................................................................................................................... 35
Get Work Orders Run on a Line..................................................................................................... 44
Jobs Endpoint .............................................................................................................................. 46
Get Jobs in the Job Queue ............................................................................................................ 49
Get Job BOM Data ....................................................................................................................... 54
Get Job BOM Substitute Data........................................................................................................ 58
Get Job Specific ations .................................................................................................................. 59
Get the Job States ........................................................................................................................ 61
Get the Job Executor Record for an Entity ...................................................................................... 62
Get Item Production for a Job ........................................................................................................ 63
Get Item Consumption for a Job .................................................................................................... 67

Get Items
Gets one or more items, as specified by the filt er parameters. Passing no filter paramet ers will retrieve all
items.
Syntax
api/item
?itemId=<item ID>
&itemDesc=<item description>
&itemClassId=<item class ID>
&maxRows=<row count>
Parameters
itemId
Optional string. The item ID by which to filter the retrieved data.
This can be a partial ID string, in which case all items whose ID includes this string will be considered
a match.
itemDesc
Optional string. The item description by which to filter the retrieved data.
This can be a partial description, in which case all items whose description includes this string will be
considered a match.
itemClassId
Optional string. The item class by which to filter the retrieved data.

Version 6.0 25
MES Web API Reference Production Endpoints

maxRows
Optional integer. The maximum number of rec ords to ret urn.
Examples
To get the items that include peanuts in their ID, raw in their description, and roasted nuts in their item
class, and to limit the returned number of records to 20:
api/item?itemId=peanuts&itemDesc=raw
&itemClassId=roasted nuts&maxRows=20
Examples: Skelta Lookups
To get items using the item ID, description, and class filters, and to limit the returned number of records:
api/item?itemId={itemId}&itemDesc={itemDesc}&itemClassId={itemClassId}&maxRo
ws={maxRows}
Return Value
Returns a JSON object that contains the following information for all items or the specified item. If no
matching items are found, an empty object is returned.

Data Name Description

item_id A string that is the item ID.


item_class_id A string that is the item class.
item_description A string that is the item description.
item_class_display A string that is a value that indicat es what format to use when identifying
the item class in the user interface. The format values are defined in the
system attribute Item class display (attr_id 208 in the System_Attr table).
Possible values and their formats are:
0 = item_class_id
1 = item_class_desc
2 = item_class_id (item_class_desc)
3 = item_class_desc(item_class_id).

item_display A string that is a value that indicat es what format to use when identifying
the item in the user interface. The format values are defined in the
system attribute Item display (attr_id 210 in the System_Attr table).
Possible values and their formats are:
0 = item_id
1 = item_desc
2 = item_id (item_desc)
3 = item_desc(item_id).

num_decimals An integer that is the number of decimal places that is used for this item.

uom_description A string that is the description of the unit of measure for the item. From
the description column in the UOM table of the uom_id assigned to the
item in the Item table.

26 Version 6.0
Production Endpoints MES Web API Reference

Get All Item Classes


Gets all item classes.
Syntax
api/itemclass
Return Value
Returns a JSON object that contains the following information for all item classes. If no item classes are
found, an empty object is returned.

Data Name Description

item_class_id A string that is the item class ID.


item_class_description A string that is the item class description.
item_class_display A string that is a value that indicat es what format to use when identifying
the item class in the user interface. The format values are defined in the
system attribute Item class display (attr_id 208 in the System_Attr table).
Possible values and their formats are:
0 = item_class_id
1 = item_class_desc
2 = item_class_id (item_class_desc)
3 = item_class_desc(item_class_id).

produced A Boolean that indicates whether this class contains produced items.

consumed A Boolean that indicates whether this class contains consumed items.

obsolete A Boolean that indicates whether this class is obsolete.


purchased A Boolean that indicates whether items of this class are purchas ed.

sold A Boolean that indicates whether items of this class are sold.

lot_no_format A string that is the default lot number format for the items that belong to
this class.
last_lot_no A string that is the last assigned lot number to any of its items.
sublot_no_format A string that is the default sublot number format for the items that belong
to this class.
last_sublot_no A string that is the last assigned sublot number to any of the items in this
item class.
serial_no_lvl An integer that indicates the level being used, lot or sublot, to indicate
individual serial numbers, from the Item table.
 0: The lot number is the serial number.
 > 0: A particular sublot level is the serial number.
 -1: There are no serial numbers.

Version 6.0 27
MES Web API Reference Production Endpoints

Data Name Description

inv_unique_by_job A Boolean that indicates whether inventory quantities for this class are
uniquely identified by the job that produced them, in addition to ent_id,
item_id, lot_no, and sublot_no.
spare1 A string that is the contents of the user-defined spare1 field.
spare2 A string that is the contents of the user-defined spare2 field.
spare3 A string that is the contents of the user-defined spare3 field.
spare4 A string that is the contents of the user-defined spare4 field.

Get Items Produced on a Line


Gets the items that were produced on a line, optionally within a specified time period.
Syntax
api/line/<lineID>/LineProduction
?filterType=<time period filter>
&filterDuration=<duration for LastNHours filter type>
&summary=<true or false>
Parameters
lineID
Required integer. The line ID.
filterType
Optional integer. The ID of the time period filter type to use. For a list of the available filter types, see
Time Period FilterType Enumeration on page 109.
If no filter type is specified, the default value is 2, Current Shift.
filterDuration
Optional integer. If the filter type is set to 1, LastNHours, this is the value for N (that is, the number of
hours). If no value is provided, the default value of 1 hour is used.
summary
Optional Boolean. A flag that, when true, indicat es that the total Good and Rejected production for a
line normalized to the UOM of the line's standard item should be returned. The default value is false.
Examples
To get all items that were produced on a line with an ID of 13 during the current shift:
api/line/13/LineProduction
To get the items that were produced on a line with an ID of 13 wit hin the last week, with a normalized
production total:
api/line/13/LineProduction?filterType=7&summary=true
Examples: Skelta Lookups
To get all items that were produced on a line during the current shift:
api/line/{lineID}/LineProduction
To get the items that were produced on a line within a time period, and to specify whether to returned a
normalized production total:
api/line/{lineID}/LineProduction?filterType={filterType=}&summary={summary}

28 Version 6.0
Production Endpoints MES Web API Reference

Return Value
Returns a JSON object that contains the following information for each item that was produced on the
line during the specified time period. If no matching items are found, an empty object is returned.

Data Name Description

item_id A string that is the item ID.


item_desc A string that is the item description.
item_display A string that is a value that indicat es what format to use when identifying
the item in the user interface. The format values are defined in the
system attribute Item display (attr_id 210 in the System_Attr table).
Possible values and their formats are:
0 = item_id
1 = item_desc
2 = item_id(item_desc)
3 = item_desc(item_id)

uom_description A string that is the description of the unit of measure, from the UOM
table.
uom_abbreviation A string that is the abbreviation of the unit of measure, from the UOM
table.
num_decimals An integer that is the number of decimals for formatting the
period_produced and period_rejected values.
num_decimals_good_pp An integer that is the value of the system attribute Max decimals of good
piece part entries (attr_id 326 in the System_Attr table) and is used when
the num_decimals column is 0.
period_produced A double that is the quantity of good production made on the production
entities of the line during the specified time period, in terms of the UOM of
the line's standard item if defined. From the Job table.

period_rejected A double that is the quantity of rejected production made on the entities
upstream from and including the production entities of the line during the
specified time period, in terms of the UOM of the line's standard item if
defined. From the Job table.

Get Item-Process Links and Their Status


Gets information for one or more item-process links, as specified by the processid filter parameter.
Passing no processid filter parameter will retrieve all item-process links.
Syntax
api/itemprocesslink?processid=<process ID>
Parameters
processid
Optional string. The process ID by which to filter the retrieved data.

Version 6.0 29
MES Web API Reference Production Endpoints

Examples
To get information for all item-proc ess links:
api/itemprocesslink
To get information for the item-process links for only those processes that include RoastedCashews in
their ID:
api/itemprocesslink?processid=RoastedCashews
Examples: Skelta Lookupsich
To get information for all item-proc ess links:
api/itemprocesslink
To get information for item-proc ess links filtered by a process ID:
api/itemprocesslink?processid={processid}
Return Value
Returns a JSON object that contains the information described below for all item -process links that
match the specified filter, from the Item_P rocess_Link table. If no matching links are found, an empty
object is returned.
 If a process ID was supplied in the endpoint, then all of the fields listed below are included in the
object.
 If a process ID was not supplied in the endpoint, then only the process_id, item_id, item_desc, and
status fields are included in the object.

Data Name Description

item_id A string that is the item ID.


process_id A string that is the process ID.
item_pref An integer that identifies the preferred process (the process with the
lowest value in this field is the preferred one).
status An integer that indicates the status of this process/item combination:
-1 = Disabled
1 = Experiment al
2 = Approved (the default)
3 = Certified
item_desc A string that is the item description.
item_display A string that is a value that indicat es what format to use when identifying
the item in the user interface. The format values are defined in the
system attribute Item display (attr_id 210 in the System_Attr table).
Possible values and their formats are:
0 = item_id
1 = item_desc
2 = item_id(item_desc)
3 = item_desc(item_id)
num_decimals An integer that is the number of decimals for formatting the quantity of
good and rejected production.

30 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

uom_id An integer that is the ID of the item unit of measurement (UOM).


uom_description A string that is the description of the unit of measure, from the UOM
table.
process_desc A string that is the description for the proc ess, from the Process table.
process_status An integer that indicates the status of the process, from the Process
table:
-1 = Disabled
1 = Experiment al (the default)
2 = Approved
3 = Certified
process_level An integer that specifies the process level, from the Process table:
1 = General
2 = Site
3 = Master (the default)
item_class_id A string that is the ID of the item class, from the Item_Class table.
item_class_desc A string that is the description for the item class, from the Item_Class
table.
last_edit_comment A string that contains comments about why the record was added or
updated.
last_edit_by A string that is the ID of the user who added or last updated this record.
last_edit_at A datetime, in UTC, that indicates when the record was added or last
updated.
mod_id A rowversion that is incremented whenever the record has been
updated.

Get Item Reasons


Gets all item reasons; or gets all item reas ons for an entity as specified by the entity ID and optionally
filtered by item ID and item reason group type.
Syntax
api/ItemReason?entId=<entity ID>
&itemId=<item ID>
&reasGrpType=<item reason group type>
Parameters
entId
Required integer, if specifying an entity or using the filter parameters. The entity ID.
itemId
Optional string. An item ID.
reasGrpType
Optional integer. An integer that is the reason group type:
0 = Hidden

Version 6.0 31
MES Web API Reference Production Endpoints

1 = Production
2 = Consumption
3 = Waste
Examples
To get all item reasons:
api/ItemReason
To get all item reasons for the entity with an ID of 15:
api/ItemReason?entId=15
To get the item production reasons for the entity with an ID of 15:
api/ItemReason?entId=15&reasGrpType=1
Examples: Skelta Lookups
To get all item reasons:
api/ItemReason
To get all item reasons for an entity:
api/ItemReason?entId={entId}
To get the item reasons for an entity, filtered by a reason group type:
api/ItemReason?entId={entId}&reasGrpType={reasGrpType}
Return Value
Returns a JSON object that contains the following information about all item reasons associated with the
specified entity and matching the optional filters, from the Item_Reason table. If no matching item
reasons are found, an empty object is returned.

Data Name Description

reas_cd An integer that is the item reason code.


reas_desc A string that is the description of the item reason.
reas_grp_id An integer that is the ID of the item reason group.
reas_grp_type An integer that is the reason group type, from the record in the
Item_Reas_Grp table that is linked to this reason:
0 = Hidden
1 = Production
2 = Consumption
3 = Waste
reas_grp_desc A string that is the description of the item reason group, from the record
in the Item_Reas_Grp table that is linked to this reason.

Get All Item Reason Groups


Gets all item reason group records.
Syntax
api/ItemReasonGroup

32 Version 6.0
Production Endpoints MES Web API Reference

Return Value
Returns a JSON object that contains the following information about all item reason groups, from the
Item_Reason_Grp table. If no item reason groups are found, an empty object is returned.

Data Name Description

Id An integer that is the ID of the item reason group.


Description A string that is the description of the item reason group.
Type An integer that is the reason group type:
0 = Hidden
1 = Production
2 = Consumption
3 = Waste

Get BOM Versions


Gets information about all BOM versions or the BOM versions for a specific item.
Syntax
api\BomVersion?itemId=<item ID>
Parameters
itemId
Optional string. The ID of an item for which to retrieve BOM version information. If this parameter is
not included, information about all BOM versions is returned.
Examples
To get information about all BOM versions:
api\BomVersion
To get BOM version information about the item whose ID is RoastedCashews:
api\BomVersion?itemId=RoastedCashews
Examples: Skelta Lookups
To get information about all BOM versions:
api\BomVersion
To get BOM version information about a specific item:
api\BomVersion?itemId={itemId}
Return Value
Returns a JSON array that includes the following information about all BOM versions or the BOM
versions for the specified item. If no matching B OM versions are found, an empty JS ON array is returned.

Data Name Description

parent_item_id The ID of an item being made.


ver_id The ID of the BOM version.
ver_date The date when the version was created or last updated.
ver_comments Comments about a version.

Version 6.0 33
MES Web API Reference Production Endpoints

Data Name Description

preferred_ver The string true or false that specifies whether this is the preferred
version to make the parent item.
item_desc A string that is the description of the item.
disassembly The string true or false that specifies whether the BOM determines what
can be obtained from the main item.
start_eff A datetime that indicates when the BOM version becomes effective, in
UTC.
end_eff A datetime that indicates when the BOM version becomes ineffective, in
UTC.
last_edit_comment A string that contains comments about why the record was added or
updated.
last_edit_by A string that is the ID of the user who added or last updated this record.

last_edit_at A datetime, in UTC, that indicates when the record was added or last
updated.
mod_id A rowversion that is incremented whenever the record has been
updated.

Get Operation Specification Versions for a Process


Gets information about all operation specification versions for every operation in the specified proc ess.
Syntax
api\OperSpecVer?processId=<process ID>
Parameters
processId
Required string. The ID of the process for which to retrieve operation specificati on version
information.
Examples
To get operation specification version information about the process RoastCashews:
api\OperSpecVer?processId=RoastCashews
Examples: Skelta Lookups
To get operation specification version information about a process:
api\OperSpecVer?processId={processId}
Return Value
Returns a JSON array that includes the following information about the operation specification versions
for the specified proc ess. If no matching process ID or operation specifications for t he process are found,
an empty JS ON array is returned.

Data Name Description

process_id The ID of the process.


oper_id The ID of the operation.
ver_id The ID of the specification version.

34 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

ver_date The date and time when the specification version was created or last
modified, in UTC.
ver_comments Comments for this version.
preferred_ver The string true or false that specifies whether this is the preferred
version.
process_desc The description of the process.

last_edit_comment Comments about why the process record was added or updated.

last_edit_by The ID of the user who added or last updated the process record.

last_edit_at The date and time, in UTC, that indicates when the process record was
added or last updated.
mod_id A SQL rowversion value that is incremented whenever the process
record has been updated.

WorkOrder Endpoint
The workorder endpoint has the following variations, described in the next two topics:
 Get work orders that are filtered by one or more of the following: overall work order status, line, and
time period.
 Get work orders that are filtered by one or more of the following: job-related status, line, time period,
item produced. This endpoint vari ation also allows you to specify whether or not to include work
orders creat ed from a process.
Both variations return a JS ON object or array that contains information about each work order being
retrieved.
Note that, if filtering for a specific line, the parameter name for the target line is different for the last two
variations:
 For the variation t hat filters by overall work order status, the paramet er is targetScheduleLineIdFilter.
 For the variation that filters by job-related status, the parameter is target_sched_line_id.

Get Work Orders Filtered by Overall Status, Line, and Time Period
Gets one or more work order rec ords, as specified by the overall work order status. You can also us e this
endpoint variation to filter by work order ID, a line on which they are scheduled, and within a specified
time period.
Syntax
api/WorkOrder
?woId=<work order ID>
&targetScheduleLineIdFilter=<line ID>
&lastEditHrFilter=<number of hours>
&statusCd=<status code>
Parameters
woId
Optional string. The ID of a specific work order to retrieve.

Version 6.0 35
MES Web API Reference Production Endpoints

targetScheduleLineIdFilter
Optional integer. To retrieve work orders that have been scheduled on a specific line, enter the ID of
the line.
lastEditHrFilter
Optional integer. This filter applies only to work orders wit h an overall status of Completed, which
includes canceled work orders.
To filter Completed work orders by time period, enter the number hours prior to the current time
during which work orders have been completed or canceled.
statusCd
Optional integer. To filter by the overall work order status, enter the appropriate status code:
0 = Releas ed (the default)
1 = Started
2 = Completed (includes completed and canceled work orders)
3 = Closed
Examples
To get all work orders:
api/WorkOrder
To get the work order WO20171213.2445:
api/WorkOrder?woId=WO20171213.2445
To get all work orders that were scheduled on the line with the ID 8 and that have been completed or
canceled within the last 24 hours:
api/WorkOrder?targetScheduleLineIdFilter=8
&lastEditHrFilter=24
&statusCd=2
To get all work orders with a status of Released:
api/WorkOrder?statusCd=0
Examples: Skelta Lookups
To get all work orders:
api/WorkOrder
To get a specific work order:
api/WorkOrder?woId={woId}
To get all work orders that were scheduled on a specific line and were completed or canceled within a
certain time period:
api/WorkOrder?targetScheduleLineIdFilter={targetScheduleLineIdFilter}&lastEd
itHrFilter={lastEditHrFilter}&statusCd={statusCd}
To get all work orders based on their overall status:
api/WorkOrder?statusCd={statusCd}
Return Value
The workorder endpoint returns a JSON object that contains the following information for all work orders
or, if filter parameters have been specified, work orders that matc h the filter parameters. If no matching
work orders are found, an empty object is returned.

Data Name Description

wo_id A string that is the work order ID.


wo_desc A string that is the work order description.

36 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

process_id A string that is the ID of the process from whic h the work order was
generated, if the work order was generated from a process.
item_id A string that is the ID of the final item being made.

item_desc A string that is the description of the final item being made.

qty_at_start A double that is the sum of items that the work order can optimally
produce given the raw material available based on the jobs performed at
the entity or entities identified as the production sourc e for the line.

qty_remaining A double that is the sum of the number of remaining items that the work
order must still produce based on the jobs performed at the entity or
entities identified as the production source for the line.

qty_prod A double that is the sum of acceptable items that the work order has
produced based on the jobs performed at the entity or entities identified
as the production source for the line.
qty_rejected A double that is the sum of rejected items that the work order has
produced based on the jobs performed done at the entity or entities
identified as the production source for the line.
qty_reqd A double that is the sum of items that the work order is re quired to
produce based on the jobs done at the entity or entities identified as the
production source for the line.
def_reqd_qty A double that is the original quantity required less the good quantity
produced in any job for this work order that ran on an entity identified as a
line's production entity or those in parallel with it, or 0, whichever is
greater.

uom_id An integer that is the ID of the unit of measure for the item being
produced by the work order.
uom_desc A string that is the description of the unit of measure.
wo_status An integer that is the code that indic ates the job -related status of the
work order.
1 = New
2 = Ready
3 = Running (In Progress)
4 = Complete
5 = Suspended
6 = On Hold
wo_status_desc A string that is the description of the job-related status of the work order.

color An HTML color string that indicates the RGB background color of the
work order status.

Version 6.0 37
MES Web API Reference Production Endpoints

Data Name Description

target _sched_line_id An integer that is the ID of the production line to which the work order is
assigned.
target _sched_line_name A string that is the name of the production line to which the work order is
assigned.
req_finish_time_utc A datetime value that indicates the dat e and time, in UTC, by when the
work order must be completed.
release_time_utc A datetime that indicates when the work order was/will be released, in
UTC.
num_decimals An integer that is the number of decimals for formatting numeric values.

num_decimals_good_pp An integer that is the value of the system attribute Max decimals of good
piece part entries (attr_id 326 in the System_Attr table) and is used when
the num_decimals column is 0.
last_edit_at A datetime, in UTC, that specifies when t he work order record was added
or last modified.
release_time_local A datetime that indicates when the work order was/will be released, in
local time.
req_finish_time_local A datetime value that indicates the dat e and time, in local time, by when
the work order must be completed.
state_cd An integer that is the code that indic ates the state of the work order.
0 = Releas ed (default)
1 = Started
2 = Completed
3 = Closed. When closed, not hing else for this work order is editable.
row_num An integer that is the number of the work order in the list of returned work
orders in the object. Row numbers represent the creation time order of
the work orders, with the lowest number being the most recent work
order.
If a web application has set a maximum number of work orders that can
be ret urned (for performance reas ons), the row numbers can be used to
ensure that the most recent work orders are returned if the maximum
number is exceeded.
wo_priority An integer that is the work order priority. This is the default value for
job_priority in the Job table.
cust_info A string that is custom information for the work order.
notes A string that is the work order’s notes.
mo_id A string that is the manufacturing order, for grouping different final parts.

38 Version 6.0
Production Endpoints MES Web API Reference

Get Work Orders Filtered by Job-Related Status, Line, Time Period,


and Other Parameters
Gets one or more work order records, as specified by the work order's job-related status filter
parameters. You can also use this endpoint variation to filter by work order ID, produced item ID, a line on
which they are scheduled, and within a specified time period. You can also specify whether to include
work orders that were created from a process.
The job-related status of the work order is derived based on the first condition that satisfies the following
order:
1. If there is a job running, the work order status is Running.
2. If all the jobs are completed or canceled, the work order status is Complete.
3. If there is any one on-hold job, then the work order status is On Hold.
4. If there is any one suspended job, then the work order status is Suspended.
5. If there is any one ready job, then the work order status is Ready.
6. If none of the above conditions are true, the work order status is New.
Syntax
api/workorder
?newState=<true or false>
&readyState=<true or false>
&runningState=<true or false>
&completeState=<true or false>
&suspendedState=<true or false>
&onholdState=<true or false>
&woId=<work order ID>
&itemId=<item ID>
&numberOfWos=<maximum number of records to return>
&targetSchedLineId=<line ID>
&lastEditHrFilter=<number of hours>
&includeFromProcess=<true or false>
Parameters
Note: All of the state filter parameters are required, even if their values are set to false. If you do not
provide a value for even one of the state filt er parameters, then the other workorder endpoint is
used and its dataset will be returned instead of the JSON array returned by this version of the
endpoint. Also, all non-state filter paramet er settings will still be implemented in the call of the other
workorder endpoint.

newStat e
Required B oolean. To include work orders in t he New state, enter true. To exclude work orders in the
New state, enter false.
readyStat e
Required Boolean. To include work orders in the Ready state, enter true. To exclude work orders in
the Ready state, enter false.
runningState
Required Boolean. To include work orders in the Running state, ent er true. To exclude work orders in
the Running state, enter false.
completeState
Required Boolean. To include work orders in the Complet e state, enter true. To exclude work orders
in the Complete state, enter false.

Version 6.0 39
MES Web API Reference Production Endpoints

suspendedState
Required Boolean. To include work orders in the S uspended state, enter true. To exclude work
orders in the Suspended state, enter false.
onholdState
Required Boolean. To include work orders in the OnHold state, enter true. To exclude work orders in
the OnHold state, enter false.
woId
Optional string. The work order ID of the target work order.
itemId
Optional string. The item ID of the target work order.
numberOfWos
Optional integer. The maximum number of work order records to return.

Note: If no value is supplied for the numberOfWos parameter and there are a large number of work
order records, system performanc e might be affected as all work orders that match the other filter
parameters will be returned.

targetSchedLineId
Optional integer. To retrieve work orders that have been scheduled on a specific line, enter the ID of
the line.
lastEditHrFilter
Optional integer. This filter applies only to Completed or Canceled work orders.
To filter Completed or Canc eled work orders by time period, ent er the number hours prior to the
current time during which work orders have been Completed or Canceled.
includeFromP rocess
Optional Boolean. To include work orders that were created from a process, enter true. To exclude
work orders that were created from a process, enter false or do not include this parameter in the call.
Examples
To get all work orders with a New or Ready status and not created from a process:
api/workorder?newState=true&readyState=true&runningState=false&completeState
=false&suspended_statesuspendedState=false&onholdState=false
To get all work orders with a Completed status that have been scheduled on the line with the ID 8 within
the last 24 hours and can be created from a process:
api/workorder?newState=false&readyState=false&runningState=false&completeSta
te=true&suspended_statesuspendedState=false&onholdState=false&targetSchedLin
eId=8&lastEditHr=24&includeFromProcess=true
Examples: Skelta Lookups
To get all work orders based on their status and not created from a process:
api/workorder?newState={newState}&readyState={readyState}&runningState={runn
ingState}&complete_statecompleteState={completeState}&suspendedState={suspen
dedState}&onholdState={onhold}
To get all work orders that have been scheduled on a specific line wit hin a certain time duration, and
based on their status and whether they were created from a process:
api/workorder?newState={newState}&readyState={readyState}&runningState={runn
ingState}&complete_statecompleteState={completeState}&suspendedState={suspen
dedState}&onholdState={onhold}&targetSchedLineId={targetSchedLineId}&lastEdi
tHr={lastEditHr}&includeFromProcess={ifp}

40 Version 6.0
Production Endpoints MES Web API Reference

Return Value
Returns a JSON array that contains the following information for all work orders that match the filt er
parameters. If no matching work orders are found, an empty JSON array is returned.

Data Name Description

wo_id The work order ID.


wo_desc The work order description.
process_id The ID of the process from which the work order was generated, if the
work order was generated from a process.
process_desc The description of the process from which the work order was generated,
if the work order was generated from a process.
bom_ver_id The BOM version of the original item that this work order produc es
specified at the time it was created, unless created on -the-fly.
spec_ver_id The specification version selected for all operations (if any) at the time
the work order was created, unless created on-the-fly.
item_id The ID of the final item being made.

item_desc The description of the final item being made. From the Item table.

serial_no_lvl The number that indicat es the level being used, lot or sublot, to indicate
individual serial numbers, from the Item table.
 0: The lot number is the serial number.
 > 0: A particular sublot level is the serial number.
 -1: There are no serial numbers.
uom_id The ID of the unit of measure for the item being produced by the work
order.
uom_desc The description of the unit of measure.
num_decimals The number of decimals for formatting numeric values.

num_decimals_good_pp The value of the system attribute Max decimals of good piece part entries
(attr_id 326 in the System_Attr table) and is used when the
num_decimals column is 0.
req_qty The sum of items that the work order is required to produce. For work
orders creat ed from a line, this value is based on the jobs done at the
entity or entities identified as the production source for the line.

release_time_utc A date and time that is when the work order was/will be released, in UTC.

release_time_local A date and time that is when the work order was/will be released, in local
time.
release_time A date and time that is when the work order was/will be released, in the
caller's local time.
req_finish_time_utc A date and time, in UTC, that is by when the work order must be
completed.

Version 6.0 41
MES Web API Reference Production Endpoints

Data Name Description

req_finish_time_local A date and time, in local time, by when the work order must be
completed.

req_finish_time A date and time, in the caller's local time, by when the work order must
be completed.

state_cd The code that indicates the state of the work order.
0 = Releas ed (default)
1 = Started
2 = Completed
3 = Closed. When closed, not hing else for this work order is editable.
wo_priority The work order priority. This is the default value for job_priority in the Job
table.
cust_info Customer information for the work order.
mo_id The manufacturing order, for grouping different final parts.

production_schedule_id The ID of the production schedule to which the work order (Production
Request ID) belongs.
notes Notes about the work order.

not_deletable The string true or false that indicat es whet her the work order can be
deleted.

disassembly The string true or false that indicat es whet her the work order is
disassembling something.
may_override_route The string true or fal se that indicates whether the work order can include
operations other than those immediately upstream or downstream from
the current one.
override_serialization The string true or false that indicat es whet her an item that the work
order is producing and that is normally treated as serialized, is not
treated as serialized.
input_wo_id The work order ID of the job from whic h a rework work order would
originate.
input_oper_id The operation ID of the job from which a rework work order would
originate.
input_seq_no The operation sequence number of the job from which a rework work
order would originat e.
target _sched_line_id The ID of the production line to which the work ord er is assigned.

target _sched_line_name The name of the production line to which the work order is assigned.

queue_seq_no The sequenc e number of the work order in the queue.

42 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

wo_status The code that indicates the job-relat ed status of the work order.
1 = New
2 = Ready
3 = Running (In Progress)
4 = Complete
5 = Suspended
6 = On Hold
wo_status_desc The description of the work order's status.

color An HTML color string that indicates the RGB background color of the
work order status in the user int erface.
qty_reqd The sum of items that the work order is required to produc e based on the
jobs performed at the entity or entities identified as the production source
for the line.

qty_at_start The sum of items that the work order can optimally produce given the raw
material available based on the jobs performed at the entity or entities
identified as the production source for the line.

qty_prod The sum of acceptable items that the work order has produced based on
the jobs performed at the entity or entities identified as the production
source for the line.
qty_rejected The sum of rejected items that the work order has produced based on t he
jobs performed done at the entity or entities identified as the production
source for the line.
qty_remaining The sum of the number of remaining items that the work order must still
produce based on the jobs performed at the entity or entities identified as
the production source for the line.

def_reqd_qty The original required quantity - good good produced in any job for this
work order that ran on an entity identified as a line's production entity or
those in parallel with them, or 0, whichever is greater.
spare1 The contents of the work order’s user-defined spare1 field.

spare2 The contents of the work order’s user-defined spare2 field.


spare3 The contents of the work order’s user-defined spare3 field.
spare4 The contents of the work order’s user-defined spare4 field.
last_edit_comment Comments about why the work order record was changed.
last_edit_by The ID of the user who last edited the work order record.
last_edit_at The date and time, in UTC, that specifies when the the work order record
was added or last modified.
mod_id A SQL rowversion that is incremented whenever the the work order
record is updated.

Version 6.0 43
MES Web API Reference Production Endpoints

Data Name Description

calc_start_qty If t he work order is created from a line, the value in this column is the sum
of the items that the work order can optimally produce given the raw
material available based on the jobs performed at the entity or entities
identified as the production source for the line.
Otherwise, the value in this column is the sum of the quantities at the
start of the work order from all jobs that are designed as the last jobs in
the work order (t hat is, job.final_job=1).
calc_reqd_qty The sum of items that the work order is required to produc e based on the
jobs performed at the entity or entities identified as the production source
for the line.

Get Work Orders Run on a Line


Gets the work orders that have been run on a line within a specified time period.
Syntax
api/line/<lineID>/LineWorkOrderSummary
?filterType=<time period filter>
&filterDuration=<duration for LastNHours filter type>
Parameters
lineID
Required integer. The line ID.
filterType
Optional integer. The ID of the time period filter type to use. For a list of the available filter types, see
Time Period FilterType Enumeration on page 109.
If no filter type is specified, the default value is 2, Current Shift.
filterDuration
Optional integer. If the filter type is set to 1, LastNHours, this is the value for N (that is, the number of
hours). If no value is provided, the default value of 1 hour is used.
Examples
To get all work orders that were run on the line wit h an ID of 20 during the current shift:
api/line/20/LineWorkOrderSummary
To get the work orders that were run on the line with an ID of 20 within the last 10 hours:
api/line/20/LineWorkOrderSummary
&filterType=1&filterDuration=10
Examples: Skelta Lookups
To get all work orders that were run on a line during the current shift:
api/line/{lineID}/LineWorkOrderSummary
To get the work orders that were run on a line within a certain duration:
api/line/{lineID}/LineWorkOrderSummary&filterType={filterType}&filterDuratio
n={filterDuration}
Return Value
Returns a JSON object that contains the following information for each work order that was run on a line
during the specified time period. If no matching work ord ers are found, an empty object is returned.

44 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

wo_id A string that is the work order ID


item_id A string that is the item ID.
item_desc A string that is the item description.
item_display A string that is a value that indicat es what format to use when identifying
the item in the user interface. The format values are defined in the
system attribute Item display (attr_id 210 in the System_Attr table).
Possible values and their formats are:
0 = item_id
1 = item_desc
2 = item_id (item_desc)
3 = item_desc(item_id)

uom_description A string that is the description of the unit of measure, from the UOM
table.
uom_abbreviation A string that is the abbreviation of the unit of measure, from the UOM
table.
num_decimals An integer that is the number of decimals for formatting quantity values.

num_decimals_good_pp An integer that is the value of the system attribute Max decimals of good
piece part entries (attr_id 326 in the System_Attr table) and is used when
the num_decimals column is 0.
starting_quantity A double that is the quantity of item that is expected to be produced if
there are no scrap/ waste/rejects, from the Job table.
remaining_quantity A double that is the quantity defined as the difference between the start
quantity and the sum of the quantity produced and the quantity rejected
(qty_start - (qty_prod + quantity rejected)).
required_quantity A double that is the quantity of item required, from the Job table.

total_produced A double that is the total amount of good production made on the
production entities of the line, in terms of the UOM of the line's standard
item if defined. From the Job table.
total_rejected A double that is the total amount of rejected production made on the
entities upstream from and including the production entities of the line, in
terms of the UOM of the line's standard item if defined. From the Job
table.

period_produced A double that is the amount of good production made on the production
entities of the line during the specified time period, in terms of the UOM of
the line's standard item if defined. From the Job table.

period_rejected A double that is the amount of rejected production made on the entities
upstream from and including the production entities of the line during the
specified time period, in terms of the UOM of the line's standard item if
defined. From the Job table.

Version 6.0 45
MES Web API Reference Production Endpoints

Data Name Description

wo_status An integer that represents the status code of the work order.
1 = New
2 = Ready
3 = Running (In Progress)
4 = Complete
5 = Suspended
6 = On Hold
wo_status_desc A string that is the description of the work order's status.
wo_status_c olor An HTML color string that indicates the RGB background color of the
work order status in the user int erface.

Jobs Endpoint
The jobs endpoint has the following variations, described in the next three topics:
 Get the jobs for a work order
 Get a specific job
Each variation returns a JS ON object that contains information about each job record being retrieved,
from the Job table.

Get the Jobs for a Work Order


Gets the jobs for the specified work order.
Syntax
api/jobs?woId=<work order ID>
Parameters
woId
Required string. The work order ID of the target job.
Examples
To get the jobs for work order WO20171213.2445:
api/jobs?woId=WO20171213.2445
Examples Skelta Lookups
To get the jobs for a work order:
api/jobs?woId={woId}
Return Value
See Jobs Endpoints Ret urn Value on page 47.

Get a Specific Job


Gets a job record, as specified by the work order, operation, and sequence number.
Syntax
api/jobs?woId=<work order ID>&operId=<operation ID>&seqNo=<sequence number>

46 Version 6.0
Production Endpoints MES Web API Reference

Parameters
woId
Required string. The work order ID of the target job.
operId
Required string. The operation ID of the target job.
seqNo
Required string. The sequence number of the target job.
Examples
To get the job for work order WO20171213.2445, operation Roast, and sequence number 2:
api/jobs?woId=WO20171213.2445&operId=Roast&seqNo=2
Examples: Skelta Lookups
To get a job by work order, operation, and sequence number:
api/jobs?woId={woId}&operId={operId}&seqNo={seqNo}
Return Value
See Jobs Endpoints Ret urn Value on page 47.

Jobs Endpoints Return Value


The Jobs endpoints return a JSON object that contains the following information about the jobs specified
by the endpoint parameters, from the Job table. If no matching job is found, an empty object is returned.

Data Name Description

wo_id A string that is the ID of the work order for the job.
oper_id A string that is the ID of the operation for the job.
seq_no An integer that is the sequence number for the job.
qty_reqd A double that is the quantity of item required.
qty_prod A double that is the quantity of item made so far.
est_prod_rate A double that is the estimated production rate.

cur_rate_finish_time_utc A datetime value t hat indicates the date and time, in UTC, when the work
order will be completed based on the current production rate.
std_rate_finish_time_utc A datetime value t hat indicates the date and time, in UTC, when the work
order will be completed based on the standard production rate.
target _finish_time_utc A datetime value t hat indicates the date and time, in UTC, when the work
order will be completed based on the target production rat e.
sched_finish_time_utc A datetime value t hat indicates the date and time, in UTC, when the work
order will be completed based on the estimated production rate.
actual_start_time_utc A datetime value that indicates the actual job start time, in UTC.

item_id A string that is the ID of the item that is being produced by this job.

Version 6.0 47
MES Web API Reference Production Endpoints

Data Name Description

state_desc A string that is the current job state description:


New
Ready
Running
Complete
Suspended
Onhold
Canc eled
state_color An HTML color string that indicates the job state’s RGB background color
in the user int erface.

prod_uom An integer that represents the production unit of meas ure:


0 = hours/batch
1 = minutes/batch
2 = seconds/batch
3 = batches/hour
4 = batches/minute
5 = batches/second
job_desc A string that is the description of the job.

qty_at_start A double that is the quantity of item that is expected to be produced if


there are no scrap/ waste/rejects.
qty_rejected A double that is the quantity of item rejected so far during the job.
state_cd An integer that is the code for the job state.
1 = New
2 = Ready
3 = Running
4 = Completed
5 = Suspended
6 = On Hold
7 = Canceled
run_ent_id An integer that is the ID of the entity on which the job is actually run.

run_ent_name The name of the entity on which the job is actually run.

qty_remaining A double that is the quantity defined as the difference between the start
quantity and the sum of the quantity produced and the quantity rejected
(qty_start - (qty_prod + quantity rejected)).

48 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

target _sched_ent _id An integer that is the ID of the entity on which the job is actually
scheduled.
target _sched_ent _name A string that is the name of the entity on which the job is actually
scheduled.
uom_description A string that is the description of the production unit of measure

row_id An integer that is the row ID of the job record in the Job table.

num_decimals An integer that is the number of decimals for formatting numeric values.

num_decimals_good_pp An integer that is the value of the system attribute Max decimals of good
piece part entries (attr_id 326 in the System_Attr table), and is used
when the num_decimals column is 0.

Get Jobs in the Job Queue


Gets one or more jobs that are in the job queue. The jobs can be filtered by entity, work order, produced
item, or their job state.
Syntax
/api/jobQueue?entityID=<entity ID>
&woId=<work order ID>
&itemId=<item ID>
&newState=<true or false>
&readyState=<true or false>
&runningState=<true or false>
&completeState=<true or false>
&suspendedState=<true or false>
&onholdState=<true or false>
&cancelledState=<true or false>
&lastNHours=<number of hours>
&maxRows=<number>
&inclSchedParents=<true or false>
Parameters
entityID
Optional integer. If retrieving the jobs for a specific entity, the entity ID.
woId
Optional string. If filtering the jobs by work order, the work order ID.
itemId
Optional string. If filtering the jobs by the produced item, the item ID.
newStat e
Optional Boolean. To include jobs in the New state, enter true. To exclude jobs in the New state,
enter false or do not include this parameter in the call.
readyStat e
Optional Boolean. To include jobs in the Ready state, enter true. To exclude j obs in the Ready state,
enter false or do not include this parameter in the call.

Version 6.0 49
MES Web API Reference Production Endpoints

runningState
Optional Boolean. To include jobs in the Running state, enter true. To exclude jobs in the Running
state, enter false or do not include this parameter in the call.
completeState
Optional Boolean. To include jobs in the Complete state, enter true. To exclude jobs in the Complete
state, enter false or do not include this parameter in the call.
suspendedState
Optional Boolean. To include jobs in the Suspended state, enter true. To exclude jobs in the
Suspended state, enter false or do not include this parameter in the call.
onholdState
Optional Boolean. To include jobs in the OnHold state, enter true. To exclude jobs in the OnHold
state, enter false or do not include this parameter in the call.
cancelledStat e
Optional Boolean. To include jobs in the canceled state, enter true. To exclude jobs in the canc eled
state, enter false or do not include this parameter in the call.
lastNHours
Optional integer. The number of previous hours of data to include.
maxRows
Optional integer. The maximum number of jobs to return. The top n jobs are returned based on their
scheduled start time and then their priority.
inclSchedParents
Optional Boolean. If an entity is specified by the entityID parameter, to include jobs scheduled to
ancestors of that entity, enter true. To exclude jobs scheduled to that entity enter false or do not
include this parameter in the call.
Examples
To get the jobs in the job queue for entity 24 that are in the Ready state and limit the returned number of
records to 10:
/api/jobQueue?entityID=24&readyState=true&maxRows=10
To get the jobs in t he job queue for entity 24 that are being run for work order WO20171213.2445 and are
in the Complete state:
/api/jobQueue?entityID=24&woId=WO20171213.2445
&completeState=true
Examples: Skelta Lookups
To get the jobs in the job queue for an entity by whether they are in the Ready state and limit the returned
number of records:
/api/jobQueue?entityID={entityID}&readyState={readyState}&maxRows={maxRows}
To get the jobs in the job queue for an entity that are being run for a particular work order and depending
on whether they are in the Complete state:
/api/jobQueue?entityID={entityID}&woId={woId}&completeState={completeState}
Return Value
Returns a JSON array that contains the following information about the jobs, from the Job table. If no
matching jobs are found, an empty JSON array is returned.

Data Name Description

item_id The ID of the job item.


item_desc The description of the item produced by the job, from Item table.

50 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

uom_id_h The ID of the unit of measure for the item, from Item table.
uom_description The description of the unit of measure for the item, from Uom table.
lifetime The lifetime of this item before it expires, in days. If null, the item never
expires.
unit_cost The cost for one unit of the item, from the Item table.
item_class_id The ID of the class to which the produced item belongs, from It em table.
item_class_desc The description of the class to which the produced item belongs, from
Item_Class table.
process_id The ID of the process from which the job was created.
process_status The status of the process from which this job was created, from the
Process table.
wo_id The ID of the work order to which the job belongs.
req_qty The required quantity of the final item produced by the work order, from
Wo table.
release_time_utc The release time of the work order in UTC, from the Wo table.
release_time_local The release time of the work order in the local time of the entity where t he
activity occurred, from the Wo table.
release_time The release time of the work order in the local time of the caller where t he
activity occurred, from the Wo table.
wo_priority The priority of the work order, from the Wo table.
cust_info The work order customer information, from the Wo table.
oper_id The job operation ID.
seq_no The job sequence number.
job_desc The description of the job.
state_cd The current state of the job.
job_priority The priority of the job.
req_finish_time_utc The time by when to finish the operation in UTC.
req_finish_time_local The time by when to finish the operation in the local time of the entity
where the activity occurred.
req_finish_time The time by when to finish the job in the local time of the entity where the
activity occurred.
target _sched_ent _id The ID of the target schedule entity.
ent_name The name of the entity to which the job needs to scheduled, from Ent
table.
qty_reqd The quantity that the job must produce.
qty_prod The quantity already produced.
qty_rejected The quantity already rejected.
qty_at_start The quantity the job will produce if nothing is scrapped.

Version 6.0 51
MES Web API Reference Production Endpoints

Data Name Description

batch_size The batch size.


first_job The string true or fal se that specifies whether this is a first job in the work
order.
final_job The string true or false that specifies whether this is a final job in the
work order.
est_prod_rate The estimated entity batch rate or time, depending on the produced item
unit of measure.
sched_start_time_utc The scheduled start time for the job in UTC.
sched_start_time_local The scheduled start time for the job in the local time of the entity where
the activity occurred.
sched_start_time The scheduled start time for the job in the local time for the caller where
the activity occurred.
latest_start_time_utc The latest time the job may start in UTC.
latest_start_time_local The latest time the job may start in the local time for the entity where the
activity occurred.
latest_start_time The latest time the job may start in the local time for the caller where the
activity occurred.
sched_finish_time_utc The scheduled finish time for the job in UTC.
sched_finish_time_local The scheduled finish time for the job in the local time for the entity where
the activity occurred.
sched_finish_time The scheduled finish time for the job in the local time for the entity where
the activity occurred.
notes The job notes.
status_notes The job status notes.
state_desc_h The description of the current state of the job, from the Job_State table.
color_h The color (an RGB value) in which the job should be displayed to indicate
the state, from the job_state table.
oper_desc The description of the operation, from the Oper table.
act_start_time_utc The actual starting time of the job in UTC.
act_start_time_local The actual starting time of the job in the local time of the entity where the
activity occurred.
act_start_time The actual starting time of the job in the local time for t he caller where t he
activity occurred.
act_finish_time_utc The actual finish time of the job in UTC.
act_finish_time_local The actual finish time of the job in the local time of the entity where the
activity occurred.
act_finish_time The the actual finish time of the job in the local time for the caller where
the activity occurred.
can_sched_jobs The string true or false that specifies whether the targeted scheduled
entity can schedule jobs, from the Ent table

52 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

mo_id The ID of the manufacturing order to which the work order belongs, from
the Wo table.
run_ent_id The ID of the entity on which the job is run.
run_ent_name The name of the entity on which the job is run.
row_id_h The row ID of the job record in the Job table.
num_decimals_h The number of decimals to be used in displaying quantities for the item
produced by the job.
num_decimals_good_pp The value of the system attribute Max decimals of good piece part entries
(attr_id 326 in the System_Attr table) and is used when the
num_decimals column is 0.
spare1 The contents of the user-defined spare1 field, from the It em table.
spare2 The contents of the user-defined spare1 field, from the It em table.
spare3 The contents of the user-defined spare1 field, from the It em table.
spare4 The contents of the user-defined spare1 field, from the It em table.
edit_time_h The last time the job record was edited.
job_pos_h The job position used to run the job; from the Job_Exec table. If the job is
not running, the value is null.
def_lot_no The default lot number for items produced by the job; from the Job_Bom
table.
job_spare1 The contents of the user-defined job spare1 field.
job_spare2 The contents of the user-defined job spare2 field.
job_spare3 The contents of the user-defined job spare3 field.
job_spare4 The contents of the user-defined job spare4 field.
concurrent_link The number used to link the job to others so all jobs start at the same
time. A value of 0 denot es that the job not linked.
wo_desc The description of the work order; from the Wo tabl e.
queue_item_item_id_h A string that identifies the item whose attributes are to be included in the
returned array for display in the queue.
The item attributes that are returned are those whose visible_in_queue
flag is set to true.
The attribute information is returned as the following column pair:
 attr<attr_id>, which is the value of the attribut e whose ID is the
<attr_id> part of the column name
 attr<attr_id>d_h, which is The description of the attribute whose ID is
the <attr_id> part of the column name

Version 6.0 53
MES Web API Reference Production Endpoints

Data Name Description

queue_job_wo_id_h The ID of the work order that, along with the queue_job_oper_id_h and
queue_job_seq_no_h columns, identify the job whose attributes are to
be included in the returned array for dis play in the queue.
The job attributes that are returned are those whose visible_in_queue
flag is set to true.
The attribute information is returned as the following column pair:
 attr<attr_id>, which is the value of the attribut e whose ID is the
<attr_id> part of the column name
 attr<attr_id>d_h, which is the description of the attribute whose ID is
the <attr_id> part of the column name
queue_job_oper_id_h The ID of the operation that is used to identify the job whose attributes
are to be included in the returned array for display in the queue.
queue_job_seq_no_h The sequenc e number that is used to identify the job whose attributes
are to be included in the returned array for display in the queue.

Get Job BOM Data


Gets the job BOM data for the specified job or BOM position.
Syntax
api/JobBom
?woId=<work order ID>
&operId=<operation ID>
&seqNo=<sequence number>
&bomPos=<BOM position>
Parameters
woId
Required string. The work order ID of the target job.
operId
Optional string. The operation ID of the target job.
seqNo
Optional integer. The sequence ID of the target job.
bomPos
Optional integer. The BOM position.
Examples
To get the BOM data for the job identified by work order WO20171213.2445, operation Roast, and
sequence number 3:
api/JobBom?woId=WO20171213.2445&operId=Roast&seqNo=3
To get the BOM data for BOM position 24 for the job identified by work order WO20171213.2445,
operation Roast, and sequence number 3:
api/JobBom?woId=WO20171213.2445&operId=Roast&seqNo=3&bomPos=24
Examples: Skelta Lookups
To get the BOM data for a job identified by work order, operation, and sequence number:
api/JobBom?woId={woId}&operId={operId}&seqNo={seqNo}
To get the BOM data for a BOM position of a job:

54 Version 6.0
Production Endpoints MES Web API Reference

api/JobBom?woId={woId}&operId={operId}&seqNo={seqNo}&bomPos={bomPos}
Return Value
Returns a JSON array that includes the following information about the matching job BOMs, from the
Job_Bom table. If no matching job BOMs are found, an empty JSON array is returned.

Data Name Description

wo_id The ID of the work order for the job.


oper_id The ID of the operation for the job.
seq_no The sequenc e number for the job.
bom_pos The BOM position.
job_bom_subst_exist The string true or false that indicat es whet her substitutes exist for the
BOM item.
current_subst The alt_no of the currently used item substitute, from the
Job_BOM_Subst table. The default is null.
pref An integer that indicates the preference of the substitute, from the
Job_Bom_Substitute table. The lower-numbered alternatives are
preferable to the higher-numbered ones.
subst_level An integer that is the substitution level a user must have to be able to use
the substitute item. The default is 0 (any user can use the substitute
item).
item_id The ID of the item.
item_desc The description of the item.
item_display A string that is a value that indicat es what format to use when identifying
the item in the user interface. The format values are defined in the
system attribute Item display (attr_id 210 in the System_Attr table).
Possible values and their formats are:
0 = item_id
1 = item_desc
2 = item_id (item_desc)
3 = item_desc(item_id)
uom_id The ID of the item unit of measurement (UOM).
description The description of the UOM.
abbreviation The abbreviation for the UOM.
lifetime The number of days left before the item expires. It never expires if the
value is null.
reqd_grade_cd The required grade code for the BOM Item. If null, the required grade
code is disabled.
item_grade_desc The item grade description of the It em_Grade table.
color A number that is the RGB background color associated with the required
grade of the Item_Grade table.
instruction Instructions about how to consume or produce this item.

Version 6.0 55
MES Web API Reference Production Endpoints

Data Name Description

qty_per_parent_item The nominal quantity of the item required per unit of the parent item.
max_qty_per_parent_item The maximum acceptable quantity of this BOM component.
min_qty_per_parent_item The minimum acceptable quantity of this BOM component.
reqd_start_val The amount of the component required before running the job.
reqd_start_val_is_pct The string true or false that indicates whether the required start value is
a percentage or absolut e quantity.
qty_prod The quantity of the item produced up to the current date and time.
qty_rejected The quantity of the item rejected up to the current date and time.
update_inv The string true or false that specifies whether the invent ory table is
updated with consumed items.
backflush The string true or false that specifies whether the consumption is
backflushed.
def_reas_cd The default consumption or productio n code of the item. If null, it defaults
to the value specified for the entity that runs the job.
reas_desc The description of the default reason code of the Item_Reas table.
def_lot_no The default lot number for the item.
def_sublot_no The default sublot number for the item.
def_storage_ent_id The ID of the default storage entity for the item or the by -product.
ent_name The default storage entity (def_storage_ent _id), from the Ent table.
scaling_factor The scaling factor to use to obtain the correct units from counts if the
counts are item -dependent.
must_consume_from_inv The string true or false that specifies whether consumption must occur
from inventory for this item.
may_choose_alt _inv_loc The string true or false that specifies whether the user can select
alternate inventory locations when consuming or producing this item.
may_create_new_lots The string true or false that specifies whether the user can creat e new
lots when consuming or producing this item.
must_consume_from_wip The string true or false that specifies whether the lots consumed during
a job are limited to the lots produced to the Item_Inv table for the same
work order in an upstream job.
must_consume_before_prod The string true or false that specifies whether the production
transactions are prevent ed until accept able quantities of BOM
components are consumed, as specified in the maxQtyPerParent Item
and minQtyPerParentItem parameters.
consumed_so_far The quantity of the item consumed.
constant_qty The string true or false that specifies whether the quantity of the
consumed item is independent of the quantity of the parent item that is
produced.
est_time The number of hours to consume or produce the component per unit of
BOM position zero.

56 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

spare1 The contents of the user-defined spare1 field.


spare2 The contents of the user-defined spare2 field.
spare3 The contents of the user-defined spare3 field.
spare4 The contents of the user-defined spare4 field.
qty_reqd The quantity required for the job from the Job table.
qty_at_start The starting quantity for the job from the Job table.
num_decimals The number of decimal plac es used for quantity values of the item in the
Item table.
item_spare1 The contents of the user-defined item spare1 field.
item_spare2 The contents of the user-defined item spare2 field.
item_spare3 The contents of the user-defined item spare3 field.
item_spare4 The contents of the user-defined item spare4 field.
last_edit_comment Comments about why the job BOM rec ord was added or updated.
last_edit_by The ID of the user who added or last updated the job BOM record.
last_edit_at The dat e and time, in UTC, that indicates when the job BOM record was
added or last updated.
qty_used_in_steps The quantity of items per unit of the parent item required for this job at
this BOM position. Returns 0 for BOM position 0 (the production item).
mod_id A SQL rowversion value that is incremented whenever the job BOM
record is updated.
actual_qty The calculated quantity for the Job_B om record.
If the Job_B om record is for a consumed item and the consumption
quantities of the consumed item do not depend on the number of
produced parent items (that is, the BOM item is configured as "c onstant
quantity"), then this quantity will be equal to the quantity per parent item.
For all other records, it will be one of the following, whichever value is
greater:
 The start quantity multiplied by the quantity per parent item.
 The sum of the produced quantity plus the rejected quantity
multiplied by the quantity per parent item.

Version 6.0 57
MES Web API Reference Production Endpoints

Data Name Description

actual_min_qty The calculated minimum quantity for the Job_Bom record.


If the Job_B om record is for a consumed item and the consumption
quantities of the consumed item do not depend on the number of
produced parent items (that is, the BOM item is configured as "constant
quantity"), then this quantity will be equal to the minimum quantity per
parent item.
For all other records, it will be one of the following, whichever value is
greater:
 The start quantity multiplied by the minimum quantity per parent
item.
 The sum of the produced quantity plus the rejected quantity
multiplied by the minimum quantity per parent item.
actual_max_qty The calculated maximum quantity for the Job_Bom record.
If the Job_B om record is for a consumed item and the consumption
quantities of the consumed item do not depend on the number of
produced parent items (that is, the BOM item is configured as "constant
quantity"), then this quantity will be equal to the maximum quantity per
parent item.
For all other records, it will be one of the following, whichever value is
greater:
 The start quantity multiplied by the maximum quantity per parent
item.
 The sum of the produced quantity plus the rejected quantity
multiplied by the maximum quantity per parent item.

Get Job BOM Substitute Data


Gets the job BOM substitute data for the specified job or BOM position.
Syntax
api/JobBomSubsts
?woId=<work order ID>
&operId=<operation ID>
&seqNo=<sequence number>
&bomPos=<BOM position>
Parameters
woId
Required string. The work order ID of the target job.
operId
Required string. The operation ID of the target job.
seqNo
Required integer. The sequenc e ID of the target job
bomPos
Optional integer. The BOM position.

58 Version 6.0
Production Endpoints MES Web API Reference

Examples
To get the BOM substitute data for the job identified by work order WO20171213. 2445, operation Roast,
and sequence number 3:
api/JobBomSubsts?woId=WO20171213.2445&operId=Roast&seqNo=3
To get the BOM substitute data for the same job but at BOM position 24:
api/JobBomSubsts?woId=WO20171213.2445&operId=Roast
&seqNo=3&bomPos=24
Examples: Skelta Lookups
To get the BOM substitute data for a job identified by work order, operation, and sequence number:
api/JobBomSubsts?woId={woId}&operId={operId}&seqNo={seqNo}
To get the BOM substitute data for a job identified by work order, operation, sequence number, and BOM
position:
api/JobBomSubsts?woId={woId}&operId={operId}&seqNo={seqNo}&bomPos={bomPos}
Return Value
Returns a JSON array that includes the following information about the matching job BOM substitutes,
from the Job_Bom_S ubst table. If no matching job BOM substitutes are found, an empty JSON array is
returned.

Data Name Description

item_id A string that is the ID of the item.


item_desc A string that is the description of the item.
def_lot_no A string that is the default lot number for the item.
def_storage_ent_id An integer that is the ID of the default storage entity for the item or the
by-product.
def_reas_cd An integer that specifies the default consumption or production code of
an item. If null, it defaults to the value specified for the entity that runs the
job.
may_create_new_lots A Boolean that specifies whether the user can create new lots when
consuming or producing this item.
may_choose_alt _inv_loc A Boolean that specifies whether the user can select alternat e inventory
locations when cons uming or producing this item.
bom_pos An integer that is the BOM position.
current_subst An integer that is the alt_no of the currently used substitute from the
Job_BOM_Subst table. The default is null.
alt_no An integer that is the alternative for the given BOM position.
num_decimals An integer that is the number of decimal places used for quantity values
of the item in the Item table.
description A string that is the description of the item’s unit of measure.

Get Job Specifications


Gets the job specific ation data for the jobs specified by the filter parameters.
Syntax
api/JobSpec?woId=<work order ID>&operId=<operation ID>&seqNo=<sequence number>

Version 6.0 59
MES Web API Reference Production Endpoints

Parameters
woId
Optional string. The work order ID of the target job.
operId
Optional string. The operation ID of the target job.
seqNo
Optional integer. The sequence number of the target job
Examples
To get the specification data for the job identified by work order WO20171213.2445, operation Roast,
and sequence number 3:
api/JobSpec?woId=WO20171213.2445&operId=Roast&seqNo=3
Examples: Skelta Lookups
To get the specification data for a job identified by work order, operation, and sequence number:
api/JobSpec?woId={woId}&operId={operId}&seqNo={operId}
Return Value
Returns a JSON array that contains the following information about the job specifications, from the Job,
Job_Spec, and Spec tables. If no matching job specifications are found, an empty JSON array is
returned.

Data Name Description

wo_id The ID of the work order.


oper_id The ID of the operation.
seq_no The operation sequence number of the job.
step_no The number of the step with which the specification is associated.
spec_id The ID of the specification.
spec_desc The description of the specification.
spec_value The planned specification value.
act_spec_value The actual specification value.
assoc_file The path and file name of the file associated with the specification.
assoc_file_type The file type of the file associated with the specification.
comments The comments or instructions for the operator regarding the
specification.
min_value The minimum acceptable value for the specification. The default value is
null.
max_value The maximum acceptable value for the specification. The default value is
null.
access_level The security access level for modifying the specification. The default
value is null.
spec_desc The description of the job spec.
grp_id The ID of the s pec group of which t he specification is a member, from t he
Spec table.

60 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

units The unit of measure for the specification value, from the Spec table.
spare1 The contents of the user-defined spare1 field, from the Spec table.
spare2 The contents of the user-defined spare2 field, from the Spec table.
spare3 The contents of the user-defined spare3 field, from the Spec table.
spare4 The contents of the user-defined spare4 field, from the Spec table.
last_edit_comment Comments about why the job specification record was added or updated.
last_edit_by The ID of the user who added or last updat ed the job specification record.
last_edit_at The date and time, in UTC, that indicates when the job specification
record was added or last updat ed.
mod_id A SQL rowversion value that is incremented whenever the job
specification record is updated.
data_type An enumeration that indicates the data type of the specification, from the
Spec table.
0 = string (the default)
1 = floating point number
display_seq The specifications display sequenc e number. The display sequence
numbers are used to determine the order of specifications wit h their
specification group when they are listed in the user interface. From the
Spec table.

Get the Job States


Gets the valid job states.
Syntax
api/Jobstate
Return Value
Returns a JSON object that contains the following information about the job states, from the Job_Stat e
table. (The Job_Stat e table also includes two job step states, but those states are not returned as this
endpoint is for ret rieving only job states.)

Version 6.0 61
MES Web API Reference Production Endpoints

Column Name Description

state_code An integer that is the code for the job state:


1 = New. The job is scheduled to be run but is not yet ready to start
because upstream work needs to be done first, unless the job is for a
first operation of a work order. When a new work order is assigned to
a line, a job is created for eac h entity on the line with a status of New.
2 = Ready. The job is ready to start; all of the requirements for
running the job have been met.
3 = Running. The job is currently running on an entity.
4 = Complete. The job has finished.
5 = Suspended. The job has been temporarily paused, typically in
favor of anot her more important job.
6 = On Hold. The job has been paused indefinitely, typically because
of some problem such as material or machine issues.
7 = Canceled. The job has been permanently stopped before being
completed; a record of it is still maintained in the MES database.
state_desc A string that is the description of the job state.
color An integer that indicates the job state’s RGB background color in the
user interface.

Get the Job Executor Record for an Entity


Gets the job executor record for an entity, as specified by the entity ID.
If there are more than one job executor record for the entity, only the record for position 0 is returned.
Syntax
api/entity/<entityID>/jobExec
Parameters
entityID
Required integer. The entity ID.
Examples
To get the job executor record for the entity with an ID of 31:
api/entity/31/jobExec
Examples: Skelta Lookups
To get the job executor record for an entity:
api/entity/{entityID}/jobExec
Return Value
Returns a JSON object that contains the following job execut or information for the specified entity, from
the Job_Exec table. If no matching entity record is found, an empty dataset is returned.

Data Name Description

EntityID An integer that is the ID of the entity.


DefProdReas Cd An integer that is the default reason code for good production.

62 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

DefCons Reas Cd An integer that is the default reason code for normal consumption.
AutoSeqStartOption An integer that specifies when to automatically start the job with the next
sequence number:
0 = Do not start the job with t he next sequence number automatically
1 = Start the job with the next sequence number when the job with
the previous sequence number is completed
AutoJobStartOption An integer that specifies when to automatically start the next job:
0 = Do not start the next job automatically
1 = Start the next job when ready and the previous job has
completed
AutoJobEndOption An integer that specifies when to automatically end the job:
0 = Do not end the job automatically
1 = End the job when the quantity produced is equal to or greater
than the required quantity
InclIt emClass A Boolean that specifies whether to include item class reasons with the
entity reason.
MustProdReqdQty A Boolean that specifies whether the required quantity must be produc ed
(good) to end the job.
RunWithoutOperator A Boolean that specifies whether jobs can run without an operator
logged onto this entity.
SuppressStartQtyPrompt A Boolean that specifies whether to suppress the prompt to specify a
quantity to start that is typically displayed when the Start Some butt on is
selected.
cur_wo_id A string that is current work order ID.
cur_oper_id A string that is the current operation ID.
cur_seq_no An integer that is the current sequence number.
def_to_ent_id An integer that is the ID of the default storage entity for good production.

def_lot_no A string that is the default lot number.


def_prod_reas_c d An integer that is the default reason code for good production.
spare1 A string that is the content of the spare1 value.
spare2 A string that is the content of the spare2 value.
spare3 A string that is the content of the spare3 value.
spare4 A string that is the content of the spare4 value.

Get Item Production for a Job


Gets the item production for a job.

Version 6.0 63
MES Web API Reference Production Endpoints

Syntax
api/Production
?woId=<work order ID>
&opId=<operation ID>
&seqId=<sequence number>
&shiftStart=<shift start date and time>
&lastNHours=<number of hours>
&itemId=<item ID>
Parameters
woId
Required string. The work order ID of the target job.
opId
Required string. The operation ID of the target job.
seqId
Required integer. The sequenc e number of the target job.
shiftStart
Optional datetime. The start time of the shift by which to filter the production data.
lastNHours
Optional integer. The number of previous hours of data to include.
itemId
Optional string. The ID of the item by which to filter the production data.
Examples
To get the production for the job for work order WO20171213.2445, operation Roast, and sequence
number 2:
api/Production?woId=WO20171213.2445&opId=Roast&seqId=2
To get the production for the same job but for the item peanuts for the last 4 hours:
api/Production?woId=WO20171213.2445&opId=Roast&seqId=2&lastNHours=4&itemId=p
eanuts
To get the production for the same job during the morning shift that starts at 8 am:
api/Production?woId=WO20171213.2445&opId=Roast&seqId=2&shiftStart=8:00 AM
Examples: Skelta Lookups
To get the production for a job:
api/Production?woId={woId}&opId={opId}&seqId={seqId}
To get the production for a job for a specific item and filtered by a number of previous hours:
api/Production?woId={woId}&opId={opId}&seqId={seqId}&lastNHours={lastNHours}
&itemId={itemId}
To get the production for a job during a shift:
api/Production?woId={woId}&opId={opId}&seqId={seqId}&shiftStart={shiftStart}

Return Value
Returns a JSON array that contains the following information for each item production that matches the
filter parameters, from the Item_Prod table. If no matching production records are found, an empty array
is returned.

Data Name Description

row_id The row ID of the item production record in the It em_Prod table.

64 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

wo_id The work order ID.

oper_id The operation ID.

seq_no The sequenc e number, which indicates the Job table row.

shift_start_utc The shift start time in UTC time.

shift_start_local The shift start time in the user's local time.

shift_start The shift start time in the local time of the database server.

hour_start_utc The hour in UTC time in which production occurred. The minutes portion
will not be 0 if the time zone is not an integer number of hours from UTC.
The seconds portion will always be 0.
hour_start_local The hour in the user's local time in which production occurred. The
minutes and seconds portion will always be 0.
hour_start The hour in the local time of the dat abase server in which production
occurred. The minutes and seconds portion will always be 0.
item_id The item ID.

item_desc The item description, from the Item table.

uom_id The ID of the unit of measure (UOM), from the Item table.

num_decimals The number of decimal places that is used for quantities of this item.

serial_no_lvl_h The number that indicat es the level being used, lot or sublot, to indicate
individual serial numbers, from the Item table.
 0: The lot number is the serial number.
 > 0: A particular sublot level is the serial number.
 -1: There are no serial numbers.
description The unique description of the UOM, from the Uom table.
abbreviation The abbreviation to append to quantities, from the Uom table.

lifetime The lifetime of the item before it expires, in days; from the Item table.

lot_no The lot number.

rm_lot_no The lot number of raw material from which this lot/sublot was produced.

sublot_no The sublot number

rm_sublot_no The sublot number of raw mat erial from which this lot/sublot was
produced.
reas_cd The reason code that uniquely identifies grade + status of goods
produced.
reas_desc The description of the reason, from the Item_Reas table.

user_id The ID of the user who is making this production entry.

user_desc The user description, from the User_Name table.

ent_id The entity ID.

Version 6.0 65
MES Web API Reference Production Endpoints

Data Name Description

ent_name The entity name, from the Ent table.

shift_id The shift ID.

shift_desc The shift description, from the Shift table.

grade_cd The grade code of produced goods.

item_grade_desc The grade description, from the Item_Grade table.

item_grade_color The numeric value of the RGB background color of the item grade, from
the Item_Grade table.
status_cd The status code of produced goods.

item_status_desc The status description, from the Item_State table.

item_state_color The numeric value of the RGB background color of the item state, from
the Item_State table.
to_ent _id The ID of the storage entity for produced goods.
to_ent _name The name of the storage entity for produced goods.
good_prod The string true or false that specifies whether this production is good.
qty_prod The quantity produced.
qty_prod_erp The quantity produced value that was trans fered to an ERP system.
processed_flag The processed flag for this lot.
byproduct The string true or false that specifies whether the produced item is a
by-product.
ext_ref The reference to an external system for defect tracking or any other
purpose.
move_status An integer value that acts a a flag to indicat e whether this lot has been
moved to the next operation.
genealogy_id The genealogy ID.

event_id The event ID.

segment _requirement_id The segment requirement ID.

segment _res ponse_id The segment res ponse ID.


comments Comments about the item production.
spare1 The contents of the user-defined spare1 field.
spare2 The contents of the user-defined spare2 field.
spare3 The contents of the user-defined spare3 field.
spare4 The contents of the user-defined spare4 field.
item_spare1 The contents of the user-defined spare1 field of the item.
item_spare2 The contents of the user-defined spare2 field of the item.
item_spare3 The contents of the user-defined spare3 field of the item.

66 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

item_spare4 The contents of the user-defined spare4 field of the item.


last_edit_comment Comments about why the item production record was added or updated.

last_edit_by The ID of the user who added or last updated the item production record.

last_edit_at The date and time, in UTC, when the item production rec ord was added
or last updated.
created_at_utc The date and time when the item production record was created, in UTC
time.
created_at_local The date and time when the item production record was created, in the
user’s local time.
created_at The date and time when the item production record was created, in local
time where the database is located.
row_id The row ID of the related job record in the Job table.

serial_no_lvl A number t hat indicates whether the serial number is based on the item's
lot number or not.
If the serial number is based on the lot number, a 0 is returned.
Otherwise, a -1 is returned.

Get Item Consumption for a Job


Gets item consumption for a job.
Syntax
api/consumption
?woId=<work order ID>
&opId=<operation ID>
&seqNo=<sequence number>
&itemId=<item ID>
&userId=<user ID>
&shiftId=<shift ID>
Parameters
woId
Required string. The ID of the work order for the job.
opId
Required string. The ID of the operation for the job.
seqNo
Required integer. The sequenc e number of the job.
itemId
Optional string. The ID of an item by which to filter the consumption data.
userId
Optional string. The ID of a user by which to filter th e consumption data.
shiftId
Optional integer. The ID of a shift by which to filter the consumption data.

Version 6.0 67
MES Web API Reference Production Endpoints

Examples
To get the consumption for the job for work order WO20171213. 2445, operation Roast, and sequence
number 2:
api/consumption?woId=WO20171213.2445&opId=Roast&seqNo=2
To get the consumption for the same job entered by the user tad.smith:
api/consumption?woId=WO20171213.2445&opId=Roast&seqNo=2&userId=tad.smith
To get the consumption for the same job during the morning shift, which has an ID of 2:
api/consumption?woId=WO20171213.2445&opId=Roast&seqNo=2&shiftId=2
Examples: Skelta Lookups
To get the consumption for a job:
api/consumption?woId={woId}&opId={opId}&seqNo={seqNo}
To get the consumption for a job for a specific item:
api/consumption?woId={woId}&opId={opId}&seqNo={seqNo}&itemId={itemId}
To get the consumption for a job during a shift:
api/consumption?woId={woId}&opId={opId}&seqNo={seqNo}&shiftId={shiftStart}

Return Value
Returns a JSON array that contains the following information for each item consumption record that
matches the filter parameters, from the Item_Cons table. If no matching consumption records are found,
an empty array is returned.

Data Name Description

row_id The record’s unique row ID.


wo_id The work order ID for identifying the job that consumed the item.
oper_id The operation ID for identifying the job that consumed the item.
seq_no The operation sequence number for identifying the job that consumed
the item.
shift_start_utc The shift start in UTC time.
shift_start_local The shift start in the user’s local time.
shift_start The shift start in the local time of the database location.
item_id The ID of the consumed item.
item_desc The item description, from the Item table.
serial_no_lvl The number that indicat es the level being used, lot or sublot, to indicate
individual serial numbers, from the Item table.
 0: The lot_no is the serial number.
 > 0: A particular sublot level is the serial number.
 -1: There are no serial numbers.
lot_no The lot number of the consumed item.
fg_lot_no The lot number of the parent item.
sublot_no The sublot number of consumed item.
fg_sublot _no The sublot number of the parent item.

68 Version 6.0
Production Endpoints MES Web API Reference

Data Name Description

reas_cd The reason that uniquely identifies the grade + status of goods
consumed.
reas_desc The reason description, from the It em_Reas table.
user_id The ID of the user who ran the job that consumed the item.
user_desc The user description, from the User_Name table.
item_scrapped The string true or false that specifies whether the consumed item is
waste.
ent_id The ID of the entity at which the item was consumed.
ent_name The name of the entity at which the item was consumed, from the Ent
table.
shift_id The ID of the shift during which the item was consumed.
shift_desc The description of the shift during which the item was consumed, from
the Shift table.
grade_cd The grade code of the consumed goods.
item_grade_desc The grade description, from the Item_Grade table.
item_grade_color The number that is RGB background color of the grade, from the
Item_Grade table.
status_cd The status code of the consumed goods.
item_status_desc The status description, from the Item_State table.
item_state_color The number that is RGB background color of the item state, from the
Item_Stat e table.
from_ent_id The ID of the storage entity from which the item was consumed.
from_ent_name The name of the storage entity from which the item was consumed, from
the Ent table
qty_cons The quantity consumed.
qty_cons_erp The quantity consumed value that was report ed to an E RP system.
ext_ref The reference to an external system for defect tracking or any other
purpose.
transaction_type The transaction type enumerated value.
0 = normal
1 = lot split
2 = combination
genealogy_id The genealogy ID.
upstream_event_id The upstream event ID.
segment _requirement_id The segment requirement ID.
segment _res ponse_id The segment res ponse ID.
comments The comments about the item consumption.
spare1 The contents of the user-defined spare1 field.

Version 6.0 69
MES Web API Reference Production Endpoints

Data Name Description

spare2 The contents of the user-defined spare2 field.


spare3 The contents of the user-defined spare3 field.
spare4 The contents of the user-defined spare4 field.
last_edit_comment The comments about why the record was added or updated.
last_edit_by The ID of the user who added or last updated this record.
last_edit_at The date and time when the record was added or last updated.
created_at_utc The date and time when the item cons umption record was created, in
UTC time.
created_at_local The date and time when the item consumption record was created, in t he
user’s local time.
created_at The date and time when the item cons umption record was created, in
local time where the database is located.

70 Version 6.0
MES Web API Reference

C HAPTER 4
Utilization Endpoints
In This Chapter
Get Utilization States .................................................................................................................... 71
Get Utilization Reason Groups....................................................................................................... 73
Get Utilization Reasons ................................................................................................................. 74
Get Utilization Reasons as Key/Value Pairs .................................................................................... 76
Get Utilization Reason Cat egory Sets of Values.............................................................................. 76
Get Allowable Utilization Reasons for an Entity ............................................................................... 77
Get All Utilization Executor Records ............................................................................................... 77
Get the Utilization Executor Record for an Entity ............................................................................. 78
Get the OEE Executor Record for an Entity .................................................................................... 80
Get the Utilization History E vents for an Entity ................................................................................ 81
Get a Specific Utilization History E vent ........................................................................................... 83
Get Utilization Counts and Durations for an Entity or Line ................................................................ 85
KPI Endpoint ................................................................................................................................ 87

Get Utilization States


Gets all defined utilization states or a specific state.
Syntax
api/Utilization/state/<stateCd>
Parameters
stateCd
Optional integer. To get a specific utilization state, enter its state code.
Examples
To get all utilization states:
api/Utilization/state
To get the utilization state whose code is 5:
api/Utilization/state/5
Examples: Skelta Lookups
To get all utilization states:
api/Utilization/state
To get a specific utilization state:
api/Utilization/state/{stateCd}
Return Value
Returns a JSON object that contains the following information for all utilization states or the specified
state. If no matching state is found, an empty object is returned.

Version 6.0 71
MES Web API Reference Utilization Endpoints

Data Name Description

StateCode An integer that is the code for the utilization state.


StateDescription A string that is the description of the utilization state.
Color An HTML color string that indicates the RGB background color of the
utilization state.
LastEditAt A datetime that indicates when the rec ord was added or last updated.
Runtime This state's default utilization reason setting for a Boolean that indicates
whet her the utilization reason is used for runtime.
Downtime This state's default utilization reason setting for a Boolean that indicates
whet her the utilization reason is used for downtime.
Setuptime This state's default utilization reason setting for a Boolean that indicates
whet her the utilization reason is used for setup time.
TearDownTime This state's default utilization reason setting for a Boolean that indicates
whet her the utilization reason is used for teardown time.
FixedTime This state's default utilization reason setting for a Boolean that indicates
whet her this utilization reason is used for fixed time.
VariableTime This state's default utilization reason setting for a Boolean that indicates
whet her this utilization reason is used for variable time.
Failure This state's default utilization reason setting for a Boolean that indicates
whet her any time that the entity spends in the utilization reason code is
considered failure time.
LabCode This state's default utilization reason setting for a string that is the default
labor code for the utilization reason when it is manually selected.

Priority This state's default utilization reason setting for an integer that is the
priority of the utilization reason, which is used to determine the reason for
a line that has two or more bottleneck entities with differing reasons.
MaxDuration An integer that is the maximum duration, in seconds, that the utilization
reason is not considered to be in a severe condition or before the reas on
is changed to a new utilization reason code.
 If the New Reason Code parameter is not being used (that is, it is
null) and the maximum duration is exceeded, the reason is marked
as being Severe and the event is considered to be in a severe
condition. The Severe flag is typically used with downtime events.
 If the New Reason Code paramet er is being used and the maximum
duration is exceeded, the utilization reason for the entity is changed
to the new reason specified in the New Reason Code parameter.

NewReasonCode This state's default utilization reason setting for an integer that specifies
the utilization reason to which the reason should change when the
maximum duration is exceeded.
StandardTime This state's default utilization reason setting for a floating point number
that specifies the standard amount of time, in minutes, that an entity is
expected to be in the utilization reason.

72 Version 6.0
Utilization Endpoints MES Web API Reference

Data Name Description

MinTime This state's default utilization reason setting for a floating point number
that specifies the minimum amount of time, in minutes, that an entit y is
expected to be in the utilization reason.
MaxTime This state's default utilization reason setting for a floating point number
that specifies the maximum amount of time, in minutes, that an entity is
expected to be in the utilization reason.
EntEnabled This state's default utilization reason setting for a Boolean that indicates
whet her an entity in this utilization reason is to be considered enabled.

Category 1 This state's default utilization reason entry for a string that is the content
of the category1 field.
Category 2 This state's default utilization reason entry for a string that is the content
of the category2 field.
Category 3 This state's default utilization reason entry for a string that is the content
of the category3 field.
Category 4 This state's default utilization reason entry for a string that is the content
of the category4 field.

Get Utilization Reason Groups


Gets all defined utilization reason groups or a specific reason group.
Syntax
api/UtilReasonGroup/<reasonGroupCd>
Parameters
reasonGroupCd
Optional integer. To get a specific utilization reason group, enter its reason group c ode.
Examples
To get all utilization reason groups:
api/UtilReasonGroup
To get the utilization reason group whose code is 5:
api/UtilReasonGroup/5
Examples: Skelta Lookups
To get all utilization reason groups:
api/UtilReasonGroup
To get a specific utilization reas on group:
api/UtilReasonGroup/{reasonGroupCd}
Return Value
Returns a JSON object that contains the following information for all utilization reason groups or for the
specified reason group. If no matching reason group is found, an empty object is returned.

Data Name Description

GroupId An integer that is the ID of the utilization reason group.

Version 6.0 73
MES Web API Reference Utilization Endpoints

Data Name Description

Description A string that is the description of the utilization reason group.


ParentGroupId An integer that is the ID of the parent utilization reason group.
DisplaySequence An integer that is the order of display when displaying all the utilization
reason groups in the user interface.
Spare1 A string that is the content of the us er-defined spare1 field.
Spare2 A string that is the content of the us er-defined spare2 field.
Spare3 A string that is the content of the us er-defined spare3 field.
Spare4 A string that is the content of the us er-defined spare4 field.
LastEditAt A datetime that specifies when the utilization reas on group record was
added or last updated.

Get Utilization Reasons


Gets all defined utilization reasons or a specific utilization reason.
Syntax
api/Utilization/reason/<reasonCd>
Parameters
reasonCd
Optional integer. To get a specific utilization reason, enter its reason code.
Examples
To get all utilization reasons:
api/Utilization/reason
To get the utilization reason whose code is 20:
api/Utilization/reason/20
Examples: Skelta Lookups
To get all utilization reasons:
api/Utilization/reason
To get a specific utilization reas on:
api/Utilization/reason/{reasonCd}
Return Value
Returns a JSON object that contains the following information for all utilization reasons or the specified
reason. If no matching reason is found, an empty object is returned.

Data Name Description

Reas Code An integer that is the utilization reason code.


Description A string that is the description of the utilization reason.
StateCode An integer that is the utilization state code for this reason.
Reas GroupID An integer that is the ID of the utilization reason group.
IsRuntime A Boolean that indicates whether this utilization reason is used for
runtime events.

74 Version 6.0
Utilization Endpoints MES Web API Reference

Data Name Description

IsDowntime A Boolean that indicates whether this utilization reason is used for
downtime events.
IsSetuptime A Boolean that indicates whether this utilization reason is used for setup
time events.
Is Teardowntime A Boolean that indicates whether this utilization reason is used for
teardown time events.
IsFixedtime A Boolean that indicates whether this utilization reason is used for fixed
time events.
IsVartime A Boolean that indicates whether this utilization reason is used for
variable time events.
IsFailure A Boolean that indicates whether any time that the entity spends in this
utilization reason code is considered failure time.
DefaultLabCode A string that is the default labor code for the utilization reason when it is
manually selected.
DisplaySequence An integer that is the display sequence of this reas on. This number
determines the order of utilization reasons when they are listed under
their utilization reason group in the user interface.
EntEnabled A Boolean that indicates whether an entity in this utilization reason is to
be considered enabled.
Category 1 A string that is the content of the category1 field.
Category 2 A string that is the content of the category2 field.
Category 3 A string that is the content of the category3 field.
Category 4 A string that is the content of the category4 field.
Priority An integer t hat is the priority of the utilization reason. The priority number
is used to determine the reason for a line that has two or more bottleneck
entities with differing reasons.
MaximumDuration An integer that is the maximum duration, in seconds, that the utilization
reason is not considered to be in a severe condition or before the reas on
is changed to a new utilization reason code.
 If the New Reason Code parameter is not being used (that is, it is
null) and the maximum duration is exceeded, the reason is marked
as being Severe and the event is considered to be in a severe
condition. The Severe flag is typically used with downtime eve nts.
 If the New Reason Code paramet er is being used and the maximum
duration is exceeded, the utilization reason for the entity is changed
to the new reason specified in the New Reason Code parameter.

NewReasCode An integer that is the utilization reason code to which the reason should
change when the maximum duration is exceeded.
StandardTime A floating point number that is the standard amount of time, in minutes,
that an entity is expected to be in this utilization reason.
MaxTime A floating point number that is the maximum amount of time, in minut es,
that an entity is expected to be in this utilization reason.

Version 6.0 75
MES Web API Reference Utilization Endpoints

Data Name Description

MinTime A floating point number that is the minimum amount of time, in minutes,
that an entity is expected to be in this utilization reason.
LastEditAt A datetime that specifies when the record was added or last updated.

Get Utilization Reasons as Key/Value Pairs


Gets all defined utilization reasons as a collection of key/ value pairs (that is, a dictionary) that represent
the reason code/description.
Syntax
api/Utilization/reason?flatlist=<true or false>
Parameters
flatlist
Required B oolean. You can set this parameter to true or false. But the parameter must be included in
the endpoint and set to one of these values to return the utilization reasons as key/value pairs.
Examples
To get all utilization reasons as a list of key/value pairs:
api/Utilization?flatlist=true
Examples: Skelta Lookups
To get all utilization reasons as a list of key/value pairs:
api/Utilization?flatlist={flatlist}
Return Value
Returns a JSON object that is a dictionary of utilization reasons:
 The key is the reason code number
 The value is the fully qualified reason group path to the reason description, with the end of the path
being the description itself.

Get Utilization Reason Category Sets of Values


Gets all utilization reason category sets of values.
Syntax
api/UtilReasonCategorySet
Return Value
Returns a JSON object that contains the following information for each utilization reason category set of
possible values, from the Util_Reas_Cat egory_Set table. If no category sets are found, an empty object
is returned.

Data Name Description

Category An integer that indicates to which category the possible value applies.
A vailable categories are 1 through 4.

PossibleValue A string that is a possible value of the category.

76 Version 6.0
Utilization Endpoints MES Web API Reference

Get Allowable Utilization Reasons for an Entity


Gets all allowable utilization reasons for an entity, as specified by the entity ID.
Syntax
api/entity/<entityID>/allowableReasons
Parameters
entityID
Required integer. The entity ID.
Examples
To get the allowable utilization reasons for the entity with an ID of 15:
api/entity/15/allowableReasons
Examples: Skelta Lookup
To get the allowable utilization reasons for an entity:
api/entity/{entityID}/allowableReasons
Return Value
Returns a JSON object that contains the following information for the allowable utilization reasons for the
specified entity. If no matching entity record is found, an empty object is returned.

Data Name Description

ent_id An integer that is the ID of the entity.


raw_reas_cd A string that is the utilization raw reason code, from the Util_Raw_Reas
table.
reas_cd An integer that is the utilization reason code, from from the Util_Reas
table.

Get All Utilization Executor Records


Gets all utilization executor records.
Syntax
api/utilexec
Return Value
Returns a JSON object that contains the following information for each utilization executor record, from
the Util_Exec table. If no utilization executor records are found, an empty object is returned.

Data Name Description

ent_name A string that is the entity name, from Ent table ent _name column linked to
the executor record.
ent_id An integer that is the ID of the entity that is capturing utilization.
jobstart_reas _cd An integer that is the job start reason code.
jobend_reas_cd An integer that is the job end reason code.
shift_end_reas_cd An integer that is the shift end reas on code.
shift_start_reas_cd An integer that is the shift start reason code.

Version 6.0 77
MES Web API Reference Utilization Endpoints

Data Name Description

unkn_stop_reas_cd An integer that is the unknown stop reason code.


target _util A floating point number that is the target utilization for the entity.
spare1 A string that is the content of the us er-defined spare1 field.
spare2 A string that is the content of the us er-defined spare2 field.
spare3 A string that is the content of the us er-defined spare3 field.
spare4 A string that is the content of the us er-defined spare4 field.
state_desc A string that is the description of the current utilization state, from the
Util_State table state_desc column link ed to this record’s cur_state_cd
column value.
color An HTML color string that indicates the current utilization state’s RGB
background color in the user int erface.
cur_log_id An integer that is the current log_id, from the Util_History table.
Beginning with MES version 6.0, this column is not used for utilization
event records creat ed after the migration to the lat est databas e version.

cur_reas_duration A floating point number with two decimal places that is the current
duration, in minutes. Leading zeros are removed.

std_time A floating point number that is the standard amount of time, in minutes,
that an entity is expected to be in the current utilization reason.

cur_reas_cd An integer that is the current utilization reason code for the entity.
comments A string that is comments for the current utilization reason.
reas_desc A string that is the description for the utilization reason, from the
Util_Reas table reas _desc column link ed to this record’s cur_reas_c d
column value.
cur_reas_start_utc A datetime that is the current reason start time, in UTC.
cur_state_cd An integer that is the current utilization state for the entity.

Get the Utilization Executor Record for an Entity


Gets the utilization executor record for an entity, as specified by the entity ID.
Syntax
api/entity/<entityId>/utilExec
Parameters
entityId
Required integer. The entity ID.
Examples
To get the utilization executor record for the entity with an ID of 7:
api/entity/7/utilExec
Examples: Skelta Lookups
To get the utilization executor record for an entity:

78 Version 6.0
Utilization Endpoints MES Web API Reference

api/entity/{entityId}/utilExec
Return Value
Returns a JSON object that contains the following information for the utilization execut or record for the
specified entity, from the Util_Exec table. If no matching entity record is found, an empty object is
returned.

Data Name Description

ent_name A string that is the entity name, from Ent table ent _name column linked to
the executor record.
ent_id An integer that is the ID of the entity that is capturing utilization.
jobstart_reas _cd An integer that is the job start reason code.
jobend_reas_cd An integer that is the job end reason code.
shift_end_reas_cd An integer that is the shift end reas on code.
shift_start_reas_cd An integer that is the shift start reason code.
unkn_stop_reas_cd An integer that is the unknown stop reason code.
target _util A floating point number that is the target utilization for the entity.
spare1 A string that is the content of the us er-defined spare1 field.
spare2 A string that is the content of the us er-defined spare2 field.
spare3 A string that is the content of the us er-defined spare3 field.
spare4 A string that is the content of the us er-defined spare4 field.
state_desc A string that is the description of the current utilization state, from the
Util_State table state_desc column link ed to the executor rec ord’s
cur_state_cd column value.
color An HTML color string that indicates the current utilization state’s RGB
background color in the user int erface.
cur_log_id An integer that is the current utilization log_id, from t he Util_History table.
Beginning with MES version 6.0, this column is not used for new
utilization executor records.

cur_reas_duration A floating point number with two decimal places that is the current
duration, in minutes. Leading zeros are removed.

std_time A floating point number that is the standard amount of time, in minutes,
that an entity is expected to be in the current utilization reason.

cur_reas_cd An integer that is the current utilization reason code for the entity.
comments A string that is comments for the current utilization reason.
reas_desc A string that is the description for the utilization reason, from the
Util_Reas table reas _desc column link ed to this record’s cur_reas_c d
column value.
cur_reas_start_utc A datetime that is the current reason start time, in UTC.
cur_state_cd An integer that is the current utilization state for the entity.

Version 6.0 79
MES Web API Reference Utilization Endpoints

Get the OEE Executor Record for an Entity


Gets the OEE executor record for an entity, as specified by the entity ID.
Syntax
api/entity/<entityID>/oeeExec
Parameters
entityID
Required integer. The entity ID.
Examples
To get the OEE executor rec ord for the entity with an ID of 7:
api/entity/7/oeeExec
Examples: Skelta Lookups
To get the OEE executor rec ord for an entity:
api/entity/{entityID}/oeeExec
Return Value
Returns a JSON object that contains the following information for the OEE executor record for the
specified entity, from the Oee_Exec table. If no matching entity record is found, an empty object is
returned.

Data Name Description

EntityID An integer that is the ID of the entity.


ProdUom An integer that represents the production unit of meas ure:
0 = hours/batch
1 = minutes/batch
2 = seconds/batch
3 = batches/hour
4 = batches/minute
5 = batches/second
DefProdRate A double that is the default production rate.

BatchSize A double that identifies the standard batch size for reporting production
rate.
StdItemId A string that is the ID of the standard item to use for reporting production
rate.
CurrentPerf A double that is the current performance value.

CurrentQual A double that is the current quality value.

CurrentOee A double that is the current OEE.


TargetPerf A double that is the target performance value.

TargetQual A double that is the target quality value.

80 Version 6.0
Utilization Endpoints MES Web API Reference

Data Name Description

TargetOee A double that is the target OEE.

Get the Utilization History Events for an Entity


Gets the utilization history events for an entity, as specified by the entity ID, for a given time period.
Syntax
api/entity/<entityID>/utilLog?hourFilter=<time period in hours>
Parameters
entityID
Required integer. The entity ID.
hourFilter
Optional integer. The number of hours in the past, from the current time, for which to get the
utilization history events.
If the start time of the filter occurs in the middle of a utilization event, the actual start time and actual
entire duration of the event is included in the returned dataset. For example, let's say an event
started at 06:00 and ended at 09:00 the same day. Even if the hour filter started at 08:00, the total
duration of the event would 10,800 seconds. This duration is the duration_in_sec onds value i n the
returned object.

Note: If no value is supplied for the hourFilter parameter and there are a large number of utilization
history events for the entity, system performance might be affected as all utilization history events
will be returned.

Examples
To get the last 8 hours of utilization history events for the entity with an ID of 40:
api/entity/40/utilLog?hourFilter=8
Examples: Skelta Lookups
To get the utilization history events for an entity that occurred within a number of previous hours for an
entity:
api/entity/{entityID}/utilLog?hourFilter={hourFilter}
Return Value
Returns a JSON object that contains the following information about the events from the Util_History
table for the specified entity and time period. If no matching entity or events are found, an empty object is
returned.

Data Name Description

ent_id An integer that is the ID of the entity on which the event occurred.
log_id An integer that uniquely identifies the event record in the Util_History
table.
wo_id A string that specifies the work order for which the event occurred.
event_time_utc A datetime that indicates the actual start of the event, in UTC. This value
is the actual start time of the utilization event, even if the event started
before the beginning of the time period specified by the hourFilter
parameter.
event_end_time_utc A datetime that indicates the end of the event, in UTC.

Version 6.0 81
MES Web API Reference Utilization Endpoints

Data Name Description

duration_in_s econds An integer that is the actual duration of the event in seconds. This value
is the actual duration of the utilization event, even if the event started
before the beginning of the time period specified by the hourFilter
parameter.
duration A string that is the actual duration of the event in milliseconds. This value
is the actual duration of the utilization event, even if the event started
before the beginning of the time period specified by the hourFilter
parameter.
state_cd An integer that is the code for the utilization state.
state_desc A string that is the description of the utilization state.
state_color An HTML color string that indicates the utilization state’s RGB
background color in the user int erface.
reas_grp_id An integer that is the ID of the reas on group to which the utilization
reason belongs that is associated with the event.
reas_grp_desc A string that is the description of the reason group to which the utilization
reason belongs that is associated with the event.
reas_cd An integer that is the code for the utilization reason (e.g., the reason for
downtime) that is associated with the event.
reas_desc A string that is the description of the utilization reason (e. g., the reason
for downtime) that is associated with the event.
raw_reas_cd A string that is the raw reason code of the utilization reas on associated
with the event.
reas_pending A Boolean that indicates whether the us er should be prompted for an
override utilization reas on.
standard_time A floating point number that identifies the standard time in minutes for an
override utilization reas on.
downtime A Boolean that indicates that the event counts as downtime.

runtime A Boolean that indicates that the event counts as runtime.


failure A Boolean that indicates that the event counts as a failure.
comments A string that is comments about the event.
shift_id An integer that identifies the shift during which the event occurred. A
value of 0 will be returned if there is no shift associated with this rec ord.

shift_desc A string that is the description of the shift during which the event
occurred.
shift_start_utc A datetime that indicates when the shift started, in UTC time. Will have a
value of 1/1/1900 if there is no shift associated with the record.

82 Version 6.0
Utilization Endpoints MES Web API Reference

Data Name Description

severe A Boolean that indicates whether the utilization event exceeds the
maximum duration for the event’s reason.
If the utilization event is the current one for the entity, this flag is true only
if there is a maximum duration defined for the reason and the current
date and time is greater than the starting time of the utilization event plus
the maximum duration.
However, if the utilization event is not the current one, this flag is true
only if there is a maximum duration defined for the reason and the
duration of t he event is greater than the maximum duration of the reason.

category 1 A string that is the content of the category1 field.


category 2 A string that is the content of the category2 field.
category 3 A string that is the content of the category3 field.
category 4 A string that is the content of the category4 field.
spare1 A string that is the content of the spare1 field.
spare2 A string that is the content of the spare2 field.
spare3 A string that is the content of the spare3 field.
spare4 A string that is the content of the spare4 field.

Get a Specific Utilization History Event


Gets the specified utilization history event.
Syntax
api/UtilLog/<logID>
Parameters
logID
Required integer. The ID of the utilization history event to retrieve.
Examples
To get the utilization history event with an ID of 253:
api/UtilLog/253
Examples: Skelta Lookups
To get a utilization history event:
api/UtilLog/{logID}
Return Value
Returns a JSON object that contains the following information for the event, from the Util_History table. If
no matching event is found, an empty object is returned.

Data Name Description

ent_id An integer that identifies the entity on which the event occurred.

Version 6.0 83
MES Web API Reference Utilization Endpoints

Data Name Description

log_ID An integer that uniquely identifies the event record in the Util_History
table.
wo_id A string that specifies the work order for which the event occurred.
event_time_utc A datetime that indicates the start of the event, in UTC.
event_end_time_utc A datetime that indicates the end of the event, in UTC.
duration_in_s econds An integer that is the duration of the event, in seconds.
duration A string that is the duration of the event, in milliseconds.
state_cd An integer that is the code for the utilization state.
state_desc The description of the utilization state.
state_color An HTML color string that indicates the RGB background color of the
utilization state.
reas_grp_id An integer that is the ID of the utilization reason group to which the
reason belongs.
reas_grp_desc The description of the utilization reason group to which the reason
belongs.
reas_cd An integer that is the code for the utilization reason (e.g., the reason for
downtime) associated with the event.
reas_desc The description of the utilization reason (e.g., the reas on for downtime)
associated with the event.
raw_reas_cd A string that is the utilization raw reason code.

reas_pending A flag that indicates whether t he user should be prompt ed for an override
utilization reason.
standard_time A double that identifies the standard time in minut es for an override
reason.
downtime A Boolean that indicates whether any time that the entity spends in this
utilization reason code is considered downtime.
runtime A Boolean that indicates whether any time that the entity spends in this
utilization reason code is considered runtime.
failure A Boolean that indicates whether any time that the entity spends in this
utilization reason code is considered failure time.
comments A string that is comments about the event.
shift_id An integer that identifies the shift during which the event occurred. A
value of 0 will be returned if there is no shift associated with this rec ord.

shift_desc A string that is the description of the shift during which the event
occurred.
shift_start_utc A datetime that indicates when the shift started, in UTC. Will have a value
of 1/1/ 1900 if there is no shift associated with the record.

84 Version 6.0
Utilization Endpoints MES Web API Reference

Data Name Description

severe A Boolean that indicates whether the utilization event exceeds the
maximum duration for the event’s reason.
If the utilization event is the current one for the entity, this flag is true only
if there is a maximum duration defined for the reason and the current
date and time is greater than the starting time of the utilization event plus
the maximum duration.
However, if the utilization event is not the current one, this flag is true
only if there is a maximum duration defined for the reason and the
duration of t he event is greater than the maximum duration of the reason.

category 1 A string that is the content of the category1 field.


category 2 A string that is the content of the category2 field.
category 3 A string that is the content of the category3 field.
category 4 A string that is the content of the category4 field.
spare1 A string that is the content of the us er-defined spare1 field.
spare2 A string that is the content of the us er-defined spare2 field.
spare3 A string that is the content of the us er-defined spare3 field.
spare4 A string that is the content of the us er-defined spare4 field.

Get Utilization Counts and Durations for an Entity or Line


Gets counts and durations for the specified entity or the specified line in a dataset that includes columns
specific to the specified graph type. The returned counts and duration information can be filtered by
utilization state, utilization reason group, and a time period.
Because this endpoint queries historical tables and supports custom time periods, use caution when
querying large time periods (greater than a day), as system performance can be adversely affected.
Note that either an entity ID or a line ID parameter is required, but not both as only one of these
parameters is allowed.
Syntax
api/CountsAndDuration
?entityID=<entity ID> OR lineID=<ID>
&graphType=<graph type ID>
&utilStateCode=<utilization state code>
&reasGrpId=<reason group code>
&filterType=<filter type ID>
&filterDuration=<duration for LastNHours filter type>
Parameters
entityID
Required integer (if getting utilization counts and durations for an entity). The ID of the entity.
lineID
Required integer (if getting utilization counts and durations for a line). The ID of the line.
graphType
Required integer. The ID of the graph type to use. For a list of the available graph types, see
LineCountsAndDurationGraphType Enumeration on page 109.

Version 6.0 85
MES Web API Reference Utilization Endpoints

utilStateCode
Optional integer. The code of the utilization state by which to filter the ret rieved data.
reasGrpId
Optional integer. The ID of the utilization reason group by which to filter the retrieved data.
filterType
Optional integer. The ID of the time period filter type to use. For a list of the available filter types, see
Time Period FilterType Enumeration on page 109.
If no filter type is specified, the default value is 2, Current Shift.
filterDuration
Optional integer. If the filter type is set to 1, LastNHours, this is the value for N (that is, the number of
hours). If no value is provided, the default value of 1 hour is used.
Examples: Specifying an Entity
To get the utilization state counts and durations during the current day for the entity whose ID is 13 for
display in the utilization states graph:
api/CountsAndDuration?entityID=13&graphType=0&filterType=4
To get counts and durations for all utilization reasons during the last 4 hours for the entity whose ID is 13
for display in the utilization reas ons graph:
api/CountsAndDuration?entityID=13&graphType=2
&filterType=1&filterDuration=4
Examples: Specifying a Line
To get the utilization state counts and durations during the current day for the line whose ID is 21 for
display in the utilization states graph:
api/CountsAndDuration?lineID=21&graphType=0&filterType=4
To get counts and durations for all utilization reasons during the last 4 hours for the line whose ID is 21 for
display in the utilization reasons graph:
api/CountsAndDuration?lineID=21&graphType=2
&filterType=1&filterDuration=4
Examples: Skelta Lookup, Specifying an Entity
To get the utilization state counts and durations for a specific entity:
api/CountsAndDuration?entityID={entityID}&graphType={graphType}&filterType={
filterType}
To get counts and durations for all utilization states for an entity and allow the number of hours to be
specified if the LastNHours time period filter is specified:
api/CountsAndDuration?entityID={entityID}&graphType={graphType}&filterType={
filterType}&filterDuration={filterDuration}
Examples: Skelta Lookup, Specifying a Line
To get the utilization state counts and durations for a specific line:
api/CountsAndDuration?lineID={lineID}&graphType={graphType}&filterType={filt
erType}
To get counts and durations for all utilization states for a line and allow the number of hours to b e
specified if the LastNHours time period filter is specified:
api/CountsAndDuration?lineID={lineID}&graphType={graphType}&filterType={filt
erType}&filterDuration={filterDuration}
Return Value
For the specified entity or line and graph type, returns a JS ON object that contains calculated counts and
durations for each utilization state, reason group, or reason that match the specified filters. If no matching
records are found, an empty object is returned.

86 Version 6.0
Utilization Endpoints MES Web API Reference

The data of the returned object depend on the specified graph type (that is, the
LineCountsAndDurationGraphType enumeration value that was passed in the graphType parameter)
and are described below.

Data Name Description

Id An integer that is the code for the utilization state, utilization reas on, or
utilization reason group.
Name A string that is the description of the utilization state, utilization reason, or
utilization reason group.
Duration An integer that is the sum of the durations, in seconds, for all events with
this utilization state, utilization reason, or utilization reason group that
occurred.
Count An integer that is the number of events that have this utilization state,
utilization reason, or utilization reason group.
Color An integer that indicates RGB background color in the user interface for
this utilization state or utilization reason. This column is not returned if t he
graphType parameter is 1 (utilization reas on groups).
Active A Boolean that indicates whether one of the events with this utilization
state, utilization reason, or utilization reason group is the current one for
the entity or line.

KPI Endpoint
The kpi endpoint has the following variations, described in the next two topics:
 Get selected KPI data for an entity
 Get all KPI data for a line
Both variations return a JS ON object that contains the KPI data.

Get Selected KPI Data for an Entity


Gets selected KPI data for an entity, as specified by the entity ID and KPI data flags, during the specified
time period.
Syntax
api/kpi?entId=<entity ID>
&quality=<true or false>
&performance=<true or false>
&oee=<true or false>
&availability=<true or false>
&filterType=<time period filter type>
&filterDuration=<duration for LastNHours filter type>
Parameters
entId
Required integer. The entity ID.
qualit y
Optional Boolean. To get quality data, enter true. To omit quality data, enter fals e or do not include
this parameter in the call.

Version 6.0 87
MES Web API Reference Utilization Endpoints

performance
Optional Boolean. To get performance data, enter true. To omit performance dat a, enter false or do
not include this parameter in the call.
oee
Optional Boolean. To get OEE data, ent er true. To omit OEE data, enter false or do not include this
parameter in the call.
availability
Optional Boolean. To get availability data, enter true. To omit availability data, enter fals e or do not
include this parameter in the call.
filterType
Optional integer. The ID of the time period filter type to use. For a list of the available filter types, see
Time Period FilterType Enumeration on page 109.
If no filter type is specified, the default value is 2, Current Shift.
filterDuration
Optional integer. If the filter type is set to 1, LastNHours, this is the value for N (that is, the number of
hours). If no value is provided, the default value of 1 hour is used.
Examples
To get the availability data for the entity with an ID of 7 for the last 2 hours:
api/kpi?entId=7&availability=true
&filterType=1&filterDuration=2
Examples: Skelta Lookups
To get the KPI data for an entity within a specified time period and based on whether it is availability data:
api/kpi?entId={entId}&availability={availability}&filterType={filterType}
Return Value
See KPI Endpoint Return Value on page 89.

Get All KPI Data for a Line


Gets all KPI data for a line, as specified by the line ID.
Syntax
api/kpi?lineId=<line ID>
&filterType=<time period filter type>
&filterDuration=<duration for LastNHours filter type>
Parameters
lineId
Required integer. The line ID.
filterType
Optional integer. The ID of the time period filter type to use. For a list of the available filter types, see
Time Period FilterType Enumeration on page 109.
If no filter type is specified, the default value is 2, Current Shift.
filterDuration
Optional integer. If the filter type is set to 1, LastNHours, this is the value for N (that is, the number of
hours). If no value is provided, the default value of 1 hour is used.
Examples
To get the KPI data for the line with an ID of 33 for the last 5 hours:
api/kpi?lineId=33&filterType=1&filterDuration=5

88 Version 6.0
Utilization Endpoints MES Web API Reference

To get the KPI data for the line with an ID of 33 for today:
api/kpi?lineId=33&filterType=4
Examples: Skelta Lookups
To get the KPI data for a line withing a specified time period:
api/kpi?lineId={lineId}&filterType={filterType}
Return Value
See KPI Endpoint Return Value on page 89.

KPI Endpoint Return Value


The KPI endpoint returns a JSON object that contains the KPI data, described in the following table,
based on the specified endpoint and its parameters. The KPI data is calculated from multiple tables. If no
matching KPI data are found, an empty object is returned.
The columns of the returned dat aset are described below.

Data Name Description

Type A string that is the KPI data type:


0 = OEE
1 = Quality
2 = Availability
3 = Performance
Value A double that is the KPI data value.

Target A double that is the target KPI value.

Version 6.0 89
MES Web API Reference

C HAPTER 5
Attribute Endpoints
In This Chapter
Get All Attributes........................................................................................................................... 91
Get All Attribute Sets..................................................................................................................... 92
Get the Attributes for an Entity ....................................................................................................... 92
Get a System Attribute .................................................................................................................. 93

Get All Attributes


Gets all attributes.
Syntax
api/attribute
Return Value
Returns a JSON object that contains the following information for each attribut e, from the Attr table. If no
attributes are found, an empty object is returned.

Data Name Description

attr_id An integer that is the attribute ID.


attr_desc A string that is the attribute description.
data_type An integer that is an enumeration that indicates the data type of the
attribute.
0 = string (<= 80 characters; the default data type)
1 = drop-down list of values defined in the Attr_Set table
2 = integer
3 = currency
4 = color
5 = datetime
6 = floating point number
7 = percent
8 = check box
9 = non-editable
10 = time of day
11 = item reason (only if attr_grp = 3)
12 = long string (> 80 characters)

Version 6.0 91
MES Web API Reference Attribute Endpoints

Data Name Description

entry_type An enumeration that indicates the type of entry to allow for this attribute.
0 = value only (the default )
1 = notes only
2 = value and notes

attr_grp An integer that is the ID of the attribute group.


1 = items
2 = entities
3 = lots
4 = item classes
5 = jobs
6 = work orders
7 = operations
8 = processes
9 = sublot
10 = samples
11 = results
12 = lines
13 = shifts

Get All Attribute Sets


Gets all attribute sets.
Syntax
api/attributeset
Return Value
Returns a JSON object that contains the following information for each attribute set, from the Attr_Set
table. If no sets are found, an empty object is returned.

Data Name Description

attr_id An integer that is the attribute ID.


possible_value A string that is the possible value of the attribute.

Get the Attributes for an Entity


Gets all attributes for an entity, as specified by the entity ID.
Syntax
api/entity/<entityID>/attribute

92 Version 6.0
Attribute Endpoints MES Web API Reference

Parameters
entityID
Required integer. The entity ID.
Examples
To get the attributes for the entity with an ID of 12:
api/entity/12/attribute
Examples: Skelta Lookups
To get the attributes for an entity:
api/entity/{entityID}/attribute
Return Value
Returns a JSON object that contains the following information for the attributes for the specified entity,
from the Ent_Attr table. If no matching entity record is found, an empty object is returned.

Data Name Description

ent_id An integer that is the ID of the entity.


attr_value A string that is the value for this attribute.
notes A string that is any notes for this attribute.

Get a System Attribute


Gets a system attribute, as specified by the system attribute’s ID.
Syntax
api/systemAttribute/<systemAttrID>
Parameters
systemAttrID
Required integer. The ID of the system attribute to ret rieve.
Examples
To get the system attribute with the ID 442:
api/systemAttribute/442
Examples: Skelta Lookups
To get a system attribute:
api/systemAttribute/{systemAttrID}
Return Value
Returns a JSON object that contain the following information for all system attributes or for the specified
system attribute, from the System_Attr table. If no matching system attribute is found, an empty object is
returned.

Data Name Description

attr_id An integer that is the ID of the system attribute.


attr_desc A string that is the description of the system attribute.
attr_value A string that is the value of the system attribute.

Version 6.0 93
MES Web API Reference Attribute Endpoints

Data Name Description

grp_id An integer that is the ID of the attribute group to which the attribute
belongs.
attr_seq An integer that is the sequence number of the attribute within its group.
edit_type An enumeration that indicates the data type of the attribute:
0 = string (<= 80 characters; the default data type)
1 = drop-down list of values defined in the Attr_Set table
2 = integer
3 = currency
4 = color
5 = datetime
6 = floating point number
7 = percent
8 = check box
9 = non-editable
10 = time of day
11 = item reason (only if attr_grp = 3)
12 = long string (> 80 characters)

attr_constraints A string that is the extra editing information.


For drop-down lists, it contains the choices for the list separated by
colons (:).
For numeric values, it may contain the minimum and maximum values
separated by colons.
For edit type 13, it contains the table name, display column name, value
column name, an optional Where clause, and a optional nullable
indicator, all separated by colons.

reqd_lic A string that is the licenses required for the system attribute to be
editable. This column is null if the attribute requires no particular license.
If the column has a value, the format is one or more product numbers
joined by + for AND or | for OR, and it is to be evaluated from left to right.

94 Version 6.0
MES Web API Reference

C HAPTER 6
User, Language, and License Endpoints
In This Chapter
Get a User’s Default Language ...................................................................................................... 95
Get a User’s Entity Access Information ........................................................................................... 96
Get a User’s Line Access Information ............................................................................................. 96
Get All User Groups ...................................................................................................................... 97
Get Access Information for User Groups to a Line (api/line) ............................................................. 98
Get Access Information for User Groups to a Line (api/GroupLineAccess) ........................................ 98
Get the Privilege Status for a User ................................................................................................. 99
Get Translated Strings ................................................................................................................ 100
Get MES Licenses ...................................................................................................................... 100

Get a User’s Default Language


Gets a user’s default language ID.
When this endpoint is called, the system checks if the user is in the User_Name table:
 If the user is in the User_Name table, the user's language ID is returned.
 If the user is not in the User_Name table, the system checks if the security mode is set to OS Group.
If the security mode is set to OS Group, it checks to see if any of the supplied Security Identifiers
(SIDs) match the SID of any group in the Grp_Name table. If it does, the user is added to the
User_Name table and that user's language ID is returned.
Syntax
api/user/<userId>
Parameters
userId
Required string. The user ID (domain and username) of the user whose language ID is being
retrieved. If MES OS User or OS Group security mode is being used, this is the Windows user
account username.
Examples: Skelta Lookups
To get the language ID of a user, the user ID has to be passed through an endcodeURIComponent() in
the JavaScript and then sent to the API. So, in Enterprise Console, you would set up the user as:
api/user/{userId}
Then in the script in Enterprise Console, you would set:
{userId} = endcodeURIComponent(ourorgdomain\tad.smith)
Return Value
Returns a JSON object that contains the language ID, as described below, for the specified user, from
the User_Name table. If no matching user ID is found, an empty object is returned.

Version 6.0 95
MES Web API Reference User, Language, and License Endpoints

Data Name Description

lang_id An integer that is the ID of the default language for the us er.

Get a User’s Entity Access Information


Gets a user’s access information for all entities or for a specific entity.
Syntax
api/UserEntityAccess?entityId=<entity ID>&userId=<user ID>
Parameters
entityId
Optional integer. The ID of a entity for which to retrieve access information. If this paramet er is not
included in the endpoint, entity access information about all entities is returned.
userId
Optional string. The ID of a user for whom to retrieve access information. If this parameter is not
included in the endpoint, entity access information for the current user is returned. The current user
is the user entered in the Authentication window that appears when accessing the Web API.
Examples
To get the current user's entity access information for all entities:
api/UserEntityAccess
To get the access information for the entity whose ID is 20 for the user mdmuser:
api/UserEntityAccess?entityId=20&mdmuser
Examples: Skelta Lookups
To get the current user's entity access information for all entities:
api/UserEntityAccess
To get access information for a specific user and entity:
api/UserEntityAccess?entityId={entityId}&userId={userId}
Return Value
Returns a JSON object that contains the following information for eac h entity or for the specified entity. If
no matching user or entity ID is found, an empty object is returned.

Data Name Description

ent_id An integer that is the ID of the entity.


ent_name A string that is the description of the entity, from the Ent table.
access A Boolean that, if true, indicates that the user may log onto the entity.

Get a User’s Line Access Information


Gets a user’s line access information for all lines or for a specific line.
Syntax
api/UserLineAccess?lineId=<line ID>&userId=<user ID>

96 Version 6.0
User, Language, and License Endpoints MES Web API Reference

Parameters
lineId
Optional integer. The ID of a line for which to retrieve access information. If this parameter is not
included in the endpoint, user access information about all lines is returned.
userId
Optional string. The ID of a user for whom to retrieve line access information. If this parameter is not
included in the endpoint, line access information for the current user is returned. The current user is
the user entered in the A uthentication window that appears when accessing the Web API.
Examples
To get the current user's line access information for all lines:
api/UserLineAccess
To get the access information for the line whose ID is 22 for the user mdmuser:
api/UserLineAccess?lineId=22&mdmuser
Examples: Skelta Lookups
To get the current user's line access information for all lines:
api/UserLineAccess
To get access information for a specific user and line:
api/UserLineAccess?lineId={lineId}&userId={userId}
Return Value
Returns a JSON object that contains the following information for each line or the specified line to which
the user has access, from the User_Name table. If no matching user ID or line ID is found, an empty
object is returned.

Data Name Description

LineId An integer that is the ID of the line.


LineName A string that is the name of the line, from the Line table.
Access An Boolean that, if true, indicates that the user may access the line.

Get All User Groups


Gets all user groups.
Syntax
api/group
Return Value
Returns a JSON object that contains the following information for each user group, from the Grp_Name
table. If no us er groups are found, an empty object is returned.

Data Name Description

GrpId An integer that is the ID of the group.


GrpDesc A string that is the description of the group.
LastEditAt A datetime that indicates when the group record was added or last
updated.

Version 6.0 97
MES Web API Reference User, Language, and License Endpoints

Get Access Information for User Groups to a Line (api/line)


Gets user groups access information for a line.
Syntax
api/line/<lineID>/grouplineaccess
Parameters
lineID
Required integer. The ID of the line.
Examples
To get the access information for all us er groups to a line with an ID of 10:
api/line/10/grouplineaccess
Examples: Skelta Lookups
To get the access information for all us er groups to a specific line:
api/line/{lineID}/grouplineaccess
Return Value
Returns a JSON object that contains the following information for each user group, including a flag
specifying whether the user group has access to the specified line. If no matching user groups are found,
an empty object is returned.

Data Name Description

GrpId An integer that is the user group ID.


GrpDesc A string that is the description of the user group, from the Grp_Name
table.
Accss A Boolean that specifies whether the members of the user group may
access the line.

Get Access Information for User Groups to a Line


(api/GroupLineAccess)
Gets user groups access information for a line.
Syntax
api/GroupLineAccess?lineId=<line ID>
Parameters
lineId
Required integer. The ID of the line.
Examples
To get the access information for all us er groups to a line with an ID of 10:
api/GroupLineAccess?lineId=10
Examples: Skelta Lookups
To get user group line access information for a line:
api/GroupLineAccess?lineId={lineId}

98 Version 6.0
User, Language, and License Endpoints MES Web API Reference

Return Value
Returns a JSON object that contains the following information for each user group, including a flag
specifying whether the user group has access to the specified line. If no matching user groups are found,
an empty object is returned.

Data Name Description

GrpId An integer that is the user group ID.


GrpDesc A string that is the description of the user group, from the Grp_Name
table.
Accss A Boolean that specifies whether the members of the user group may
access the line.

Get the Privilege Status for a User


Gets the value for a privilege for a user, which indicates whether the user has been assigned that
privilege. The value will be the highest value of all the user groups of which the user is a member.
Syntax
api/GroupPrivilege?userId=<userId>&privId=<privilege ID>
Parameters
userId
Required string. The user ID (domain and username) of the target user. If MES OS User or OS
Group security mode is being used, this is the Windows user account username.
privI d
Required string. The ID of the target privilege.
Example
To get the value for privilege 5 for the user tad.smith:
api/GroupPrivilege?userId=tad.smith&privId=5
To get the privilege value for a Windows AD user account, with a domain and username, the user ID has
to be encoded using endcodeURIComponent() before being assigned to the userI d paramet er.
Example: Skelta Lookups
To get the value for a privilege for a user:
api/GroupPrivilege?userId={userId}&privId={privId}
To get the privilege value, the user ID has to be passed through an endcodeURI Component() in the
JavaScript and then sent to the API. So, in Enterprise Console, you would set up the user as:
api/user/{userId}
Then in the script in Enterprise Console, you would set:
{userId} = endcodeURIComponent(ourorgdomain\tad.smith)
Return Value
Returns a JSON object that contains the privilege value.
 If the value is 0, the user has not been assigned that privilege. (That is, none of the user groups of
which the us er is a member has been assigned that privilege.)
 If the value is not 0, the user has been assigned that privilege. (That is, the user is a member of a
user group that has been assigned that privilege.)

Version 6.0 99
MES Web API Reference User, Language, and License Endpoints

Get Translated Strings


Gets an array of one or more translated language strings based on a language identifier and a set of
string identifiers.
Syntax
api/translation?sid=<string ID>&sid=<string ID> … &langId=<language ID>
Parameters
sid
Required integer. At least one string ID must be passed.
langId
Optional integer. The ID of the target language. If a language ID is not passed, then the default MES
language will be used.
The IDs for the default languages cannot be modified. They are:
o English: 1
o Chinese Simplified: 1000
o Frenc h: 1001
o German: 1002
o Japanese: 1003
o Russian: 1004
o Spanish: 1005
Examples
To get the strings 285 and 286 for the language wit h the ID 1:
api/translation?sid=285&sid=286&langId=1
Examples: Skelta Lookups
To get two separate strings for a language:
api/translation?sid={sid1}&sid={sid2}&langId={langID}
Return Value
Returns a JSON object that contains the following information for the specified strings, from the
Language table. If no matching system attribute is found, an empty object is returned.

Data Name Description

lang_id An integer that is the ID of the language for which the string is being
added.
string_id An integer that is the ID of the string being added.
value A string that is the language string value.

Get MES Licenses


Gets a licensedFeatures object that details which modules (options) of the product have been licensed.
Syntax
api/license

100 Version 6.0


User, Language, and License Endpoints MES Web API Reference

Return Value
The returned JSON licensedFeatures object has the following format:
{"utilLicensed": <true or false>, "baseProdLicensed": <true or false>,
"inventoryLicensed":<true or false>, "enProdLicensed":<true or false,
"qualityLicensed":<true or false>}

Version 6.0 101


MES Web API Reference

C HAPTER 7
Stored Procedure Endpoints
In This Chapter
Get the Dataset from an MES Stored Proc edure ........................................................................... 103
Get Data Using an XML Request to Call a Stored Procedure ......................................................... 104
Get Data by Specifying the MES Table ......................................................................................... 107

Get the Dataset from an MES Stored Procedure


Calls the specified stored procedure, passing the supplied parameters. The stored procedure is
expected to return a dataset, as otherwise you will get no indication that it executed.
The call will fail if the stored proc edure is not a valid MES database stored procedure. So the call will fail
if the stored procedure being called is a SQL System stored procedure or a stored procedure that is not
in the MES database.
The method will search the supplied parameter list looking for a session_id paramet er. If a session_id
parameter is found, the value will be passed to the XMLReadB uilder or XMLExecBuilder constructor as
the sessionID value. For the call to succeed, the session_id parameter value must be an integer and
must be in the Sessn table.
Syntax
api/DirectAccess?spName=<stored procedure name>
&spParams={"<paramName01>": <paramValue01>, "<paramName02>": <paramValue02>,
...}
Parameters
spName
Required string. The name of the stored procedure to call.
spParams
Optional JSON string array. If one or more parameters are required by the stored proc edure, the
parameters and their values.
The JS ON object must be an array of name/ value pairs:
o The name should match the name of a parameter in the stored procedure being called without
the "@" character.
o The value is the value being passed in for the paramet er.
Each parameter name/ value pair should be supplied only once.
Examples
A stored procedure that takes no paramet ers:
api/DirectAccess?spName=MySp
A stored procedure that takes one parameter:
api/DirectAccess?spName=MySp
&spParams={"entityId": 24}
A stored procedure that takes two paramet ers could be called as follows:

Version 6.0 103


MES Web API Reference Stored Procedure Endpoints

api/DirectAccess?spName=MySp
&spParams={"entityId": 24, "reasonCd": 8}
Examples: Skelta Lookup
A stored procedure that takes no paramet ers:
api/DirectAccess?spName={spName}
A stored procedure that takes parameters:
api/DirectAccess?spName={spName}&spParams={spParams}
Return Value
Returns a JSON array that represents the data in the dataset returned from the stored proc edure.

Get Data Using an XML Request to Call a Stored Procedure


Gets data by submitting an XML request to the MES middleware to call an MES database stored
procedure.
The following Get methods (in the XML, message types) are supported:
 GetAll
 GetByKey
 GetSpecific
Syntax
api/MiddlewareAccess?xmlRequest=<XMLstring>
Parameters
XMLstring
Required string.
See the following topics for an description of the XML string contents.
Return Value
Returns a JSON array that represents the data in the dataset that is returned from the MES middleware.

Specifying the MES Stored Procedure in the XML Request


The XML request specifies the stored procedure to call, along with any necessary parameters, using the
<object> and <cmd> tags. There are two ways to determine how to specify the stored proc edure using
these two tags.
Determining the <object> and <cmd> Tags from Middleware Object Names
Middleware objects are mapped to MES database stored procedures in the file MWDBMappings.xml.
This file is stored in the installed MES application folder path Wonderware\MES\Middleware.
The middleware object names have t wo parts: the MES databas e table name and the action being
called. For example, ENT. GETSHIFTS CHED, which us es the Ent table to get an entity's shift schedule
records, is mapped to the stored procedure sp_SA_Ent_GetShiftSchedules.
In the XML request, the <object> tag specifies the MES database table name and the <cmd> tag
specifies the object action.
For the GetAll and GetByKey message types, the <cmd> tag value is always getall or getbykey,
respectively. Note that not all available GetAll and GetByKey calls are included as objects in the
MWDBMappings.xml file.
For the GetSpecifiic message type, the <cmd> tag is the action portion of the middleware object that is
being called. For example, for the ENT.GE TS HIFTS CHE D object, the <cmd> tag would be
GetShiftSched.

104 Version 6.0


Stored Procedure Endpoints MES Web API Reference

Determining the <object> and <cmd> Tags for Stored Procedure Names
Some stored procedures do not have a middleware object mapped to them and so are not listed in the
MWDBMappings.xml file. If the stored procedure you want to call is not in the MWDBMappings.xml
file, then the <object> and <cmd> tags are det ermined as follows.
The Get stored procedure names are in the following formats:
 For GetAll: the standard stored procedure name is sp_SA_object, where object is the table name.
For example, sp_SA_Ent gets all Ent table records.
 For GetByKey: the standard stored procedure name is sp_S_object, where object is the table name.
For example, sp_S_Ent gets the Ent table rec ord for the specified entity.
 For GetSpecific: the standard stored procedure name is sp_SA_object_cmd where object is the
table name and cmd is the action to perform. For example, sp_SA_Util_Exec_GetPrvShftStrt gets
the start time of the first utilization event that occurred during the previo us shift, from the Util_Exec
table.

GetAll XML String Format and Example


Syntax
<?xml version='1.0'?>
<request>
<object>MESDBTableName</object>
<msgtype>getall</msgtype>
<cmd>getall</cmd>
<filter>
<parameter1>value</parameter1>
<parameter2>value</parameter2>
<parameter3>value</parameter3>
...
</filter>
</request>
where
 The <object> is the table name included in the name of the middleware object or stored procedure
you are attempting to ex ecute.
 The filter parameter names are based on the column names in the table.
Example
To get the E nt table rec ords for all entities whos e parent entity has an ID of 2 and that can schedule jobs:
xmlRequest=<?xml version='1.0'?>
<request>
<object>ent</object>
<msgtype>getall</msgtype>
<cmd>getall</cmd>
<filter>
<parent_ent_id>2</parent_ent_id>
<can_sched_jobs>1</can_sched_jobs>
</filter>
</request>

GetByKey XML String Format and Example


Syntax
<?xml version='1.0'?>
<request>

Version 6.0 105


MES Web API Reference Stored Procedure Endpoints

<object>MESDBTableName</object>
<msgtype>getbykey</msgtype>
<cmd>getbykey</cmd>
<MESDBTableName>
<parameter1>value</parameter1>
<parameter2>value</parameter2>
<parameter3>value</parameter3>
...
</MESDBTableName>
</request>
where
 The <object> is the table name included in the name of the middleware object or the stored
procedure you are attempting to execut e.
 The parameter names are based on the column names in the table.
Example
To get the Ent table record for the entity with an ID of 5:
xmlRequest=<?xml version='1.0'?>
<request>
<object>ent</object>
<msgtype>getbykey</msgtype>
<cmd>getbykey</cmd>
<ent>
<ent_id>5</ent_id>
</ent>
</request>

GetSpecific XML String Format and Example


Use the GetSpecific (GetSpec message type) XML string format to call any Gets other than GetAll and
GetByKey.
Syntax
<?xml version='1.0'?>
<request>
<object>MESDBTableName</object>
<msgtype>getspec</msgtype>
<cmd>commandName</cmd>
<parameter1>value</parameter1>
<parameter2>value</parameter2>
<parameter3>value</parameter3>
...
</request>
where
 The <object> is the table name included in the name of the middleware object or the stored
procedure you are attempting to execut e.
 The <cmd> is the Get action included in the name of the the middleware object or stored procedure.
For example, GetShiftS chedules would be the command entry when trying to execute the
sp_SA_ent_GetS hiftSchedules stored procedure.
 The filter parameter names are based on the column names in the table.
Example
To get the sales order line item records for purchase order 90125 for Wander Industries:
xmlRequest=<?xml version='1.0'?>

106 Version 6.0


Stored Procedure Endpoints MES Web API Reference

<request>
<object>so_line</object>
<msgtype>getspec</msgtype>
<cmd>GetAllByFilter</cmd>
<user_id>johnsmith</user_id>
<cust_id>WanderIndustries</cust_id>
<po_id>90125</po_id>
</request>

Get Data by Specifying the MES Table


Gets data by submitting a request to the MES middleware to get data by the specified table, a standard
Get method or a stored procedure that performs a Get, and the filter parameters supported by the Get
method or stored procedure.
Syntax
api/MiddlewareAccess?obj=<table name>&cmd=<Get command>&parms=<parameter
string>
Parameters
obj
Required string. The name of the MES table from which data is being ret rieved.
cmd
Optional string. This string is either GetAll or GetByKey, or it is the name of the stored procedure
that performs a Get.
parms
Optional JSON string. The filter parameters supported by the Get.
Examples
To get the records for all runtime utilization states:
api/MiddlewareAccess?obj=Util_State&cmd=Get&parms={"runtime":"true"}
To get the job record for a job:
api/MiddlewareAccess?obj=Job&cmd=GetByKey&parms={"woId":"20180529-01",
"operId":"Roasting", "seqNo":"1"}
To get all item attributes that are not yet assigned to the specified item and are edit able by the specified
user:
api/MiddlewareAccess?obj=Attr&cmd=SP_SA_ITEM_ATTR_GETAVAILATTRS&parms={"item
Id":"BMX-BAG", "userId":"BaggerOperator01"}
Return Value
Returns a JSON array that represents the data in the dataset that is returned from the MES middleware.

Version 6.0 107


MES Web API Reference

C HAPTER 8
Enumerations
In This Chapter
LineCountsAndDurationGraphType Enumeration .......................................................................... 109
Time Period FilterType Enumeration ............................................................................................ 109

LineCountsAndDurationGraphType Enumeration
Specifies the type of data that will be shown in the Pareto graph of the KPI cont rol.

Enumeration Value Description

UtilStates 0 The graph s hows either the counts or the duration of the utilization states
for the time period specified by the filter.
Reas onGroups 1 The graph shows either the counts or the duration of the reas on groups
for the time period specified by the filter.
Reas ons 2 The graph shows either the counts or the duration of the reasons for the
time period specified by the filter.

Time Period FilterType Enumeration


Specifies the type of time period filter to use, including a custom filter, when ret rieving KP I and OEE
values.

Member Value Description

ThisHour 0 The last 60 minutes from now.


LastNHours 1 The last N hours from now. This filt er type requires N to be defined.
CurrentShift 2 From the beginning of the current shift to now.
LastShift 3 From the beginning of the shift that ran immediately prior to the current
shift to the end of that shift.
CurrentDay 4 From the beginning (midnight) of the current day to now.
Yesterday 5 From the beginning (midnight) of the current day -1 to the end (11:59: 59
PM) of the current day – 1.
CurrentWeek 6 From the beginning (midnight Sunday) of this week to now.
LastWeek 7 From the beginning (midnight Sunday) of the current week – 1 to the end
(11:59:59 PM Saturday) of the current week – 1.
CurrentMont h 8 From the beginning (midnight of the 1st) of this mont h to now.
LastMonth 9 From the beginning (midnight of the 1st) of current month – 1 to the end
(11:59:59 of the last day) of current month – 1.

Version 6.0 109


MES Web API Reference Enumerations

Member Value Description

Custom 10 The user will pick a time unit, a start time, and an end time.

Note: This enumeration value is not currently support ed.

110 Version 6.0

You might also like