Work Centre Group


Versions

Versions this documentation is relevant for:

  • 8.7.0+

List 

The Work Centre Group – List API call reads existing Work Centre Groups from MESTEC. The data can be filtered based on the parameters passed in the body/payload of the JSON packet giving the flexibility to search for one or multiple Work Centre Groups.  

Using the Work Centre Group – List API call has no impact on the data within the given MESTEC application, it is read-only. 

Figure 1 shows the logic used within the Work Centre Group – List API call. 

Figure 1 - Logic within WorkCentreGroup/List API Call 

ActiveX control 

Data Prerequisites 

There is no data required in MESTEC to act as a pre-requisite to make the API call to list Work Centre Groups. If parameters are passed in through the body that return no valid results, an empty payload will be returned.  

Request 

Table 1 shows the method and endpoint required to make the API call to list Work Centre Groups. 

Table 1 - Outbound Message Detail for Work Centre Group - List 

Method 

URL Structure 

Endpoint 

POST 

https://[environment].mestec.net 

/api/WorkCentreGroup/List 

The body of the payload should follow the format below.  

Figure 2- JSON Structure for WorkCentreGroup- List 

ActiveX control 

See Table 2 for information on which fields are optional, the appropriate data types and the mappings to fields in MESTEC. 

Table 2 - Parameter Information for Work Centre Group - List1 

Parameter Name 

Data Mapping 

Data Type 

Mandatory 

Case Sensitive 

Match Type 

ID 

workcentregroup.id 

NUMBER 

No 

N/A 

Exact 

SUID 

workcentregroup.suid 

VARCHAR2(500) 

No 

No 

Exact 

Name 

workcentregroup.name 

VARCHAR2(200) 

No 

No 

Exact 

isControlled 

workcentregroup.iscontrolled 

NUMBER(1,0) 

No 

No 

 

WorkCentres 

workcentre.name 

JSON Array - String 

No 

 

 


Sample Request 

See below for sample use cases with examples of the JSON payload format required 

To list Work Centre Groups where the name is equal to CNC Machines: 

JSON sample for WorkCentreGroup- List 

ActiveX control 

Response 

When using the Work Centre Group – List API call, if any data has been found in MESTEC that meets the parameter values passed in the original payload, a JSON payload will be returned containing data in the following structure: 

JSON Structure for WorkCentreGroup- List 

ActiveX control 

Sample Response 

See below for sample use cases with examples of the JSON payload format returned. 

No results were found that matched given parameters: 

ActiveX control 

Multiple Work Centre Groups were found that matched given parameters: 

JSON response  for WorkCentreGroup- List 


ActiveX control 

Upsert

The Work Centre Group – Upsert API call checks if a Work Centre Type with the given ID already exists. If it does, appropriate fields are updated in the matching Work Centre in MESTEC. 

If no ID is provided, then a new Work Centre Group is created. 

Figure 2 shows the logic used within the Work Centre Group – Upsert API call. 

Figure 2 - Logic within Work CentreGroup-Upsert API Call 

ActiveX control 

Data Prerequisites 

There is no data required in MESTEC to act as a pre-requisite to make the API call to upsert Work Centre Groups. If parameters are passed in through the body that return no valid results a new Work Centre group will be created, otherwise the Work Centre Group identified will be updated. 

Request 

Table 3 shows the method and endpoint required to make the API call to list Work Centre Groups. 

Table 3 - Outbound Message Detail for Work Centre Group - Upsert 

Method 

URL Structure 

Endpoint 

PUT 

https://[environment].mestec.net 

/api/WorkCentreGroup/Upsert 

The body of the payload should follow the format below.  

Figure 7- JSON Structure for WorkCentreGroupUpsert 

ActiveX control 

See Table 4 for information on which fields are optional, the appropriate data types and the mappings to fields in MESTEC.

Table 4 - Parameter Information for Work Centre Group - Upsert 

Parameter Name 

Data Mapping 

Data Type 

Mandatory 

Case Sensitive 

Match Type 

ID 

Work Centregroup.id 

NUMBER 

No2 

N/A 

Exact 

SUID 

workcentregroup.suid 

VARCHAR2(500) 

No 

No 

Exact 

Name 

Work Centregroup.name 

VARCHAR2(250 BYTE) 

No 

N/A 

N/A 

isControlled 

workcentregroup.iscontrolled 

NUMBER(1,0) 

No3 

No 

 

WorkCentres 

workcentre.name 

JSON Array - String 

No 

 

 

Note: For any fields where the match type is ‘Like’, a percent symbol should be used as a wildcard character to indicate a number of characters within the given string. 

Sample Request 

See below for sample use cases with examples of the JSON payload format required. 

To create a new Work Centre Group. 

ActiveX control 

To update name and SUID by ID. 

ActiveX control 

Response 

When using the Work Centre Group – Upsert API call, if a Work Centre Group has been Created or Updated a JSON payload will be returned containing data in the following structure: 

ActiveX control 

Sample Response 

See below for sample use cases with examples of the JSON payload format returned. 

ActiveX controlDelete

The Work Centre Group – Delete API call attempts to delete a Work Centre Group. A Work Centre Group can be deleted as long as there are no Work Centres currently assigned to the Work Centre Group. 

Figure 3 shows the logic used within the Work Centre Group – Delete API call. 

Figure 3 - Logic within Work CentreGroup/Delete API Call 

ActiveX control 

Data Prerequisites 

In order to delete a Work Centre Group, the Work Centre Group must exist in MESTEC. 
The Work Centre Group must have no Work Centres currently assigned. 

Request 

Table 5 shows the method and endpoint required to make the API call to list Work Centre Groups. 

Table 5 - Outbound Message Detail for Work Centre Group - Delete 

Method 

URL Structure 

Endpoint 

DELETE 

https://[environment].mestec.net 

/api/WorkCentreGroup/Delete 

The body of the payload should follow the format below.  

ActiveX control 

See Table 6 for information on which fields are optional, the appropriate data types and the mappings to fields in MESTEC. 

Table - Parameter Information for Work Centre Group - Delete 

Parameter Name 

Data Mapping 

Data Type 

Mandatory 

Case Sensitive 

Match Type 

ID 

Work Centregroup.id 

NUMBER 

Yes 

N/A 

Exact 

Note: For any fields where the match type is ‘Like’, a percent symbol should be used as a wildcard character to indicate a number of characters within the given string.  

Sample Request 

See below for sample use cases with examples of the JSON payload format required. 

Delete by ID 

ActiveX control 

Response 

When using the Work Centre Group – Delete API call, if a Work Centre Group has been Deleted 200 status response will be returned.