SOP-42Q-MES0098 MES API-42Q Account Services
42Q Home > Tools > 42Q MES API
Contents
- 1 Purpose
- 2 Usage
- 3 Security
- 4 API Resources
- 5 API Data Import Instructions
Purpose
Document externally accessible endpoints into the 42Q MES system.
Usage
Unless otherwise specified all resource URI’s are designed to work with standard HTTP/HTTPS GET requests. The immediate focus of this set of API endpoints is retrieval of production data versus manipulation of said data.
Security
Typically each of these endpoints is secured via our API security package. This package requires each request to be signed by a registered client. Client registrations are provided to all approved API consumers. When authorization is enabled API calls require a properly formatted Authorization header in the HTTP/HTTPS request. The signature algorithms and format are described here though we recommend using pre-packaged libraries maintained and provided by 42q engineering teams.
API Resources
Currently, all of these resources return a standardized JSON result with three top-level attributes:
success: true or false
message: contains an error message if success is false
data: JSON subelement corresponding to the results of the call being made
The base URI for each MES API resource takes the following form:
https://HOSTNAME:PORT/mes-api/target_context
Sub Resources are identified from the base: path/to/resource[?arg1=value1&arg2=value2…] Note: Parameters can be sent in any order as part of the URL as only the name matters--not the location in the URL text.
The following top level resources are currently exposed:
Units Resource
Encapsulates endpoints associated with unit specific data, generally a specific unit serial number. The unit resource exposes the following sub-resources assuming the {serialNumber} resource property identifies an existing serial number.
Basic Unit Data
/{target}/units/{serialNumber}
Finds a unit by serial number.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/units/SAMPLE_UNIT001
Sample Response:
{
"success": true,
"message": "string",
"data": {
"serial_key": 0,
"serial_number": "string",
"part_key": 0,
"quantity": 0,
"location_key": 0,
"loc_ts": "2020-01-01 01:00:00.000000+00",
"revision": "string",
"work_order_key": 0,
"shop_order_key": 0,
"pass_fail_seq": 0,
"defect_seq": 0,
"unit_status_key": 0,
"container_serial_key": 0,
"user_defined": "string",
"route_key": 0,
"item_num": 0,
"lot_serial_key": 0,
"container_quantity": 0,
"unit_type": 0,
"order_line_key": 0,
"ship_notify_key": 0,
"c_level_key": 0,
"sit_range_key": 0,
"shop_order_number": "string",
"process_name": "string",
"long_workstation": "string",
"short_workstation": "string",
"so_number": 0,
"so_line": "string",
"delivery_number": "string",
"customer_po_number": "string",
"part_number": "string",
"description": "string",
"legacy_date": "12/13/2020",
"legacy_time": 0,
"cust_proj_id": "string",
"on_hold_ts": "2021-01-01 01:00:00.000000+00",
"is_on_hold": true,
"legacy_on_hold_date": "2022-01-18T21:09:40.255Z",
"legacy_on_hold_time": 0
}
}
Summary
/{target}/units/{serialNumber}/summary
Summarized unit history.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/units/SAMPLE_UNIT001/summary
Sample Response:
{
"success": true,
"message": "string",
"data": {
"unit_information": {
"serial_number": "string",
"revision": "string",
"unit_status_key": 0,
"part_number": "string",
"unit_status": "string",
"shop_order_number": "string",
"shop_floor_id": "string",
"workstation": "string",
"process_name": "string",
"route_name": "string",
"sales_order_number": "string",
"sales_order_line": "string",
"quantity": 0
},
"unit_activity": [
{
"ts": "2020-01-01 01:00:00.000000+00",
"operator": 0,
"workstation": "string",
"a1": "string",
"a2": "string",
"i1": 0,
"i2": 0,
"action": 0,
"action_description": "string",
"data1": "string",
"data2": "string",
"data3": "string",
"process_name": "string",
"next": "string"
}
],
"unit_component": [
{
"reference_designator": "string",
"component_id": "string",
"tracked": true,
"part_number": "string",
"removed": 0
}
],
"unit_attribute": [
{
"attr_number": 0,
"attribute_name": "string",
"attribute_value": "string"
}
]
}
}
History
/{target}/units/{serialNumber}/history
Complete transaction history for a unit serial number.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/units/SAMPLE_UNIT001/history
Sample Response:
{
"success": true,
"message": "string",
"data": {
"unit_identifier": "string",
"part_number": "string",
"serial": {
"loc_ts": "2020-01-01 01:00:00.000000+00",
"serial_key": 0,
"serial_number": "string",
"part_key": 0,
"quantity": 0,
"location_key": 0,
"revision": "string",
"work_order_key": 0,
"shop_order_key": 0,
"pass_fail_seq": 0,
"defect_seq": 0,
"unit_status_key": 0,
"container_serial_key": 0,
"user_defined": "string",
"route_key": 0,
"item_num": 0,
"lot_serial_key": 0,
"container_quantity": 0,
"unit_type": 0,
"order_line_key": 0,
"ship_notify_key": 0,
"c_level_key": 0,
"sit_range_key": 0,
"shop_order_number": "string",
"part_number": "string",
"current_location": "string",
"current_process": "string",
"route_name": "string",
"unit_status": "string"
},
"activity": [
{
"activity_key": 0,
"serial_key": 0,
"employee_key": 0,
"location_key": 0,
"action": 0,
"pass_fail_seq": 0,
"i1": 0,
"i2": 0,
"a1": "string",
"a2": "string",
"ts": "2020-01-01 01:00:00.000000+00",
"part_key": 0,
"quantity": 0,
"action_description": "string",
"data1": "string",
"data2": "string",
"data3": "string",
"data1_description": "string",
"data2_description": "string",
"data3_description": "string",
"operator": "string",
"long_workstation": "string",
"process_name": "string",
"data": "string"
}
],
"defects": [
{
"serdef_key": 0,
"serial_key": 0,
"component_key": 0,
"pass_fail_seq": 0,
"repaired": true,
"defcode_key": 0,
"board_loc": "string",
"pin1": "string",
"pin2": "string",
"surface": "string",
"defect_part": "string",
"mfr": "string",
"mfr_lot": "string",
"defect_qty": 0,
"fail_activity_key": 0,
"defect_activity_key": 0,
"repaired_nff": 0,
"repair_defcode_key": 0,
"repair_activity_key": 0,
"symptom_defcode_key": 0,
"serial_number": "string",
"defect_code": "string",
"defect_description": "string",
"repair_code": 0,
"repair_description": "string",
"symptom_code": "string",
"symptom_description": "string"
}
],
"components": [
{
"parent_serial": "string",
"parent_part": "string",
"component_key": 0,
"serial_key": 0,
"component_part_key": 0,
"component_id": "string",
"ref_designator": "string",
"component_number": 0,
"removed": 0,
"component_type": 0,
"quantity": 0,
"unit_quantity": 0,
"loc_ts": "2020-01-01 01:00:00.000000+00",
"revision": "string",
"unit_status_key": 0,
"part_number": "string",
"long_workstation": "string",
"short_workstation": "string",
"legacy_date": "10/05/2020",
"legacy_time": 72197,
"tracked": true
}
],
"hpu_summary": [
{
"serial_key": 0,
"serial_number": "string",
"part_number": "string",
"description": "string",
"process_name": "string",
"expected_hands_on_time": 0,
"expected_unattended_time": 0,
"expected_erp_hpu": 0,
"actual_hands_on_time": 0,
"part_key": 0,
"sfdc_key": 0,
"process_key": 0
}
],
"attributes": [
{
"serial_key": 0,
"serial_number": "string",
"attr_number": 0,
"name": "string",
"attr_data": 0,
"removed": 0,
"user_prompt": "string",
"attribute_key": 0
}
],
"timestamps": [
{
"time_stamp_key": "string",
"order_key": "string",
"serial_key": 0,
"reason_type": 0,
"reason_code": 0,
"stamp_ts": "string",
"employee_key": 0,
"new_value": "string",
"old_value": "string"
}
]
}
}
Parent Hierarchy
/{target}/units/{serialNumber}/parentage
Parent serial tree for the specified unit serial number.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/units/SAMPLE_UNIT001/parentage
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"serial_key": 0,
"serial_number": "string",
"part_key": 0,
"parent_part_number": "string",
"component_id": "string",
"component_part_key": 0,
"component_part_number": "string",
"ref_designator": "string",
"removed": 0,
"level": 0,
"path": "string",
"cycle": true
}
]
}
Child Components
/{target}/units/{serialNumber}/children
Child component tree for the specified unit serial number.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/units/SAMPLE_UNIT001/children
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"serial_key": 0,
"serial_number": "string",
"part_key": 0,
"parent_part_number": "string",
"component_id": "string",
"component_part_key": 0,
"component_part_number": "string",
"ref_designator": "string",
"removed": 0,
"level": 0,
"path": "string",
"cycle": true
}
]
}
Comments
/{target}/units/{serialNumber}/comments
Comments associated with the serial number.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/units/SAMPLE_UNIT001/comments
Sample Response:
{
"success": true,
"message": "string",
"data": [
"string"
]
}
Defects
/{target}/units/{serialNumber}/children/defects
Show defects of child components.
Sample URI: https://42qmes1.42-q.com:8081/mes-api/api_test_target/units/SAMPLE_UNIT001/defects
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"serial_key": 0,
"serial_number": "string",
"part_key": 0,
"component_id": "string",
"component_part_key": 0,
"ref_designator": "string",
"removed": 0,
"level": 0,
"path": [
"string"
],
"cycle": true,
"parent_part_number": "string",
"component_part_number": "string",
"defects": [
{
"component_id": 0,
"defect_code": "string",
"defect_description": "string",
"defect_seq": 0,
"repair_code": 0,
"repair_description": "string",
"symptom_code": "string",
"symptom_description": "string"
}
]
}
]
}
Route
/{target}/routes
Find the route information details.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/units/SAMPLE_UNIT001/route
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"name": "string",
"description": "string",
"newedit": true,
"obsolete": true,
"route_key": 0,
"sfdc_key": 0,
"update_ts": "string",
"num_steps": 0,
"installer_id": "string",
"op_seq_list_key": 0,
"fmd5_hash": "string",
"rmd5_hash": "string"
}
]
}
Export Activity/DHR
/{target}/units/export/activity
Complete unit history for any unit that had activity within the specified interval.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/units/export/activity?interval=60
Sample Response:
{
"success": true,
"message": "string",
"data": {
"unit_identifier": "string",
"part_number": "string",
"serial": {
"loc_ts": "2020-01-01 01:00:00.000000+00",
"serial_key": 0,
"serial_number": "string",
"part_key": 0,
"quantity": 0,
"location_key": 0,
"revision": "string",
"work_order_key": 0,
"shop_order_key": 0,
"pass_fail_seq": 0,
"defect_seq": 0,
"unit_status_key": 0,
"container_serial_key": 0,
"user_defined": "string",
"route_key": 0,
"item_num": 0,
"lot_serial_key": 0,
"container_quantity": 0,
"unit_type": 0,
"order_line_key": 0,
"ship_notify_key": 0,
"c_level_key": 0,
"sit_range_key": 0,
"shop_order_number": "string",
"part_number": "string",
"current_location": "string",
"current_process": "string",
"route_name": "string",
"unit_status": "string"
},
"activity": [
{
"activity_key": 0,
"serial_key": 0,
"employee_key": 0,
"location_key": 0,
"action": 0,
"pass_fail_seq": 0,
"i1": 0,
"i2": 0,
"a1": "string",
"a2": "string",
"ts": "2020-01-01 01:00:00.000000+00",
"part_key": 0,
"quantity": 0,
"action_description": "string",
"data1": "string",
"data2": "string",
"data3": "string",
"data1_description": "string",
"data2_description": "string",
"data3_description": "string",
"operator": "string",
"long_workstation": "string",
"process_name": "string",
"data": "string"
}
],
"defects": [
{
"serdef_key": 0,
"serial_key": 0,
"component_key": 0,
"pass_fail_seq": 0,
"repaired": true,
"defcode_key": 0,
"board_loc": "string",
"pin1": "string",
"pin2": "string",
"surface": "string",
"defect_part": "string",
"mfr": "string",
"mfr_lot": "string",
"defect_qty": 0,
"fail_activity_key": 0,
"defect_activity_key": 0,
"repaired_nff": 0,
"repair_defcode_key": 0,
"repair_activity_key": 0,
"symptom_defcode_key": 0,
"serial_number": "string",
"defect_code": "string",
"defect_description": "string",
"repair_code": 0,
"repair_description": "string",
"symptom_code": "string",
"symptom_description": "string"
}
],
"components": [
{
"parent_serial": "string",
"parent_part": "string",
"component_key": 0,
"serial_key": 0,
"component_part_key": 0,
"component_id": "string",
"ref_designator": "string",
"component_number": 0,
"removed": 0,
"component_type": 0,
"quantity": 0,
"unit_quantity": 0,
"loc_ts": "2020-01-01 01:00:00.000000+00",
"revision": "string",
"unit_status_key": 0,
"part_number": "string",
"long_workstation": "string",
"short_workstation": "string",
"legacy_date": "10/05/2020",
"legacy_time": 72197,
"tracked": true
}
],
"hpu_summary": [
{
"serial_key": 0,
"serial_number": "string",
"part_number": "string",
"description": "string",
"process_name": "string",
"expected_hands_on_time": 0,
"expected_unattended_time": 0,
"expected_erp_hpu": 0,
"actual_hands_on_time": 0,
"part_key": 0,
"sfdc_key": 0,
"process_key": 0
}
],
"attributes": [
{
"serial_key": 0,
"serial_number": "string",
"attr_number": 0,
"name": "string",
"attr_data": 0,
"removed": 0,
"user_prompt": "string",
"attribute_key": 0
}
],
"timestamps": [
{
"time_stamp_key": "string",
"order_key": "string",
"serial_key": 0,
"reason_type": 0,
"reason_code": 0,
"stamp_ts": "string",
"employee_key": 0,
"new_value": "string",
"old_value": "string"
}
]
}
}
Shop Orders Resource
Resource exposing endpoints associated with shop orders data.
General Shop Order Data
/{target}/shop-orders/{shopOrderNumber}
Find the Single shop order information details.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/shop-orders/A_SAMPLE_SHOP_ORDER001
Sample Response:
{
"success": true,
"message": "string",
"data": {
"part_number": "string",
"description": "string",
"uom": "string",
"shop_order_key": 0,
"shop_order_number": "string",
"part_key": 0,
"revision": "string",
"user_defined": "string",
"boards_per_panel": 0,
"panel_quantity": 0,
"order_status": "string",
"start_serial_number": "string",
"end_serial_number": "string",
"is_generic": true,
"a1": "string",
"i1": 0,
"erp_order_status": "string",
"op_seq_map_key": 0,
"op_seq_list_key": 0,
"ato_part_key": 0,
"bom_key": 0,
"erp_status_change_ts": "string",
"erp_status_change_user": "string",
"is_erp": true,
"priority": "string",
"total_quantity": 0,
"release_ts": "string",
"available_count": 0,
"prioritizations": [
{
"mfg_line": "string",
"sequence_number": 0
}
]
}
}
Bill Of Material
/{target}/shop-orders/{shopOrderNumber}/bom
Find the BOM details of the shop order number.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/shop-orders/A_SAMPLE_SHOP_ORDER001/bom
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"shop_order_number": "string",
"part_number": "string",
"uom": "string",
"quantity": 0,
"op_seq": 0,
"erp_department": "string",
"assembly_step": 0,
"customer_part_number": "string",
"customer_part_revision": "string",
"wip_supply_type": "string",
"traceability_code": "string",
"item_type": "string",
"top_assembly_item": "string",
"assembly_item": "string",
"line_number": 0,
"required_quantity": 0
}
]
}
Attributes Resource
Resource exposing endpoints associated with attributes and the serial numbers related to them.
Attribute Name
/{target}/attributes/{attributeName}
Get the unit’s details by the given attribute name.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/attributes/A_SAMPLE_ATTR
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"attribute_name": "string",
"attribute_value": "string",
"attribute_number": 0
}
]
}
{"success": true,"message": "","data": [{"serial_number": "SBSTACK0032.A.017-IC-001","part_number": "PN-ICP0001","shop_order_number": null},{"serial_number": "SBSTACK0032.A.007-IC-021","part_number": "PN-ICP0001","shop_order_number": null},{"serial_number": "SBSTACK0032.A.007-IC-019","part_number": "PN-ICP0001","shop_order_number": null},{"serial_number": "SBSTACK0032.A.007-FEP","part_number": "PN-FEP0001","shop_order_number": null}]}
Attribute Name and Value
/{target}/attributes/{attributeName}/{attributeValue}
Get the unit’s details by the given attribute name and attribute value.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/attributes/A_SAMPLE_ATTR/WITH_ATTR_VALUE
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"attribute_name": "string",
"attribute_value": "string",
"attribute_number": 0
}
]
}
{"success": true,"message": "","data": [{"serial_number": "SBSTACK0032.A.007-FEP","part_number": "PN-FEP0001"}]}
Parts Resource
Part Info
/{target}/parts/{partNumber}
A part number refers to the product id of a top assembly, a base, or any component or sub-component making up a unit.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/parts/SAMPLE_PART_NUMBER001
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"part_number": "string",
"user_defined": "string",
"part_number_exists": true,
"part_key": 0,
"extended_part_number": "string",
"rev_num": 0,
"customer_code": "string",
"family_id": "string",
"country": "string",
"label_data": "string",
"prod_line_id": "string",
"product_option": "string",
"model_description": "string",
"product_internal": "string",
"graphic": "string",
"description": "string",
"upc": "string",
"weight": 0,
"model_number": "string",
"site_id": "string",
"cust_proj_key": 0,
"ean": "string",
"height": 0,
"length": 0,
"pallet_weight": 0,
"rohs": "string",
"volume": 0,
"width": 0,
"uom": "string",
"obsolete": true,
"algorithm_number": 0,
"flex_fields": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"tags": [
"string"
],
"release_exit_functions": [
"string"
]
}
]
}
{"success": true,"message": "","data": [{"part_number": "VALBB_BASE1","part_number_exists": true,"part_key": 209,"extended_part_number": "","rev_num": 0,"customer_code": "","family_id": "","country": "USA","label_data": "","prod_line_id": "","product_option": "","model_description": "","product_internal": "","graphic": "","description": "Test Part Number 01","upc": "","weight": 0,"model_number": "","site_id": "","cust_proj_key": 1,"ean": "","height": 0,"length": 0,"pallet_weight": 0,"rohs": "","volume": 0,"width": 0,"obsolete": false}]}
Test Resource
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/test
Sample Response:
{"success": true,"message": "","data": ["Light speed is too slow!"]}
Simple Test
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/test/simple
Sample Response:
{"success": true,"message": "","data": ["This request hasn't been authenticated. However, we are still confident that light speed is too slow!"]}
Containers Resource
A resource dedicated to exposing endpoints associated with containers.
Units
/{target}/containers/{containerSerialNumber}/units
Find the particular container serial number details.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/containers/SAMPLE_CONTAINER_UNIT001/units
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"version": "string",
"revision": "string",
"quantity": 0,
"serial_key": 0,
"serial_number": "string",
"part_number": "string",
"loc_ts": "string",
"serial_creation_date": "string"
}
]
}
Workstations Resource
Encapsulates endpoints associated with unit specific data, generally a specific unit serial number. The units resource exposes the following sub-resources assuming the {serialNumber} resource property.
All Workstations
/{target}/workstations/locations
The location where a process name is performed in a product routing. All location names begin with four characters, followed by a brief description of the process.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/workstations
Sample Response:
{
"success": true,
"message": "string",
"data": {
"department": "string",
"location_key": 0,
"sfdc_key": 0,
"long_workstation": "string",
"short_workstation": "string",
"station_type": "string",
"unit_status_key": 0,
"process_key": 0,
"user_defined_1": "string",
"user_defined_2": "string",
"dept_key": 0,
"sfdc_id": "string",
"process_name": "string",
"ev_controlled": 0,
"global": true,
"global_process_key": 0,
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
}
}
Devices
/{target}/workstations/devices
Get the device associated with the workstation.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/workstations/devices
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"scanner_key": 0,
"sfdc_key": 0,
"device_number": 0,
"location_key": 0,
"mfg_line_pkid": 0,
"inactive": 0,
"scanner_type": 0,
"ev_controlled": 0
}
]
}
Device
/{target}/workstations/devices/{device-number}/locations
Get the locations associated with the device.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/workstations/devices/A_SAMPLE_DEVICE
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"department": "string",
"location_key": 0,
"sfdc_key": 0,
"long_workstation": "string",
"short_workstation": "string",
"station_type": "string",
"unit_status_key": 0,
"process_key": 0,
"user_defined_1": "string",
"user_defined_2": "string",
"dept_key": 0,
"sfdc_id": "string",
"process_name": "string",
"ev_controlled": 0,
"global": true,
"global_process_key": 0,
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
}
]
}
Locations
/{target}/workstations/locations
The location where a process name is performed in a product routing.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/workstations/locations
Sample Response:
{
"success": true,
"message": "string",
"data": {
"department": "string",
"location_key": 0,
"sfdc_key": 0,
"long_workstation": "string",
"short_workstation": "string",
"station_type": "string",
"unit_status_key": 0,
"process_key": 0,
"user_defined_1": "string",
"user_defined_2": "string",
"dept_key": 0,
"sfdc_id": "string",
"process_name": "string",
"ev_controlled": 0,
"global": true,
"global_process_key": 0,
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
}
}
Location
/{target}/workstations/locations/{station}
The location where a process is performed in a product routing.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/workstations/locations/A_SAMPLE_LOCATION001
Sample Response:
{
"success": true,
"message": "string",
"data": {
"department": "string",
"location_key": 0,
"sfdc_key": 0,
"long_workstation": "string",
"short_workstation": "string",
"station_type": "string",
"unit_status_key": 0,
"process_key": 0,
"user_defined_1": "string",
"user_defined_2": "string",
"dept_key": 0,
"sfdc_id": "string",
"process_name": "string",
"ev_controlled": 0,
"global": true,
"global_process_key": 0,
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
}
}
Processes
/{target}/workstations/processes
42Q system helps to create flawless manufacturing processes and provide real-time feedback of requirement changes, and provide information at a single source.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/workstations/processes/SAMPLE_PROCESS
Sample Response:
{
"success": true,
"message": "string",
"data": {
"process_key": 0,
"process_name": "string",
"process_sequence": 0,
"ev_controlled": 0,
"global": true,
"global_process_key": 0
}
}
Process
/{target}/workstations/processes/{processName}
42Q system helps to create flawless manufacturing processes and provide real-time feedback of requirement changes, and provide information at a single source.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/workstations/processes/A_SAMPLE_PROCESS001
Sample Response:
{
"success": true,
"message": "string",
"data": {
"process_key": 0,
"process_name": "string",
"process_sequence": 0,
"ev_controlled": 0,
"global": true,
"global_process_key": 0
}
}
Manufacturing Holds Resource
Resource exposing endpoints associated with manufacturing hold information.
Active
/{target}/mfg-holds/active
MFG hold enables the user to place units on hold within SFDC, preventing the normal movement dictated by the SFDC routing.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/mfg-holds/active
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"released": true,
"description": "string",
"mfg_hold_key": 0,
"part_key": 0,
"part_number": "string",
"shop_order_key": 0,
"shop_order_number": "string",
"user_defined": "string",
"serial_key": 0,
"serial_number": "string",
"location_key": 0,
"long_workstation": "string",
"create_employee_key": 0,
"create_employee": "string",
"release_employee_key": 0,
"release_employee": "string",
"sfdc_notify": 0,
"parent_mfg_hold_key": 0,
"comment_key": 0,
"comment_string": "string",
"group_mfg_hold_key": 0,
"process_key": 0,
"process_name": "string",
"hold_ts": "string",
"release_ts": "string",
"hold_type": 0
}
]
}
Routes Resource
Resource exposing endpoints associated with routes and sub-routes.
Basic Route
/{target}/routes/{routeName}
Find the particular route information details.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/routes/SAMPLE_ROUTE001
Sample Response:
{
"success": true,
"message": "string",
"data": {
"name": "string",
"description": "string",
"sfdc_id": "string",
"installer_id": "string",
"steps": [
{
"step": 0,
"step_type_name": "string",
"is_start": true,
"workstation": {
"location_name": "string",
"sfdc_id": "string",
"unit_status": 0,
"department": "string",
"station_type": "string",
"process": {
"process_name": "string",
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"pass_location": {
"location_name": "string",
"sfdc_id": "string",
"unit_status": 0,
"department": "string",
"station_type": "string",
"process": {
"process_name": "string",
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"fail_location": {
"location_name": "string",
"sfdc_id": "string",
"unit_status": 0,
"department": "string",
"station_type": "string",
"process": {
"process_name": "string",
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"loc1_location": {
"location_name": "string",
"sfdc_id": "string",
"unit_status": 0,
"department": "string",
"station_type": "string",
"process": {
"process_name": "string",
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"loc2_location": {
"location_name": "string",
"sfdc_id": "string",
"unit_status": 0,
"department": "string",
"station_type": "string",
"process": {
"process_name": "string",
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"loc3_location": {
"location_name": "string",
"sfdc_id": "string",
"unit_status": 0,
"department": "string",
"station_type": "string",
"process": {
"process_name": "string",
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"loc4_location": {
"location_name": "string",
"sfdc_id": "string",
"unit_status": 0,
"department": "string",
"station_type": "string",
"process": {
"process_name": "string",
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
},
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
}
}
],
"part_numbers": [
"string"
],
"work_center_map": [
{
"work_center": "string",
"occurrence": 0
}
]
}
}
Expanded Route Steps
/{target}/routes/{routeName}/steps
Find the particular route step information details.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/routes/SAMPLE_ROUTE001/steps
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"step": 0,
"scan_loc": "string",
"scan_proc": "string",
"pass_to_loc": "string",
"fail_to_loc": "string",
"from_loc1": "string",
"from_proc1": "string",
"from_loc2": "string",
"from_proc2": "string",
"from_loc3": "string",
"from_proc3": "string",
"from_loc4": "string",
"from_proc4": "string",
"create_unit": true
}
]
}
Defects Resource
Resource exposing endpoints associated with unit defects
Defect Codes
/{target}/defects/codes
Find the defect’s details from the specific database.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/defects/codes
Sample Response:
{
"success": true,
"message": "string",
"data": {
"description": "string",
"a1": "string",
"a2": "string",
"global": true,
"enabled": true,
"defcode_key": 0,
"defect_code": "string",
"code_type": 0,
"def_opp_category": 0,
"global_defcode_key": 0,
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
}
}
Defect Code
/{target}/defects/codes/{defectCode}
Find the defect’s details for a defect code.
Sample URL: https://42qmes1.42-q.com:8081/mes-api/api_test_target/defects/codes/0101
Sample Response:
{
"success": true,
"message": "string",
"data": {
"description": "string",
"a1": "string",
"a2": "string",
"global": true,
"enabled": true,
"defcode_key": 0,
"defect_code": "string",
"code_type": 0,
"def_opp_category": 0,
"global_defcode_key": 0,
"flex_fields": [
{
"name": "string",
"value": "string"
}
]
}
}
Documents Resource
Resource exposing endpoints associated with manufacturing documents, including work instructions
Work Instructions
/{target}/wi
Retrieves the list of work instructions and process decorators.
Sample Response:
{
"success": true,
"message": "string",
"data": [
{
"attachName": "string",
"description": "string",
"id": "string",
"name": "string",
"title": "string",
"url": "string",
"pageRef": "string",
"endPage": "string",
"headers": "string",
"contentType": "string",
"source": "string",
"shopOrderAttribute": "string",
"documentType": "string"
}
]
}
Response for actual document data {"data" : { "mime_type" : "application/pdf", "document" : "<imagine this is base 64 binary encoded data>", "document_type" : "base64" }, "success" : true, "message" : "This result demonstrates returning an actual document encoded in base64 text"}
Response for a url/link to a document {"data" : { "document" : "http://p88conduit1.sanmina.com:18005/ccr", "document_type" : "url" }, "message" : "This result demonstrates a response to a url instead of an actual document. Generally speaking this message is blank on success. Mime type not provided as it will be returned when accessing the url", "success" : true}
For both of these examples the message is populated even with success == true. Generally speaking this wouldn’t be the case but for the purposes of providing a concise explanation it seemed reasonable here.
API Data Import Instructions
There are currently two types of APIs:
- An API that is specialized for mass imports
- An API that is specialized for transactional data
Bulk Data Imports
For large amounts of data to be imported, there is an import API that is formatted in JSON. There is a function that wraps this data for security purposes, and the way that it is used will depend upon the client architecture.
- The URL for a customer’s project will be similar to this:https://42qprtl1.42-q.com/mes-api/nokia_vendor_01/supplier/upstream/import
- “customer_vendor_01” will be replaced by the client identifier. This will be used to know who is sending the data and what the target should be.
- A simple example follows. This example will record two components for each of the two serial numbers and move them to a specific location.
Request
{"units":[{"unit_id":"5S060000172","part_number":"MWKB82-0026-02-16","tracking":[{"ts":"2017-05-19 18:56:36-05","location":"ASSY"}],"components":[{"component_id":"MAC ADDRESS","ref_designator":"0103FAACE64A"},{"component_id":"MAC ADDRESS","ref_designator":"01164D2711D6"}]},{"unit_id":"5S060000173","part_number":"MWKB82-0026-02-16","tracking":[{"ts":"2017-05-19 18:56:36-05","location":"ASSY"}],"components":[{"component_id":"MAC ADDRESS","ref_designator":"0103FAACE64B"},{"component_id":"MAC ADDRESS","ref_designator":"01164D2711D7"}]}]}
Response
{"success":true,"message":"Successfully processed data for <2> unit(s)","data":[]}
Transactional Data
For data to be processed in the standard transactional model, the 42Q Conduit subsystem is employed. This allows for smoother integration and many additional functions compared to the restricted commands available in the bulk import API.
Again, this example does not have the architecture-specific security API, but that will be covered in another document dependent upon the client architecture.
- The URL for a customer's project will be similar to this: https://42qconduit1.42-q.com:18004/conduit
- The client_id is the same that is used in the previous API. The unit_id is the serial number or other identifier of the unit that is being processed.
- A simple example follows. This example will validate the status of the unit, add a comment, and move the unit to the next location in the route from the current “ASSY” workstation.
- The full list of commands and their parameters are available from this web service: http://42qconduit1.42-q.com:18005/ccr
Request
PatchAppendixRequestModel
Appendix Request details.
Sample Response:
{"transactions":[{"commands":[{"command":{"name":"AddComment","comment_text":"This is a comment."}},{"command":{"name":"End"}}],"unit":{"unit_id":"5S060000169","part_number":"MWKB82-0026-02-16","quantity":1},"refresh_unit":true}],"source":{"client_id":"nokia_vendor_01","employee":"15475","password":"","workstation":{"type":"LOCATION","station":"ASSY"}},"version":"1.0","token":"","keep_alive":false,"single_transaction":false}
Response
AlgorithmResponseModel
The response will return both the status of the transaction and the device history record for the unit, including components, attributes, comments, and defects.
Sample Response:
{"source":{"client_id":"nokia_vendor_01","employee":"15475","password":"","workstation":{"station":"ASSY","type":"Location"}},"status":{"code":"OK","message":""},"transaction_responses":[{"command_responses":[{"command":{"comment_text":"This is a comment.","max_success_status":"PROMPT","min_success_status":"EMPTY","name":"AddComment"},"results":[{"message":"Added comment <This is a comment.>","status":"OK"}],"status":{"code":"OK","message":"Added comment <This is a comment.>"}},{"command":{"max_success_status":"PROMPT","min_success_status":"EMPTY","name":"End"},"results":[{"data":{"action":12,"action_description":"Failed","dept_key":4,"location_key":5,"long_workstation":"ASSY Assembly","process_key":24,"sfdc_key":5,"short_workstation":"ASSY","station_type":"0","unit_status_key":20,"user_defined_1":"","user_defined_2":""},"message":"FAIL to ASSY - <Failed> unit <5S060000169> from <ASSY Assembly> to <ASSY Assembly>","status":"OK"}],"status":{"code":"OK","message":"FAIL to ASSY - <Failed> unit <5S060000169> from <ASSY Assembly> to <ASSY Assembly>"}}],"scanned_unit":{"status":{"code":"OK","message":"Scanned unit <5S060000169>"},"unit":{"part_number":"MWKB82-0026-02-16","quantity":"1","unit_id":"5S060000169"},"unit_info":{"auto_commands":null,"c_level_key":null,"container_quantity":0,"container_serial_key":null,"defect_seq":2,"description":"ASM FINAL 82-0026-02-16","employee_key":4,"item_num":0,"loc_ts":"2017-04-20 05:29:07.161581-05","location_key":5,"long_workstation":"ASSY Assembly","lot_serial_key":null,"order_line_key":null,"part_key":6405,"part_number":"MWKB82-0026-02-16","pass_fail_seq":5,"process_key":24,"process_name":"ASSEMBLY","quantity":1,"revision":"","route_key":1,"route_step_key":-1,"scanning_location_key":5,"scanning_template":null,"serial_key":14725,"serial_number":"5S060000169","sfdc_key":5,"ship_notify_key":null,"shop_order_key":null,"shop_order_number":null,"sit_range_key":null,"unit_elements":{"attributes":null,"comments":[{"comment_text":"This is a comment.","employee_number":"15475","ts":"2017-APR-20 05:29:07 cdt"}],"components":[{"component_id":"MAC ADDRESS","component_key":82802,"component_number":2,"component_part_key":null,"component_type":0,"ref_designator":"00164D2711D6","removed":0,"serial_key":14725},{"component_id":"MAC ADDRESS","component_key":82801,"component_number":1,"component_part_key":null,"component_type":0,"ref_designator":"0003FAACE64A","removed":0,"serial_key":14725}],"defects":[{"board_loc":null,"component_key":null,"defcode_key":65,"defect_activity_key":207867,"defect_description":"Solder Balls","defect_part":null,"defect_qty":1,"defect_seq":2,"fail_activity_key":207868,"mfr":"","mfr_lot":"","pass_fail_seq":4,"pin1":"","pin2":"","repair_activity_key":null,"repair_defcode_key":null,"repaired":false,"repaired_nff":0,"serdef_key":4,"serial_key":14725,"surface":"","symptom_defcode_key":null}]},"unit_status":"On The Line","unit_status_key":20,"unit_type":0,"user_defined":"","work_order_key":null}},"status":{"code":"OK","message":""}}],"version":"1.0"}