V3_MiddlewareAccess_Get (Get)
- Last UpdatedNov 06, 2025
- 2 minute read
| Get | V3_MiddlewareAccess_Get |
Resource Path:/api/v3/MiddlewareAccess
| Name | Description | Data Type |
|---|---|---|
| obj | Required. The name of the MES table from which data is being retrieved. | string |
| cmd | Required. The name of the command to be executed. The command name combined with the object name allow the MES middleware to identify the stored procedure to be called. This can be a direct mapping. For example, if the command is Update, the stored procedure called will be sp_U_obj. It can also be an indirect mapping, where the obj.cmd combination is looked up in the middleware mapping file to determine which stored procedure to call. | string |
| parms | If one or more parameters are required by the stored procedure, a JSON string array that includes the parameters and their values. The JSON object must be an array of name/value pairs:
Each parameter name/value pair should be supplied only once. | string |
| Name | Description |
|---|---|
| trans_id | Used to supply the ID of the transaction if the call is taking part in a transaction. |
| max_rows | Used to supply the maximum number of rows that will be returned by the get. |
This endpoint calls the stored procedure specified by the obj and cmd parameters, passing any supplied stored procedure parameters. The stored procedure is expected to return a dataset, as otherwise you will get no indication that it executed.
The call will fail if the stored procedure is not a valid MES database stored procedure. So the call will fail if the stored procedure being called is a SQL System stored procedure or a stored procedure that is not in the MES database.
For information about datetime and decimal separator requirements when passed in strings, see the overview topic "Datetime and Decimal Format Requirements."
General Examples
The following examples show the general format for how to specify none, one, or more parameters.
A stored procedure that takes no parameters:
fullyqualifiedhostname/mesmw/api/v3/MiddlewareAccess?obj=table_name&cmd=commandA stored procedure that takes one parameter:
fullyqualifiedhostname/mesmw/api/v3/MiddlewareAccess?obj=table_name&cmd=command&parms={"parm_1": "value"}A stored procedure that takes two parameters:
fullyqualifiedhostname/mesmw/api/v3/MiddlewareAccess?obj=TableName&cmd=CommandName&parms={"parm_1": "value", "parm_2": "value"}
Specific Examples
To get the records for all runtime utilization states:
fullyqualifiedhostname/mesmw/api/v3/MiddlewareAccess?obj=Util_State&cmd=getall&parms={"runtime":"true"}To get the job record for a job:
fullyqualifiedhostname/mesmw/api/v3/MiddlewareAccess?obj=Job&cmd=GetByKey&parms={"woId":"20200529-01", "operId":"Roasting", "seqNo":"1"}To get all item attributes that are not yet assigned to the specified item and are editable by the specified user, specifying the stored procedure for the command:
fullyqualifiedhostname/mesmw/api/v3/MiddlewareAccess?obj=Attr&cmd=SP_SA_ITEM_ATTR_GETAVAILATTRS&parms={"itemId":"BMX-BAG", "userId":"BaggerOperator01"}
To get utilization reasons using reas_cd and reas_desc as filters:
fullyqualifiedhostname/mesmw/api/v3/MiddlewareAccess?obj=util_reas&cmd=getall&parms={reas_cd:"1",reas_desc:"Running"}Response body:
[{"reas_cd":1,"reas_desc":"Running","reas_grp_id":0,"reas_grp_desc":"Example Util. Reason Group","state_cd":1,"state_desc":"RUNNING","color":65280,
"runtime":true,"downtime":false,"setuptime":false,"teardowntime":false,"fixedtime":false,"vartime":true,"failure":false,"def_lab_cd":null,"lab_desc":null,
"display_seq":2,"priority":1,"max_duration":null,"new_reas_cd":null,"standard_time":null,"min_time":null,"max_time":null,"ent_enabled":true,
"category1":null,"category2":null,"category3":null,"category4":null,"spare1":null,"spare2":null,"spare3":null,"spare4":null,
"last_edit_comment":null,"last_edit_by":"DomainAAA\\Userzzz","last_edit_at":"2020-04-23T14:25:11Z"}]