Professional Documents
Culture Documents
Manufacturing Execution System (MES) : Web Api
Manufacturing Execution System (MES) : Web Api
Manufacturing Execution System (MES) : Web Api
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
Version 6.0 3
MES Web API Reference Contents
4 Version 6.0
Contents MES Web API Reference
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
Note: Only the endpoints included in this document are currently supported.
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
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.
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.
10 Version 6.0
Entity and Line Endpoints MES Web API Reference
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.
Version 6.0 11
MES Web API Reference Entity and Line Endpoints
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.
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
Version 6.0 13
MES Web API Reference Entity and Line Endpoints
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
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.
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.
16 Version 6.0
Entity and Line Endpoints MES Web API Reference
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.
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.
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.
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
Version 6.0 19
MES Web API Reference Entity and Line Endpoints
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
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.
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.
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
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.
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.
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
produced A Boolean that indicates whether this class contains produced items.
consumed A Boolean that indicates whether this class contains consumed items.
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
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.
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.
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.
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.
30 Version 6.0
Production Endpoints MES Web API Reference
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.
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.
Version 6.0 33
MES Web API Reference Production Endpoints
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.
34 Version 6.0
Production Endpoints MES Web API Reference
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.
36 Version 6.0
Production Endpoints MES Web API Reference
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
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
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.
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
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.
42 Version 6.0
Production Endpoints MES Web API Reference
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.
Version 6.0 43
MES Web API Reference Production Endpoints
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.
44 Version 6.0
Production Endpoints MES Web API Reference
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
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.
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.
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
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
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.
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.
50 Version 6.0
Production Endpoints MES Web API Reference
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
52 Version 6.0
Production Endpoints MES Web API Reference
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
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.
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.
Version 6.0 55
MES Web API Reference Production Endpoints
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
Version 6.0 57
MES Web API Reference Production Endpoints
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.
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.
60 Version 6.0
Production Endpoints MES Web API Reference
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.
Version 6.0 61
MES Web API Reference Production Endpoints
62 Version 6.0
Production Endpoints MES Web API Reference
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.
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.
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
seq_no The sequenc e number, which indicates the Job table row.
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.
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.
rm_lot_no The lot number of raw material from which this lot/sublot was produced.
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.
Version 6.0 65
MES Web API Reference Production Endpoints
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_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.
66 Version 6.0
Production Endpoints MES Web API Reference
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.
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.
68 Version 6.0
Production Endpoints MES Web API Reference
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
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
Version 6.0 71
MES Web API Reference Utilization Endpoints
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
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.
Version 6.0 73
MES Web API Reference Utilization Endpoints
74 Version 6.0
Utilization Endpoints MES Web API Reference
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
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.
Category An integer that indicates to which category the possible value applies.
A vailable categories are 1 through 4.
76 Version 6.0
Utilization Endpoints MES Web API Reference
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
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.
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.
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
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.
80 Version 6.0
Utilization Endpoints MES Web API Reference
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.
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
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.
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
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.
ent_id An integer that identifies the entity on which the event occurred.
Version 6.0 83
MES Web API Reference Utilization Endpoints
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
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.
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.
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.
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.
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.
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
Version 6.0 91
MES Web API Reference Attribute Endpoints
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
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.
Version 6.0 93
MES Web API Reference Attribute Endpoints
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)
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
Version 6.0 95
MES Web API Reference User, Language, and License Endpoints
lang_id An integer that is the ID of the default language for the us er.
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.
Version 6.0 97
MES Web API Reference User, Language, and License Endpoints
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.
Version 6.0 99
MES Web API Reference User, Language, and License Endpoints
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.
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>}
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
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.
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.
<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>
<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>
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.
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.
Custom 10 The user will pick a time unit, a start time, and an end time.