V3_MiddlewareAccess_Post (Post)
- Last UpdatedNov 06, 2025
- 2 minute read
| Post | V3_MiddlewareAccess_Post |
Resource Path:/api/v3/MiddlewareAccess
| Name | Description |
|---|---|
| trans_id | Used to supply the ID of the transaction if the call is taking part in a transaction. |
The request body is of type string.
A string that includes one or more commands.
If one or more parameters are required by the stored procedure associated with the command, the string array must include the parameters and their values. The parameter portion of the string must be an array of name/value pairs:
- The name should match the name of a parameter in the stored procedure being called without the @ character.
- The value is the value being passed in for the parameter.
Each parameter name/value pair should be supplied only once.
The response body is of type object.
The endpoint returns a JSON array that represents the data that was added.
The endpoint returns a JSON array that represents the data that was added.
The JSON string supplied in the jsonRequest parameter can represent a single command or a batch of commands.
For a single command, the object has the following structure:
{
obj:table,
cmd:command,
parms:[{param_name:param_value}, {param_name:param_value}...]
}
For a batch of commands, the object has the following structure:
{
cmds:[
{
obj:table,
cmd:command,
parms:[{param_name:param_value}, {param_name:param_value}...]
},
{
obj:table,
cmd:command,
parms:[{param_name:param_value}, {param_name:param_value}...]
},
.
.
.
]
}
The session is managed internally by the system. The stored procedure will be called in the context of the MES user that is making the Web API call. If a session ID is supplied, it will be ignored.
For information about datetime and decimal separator requirements when passed in strings, see the overview topic "Datetime and Decimal Format Requirements."
Here's an example of calling a Post for a single command and the response.
Post for a single command (URL and request body):
fullyqualifiedhostname/mesmw/api/v3/MiddlewareAccess
{"obj":"util_state","cmd":"add","parms": [{"state_desc":"Planned Downtime","color":"255"}]}Response body:
{"result":0,"state_cd":"362","identity":362,"last_edit_at":"2020-08-27T11:33:54Z"}
Here's an example of calling a Post for a batch of commands and the response.
Post for a batch of commands (URL and request body):
fullyqualifiedhostname/mesmw/api/v3/MiddlewareAccess
{"cmds":[{"obj":"util_state","cmd": "add","parms":[{"state_desc":"Unplanned Downtime","color": "255"}]},{"obj":"util_state","cmd": "add","parms":[{"state_desc":"Running Slow","color":"255"}]}]}Response body:
{"result":0,"add":[{"result":0,"state_cd":"364","identity":364,"last_edit_at":"2020-08-27T11:57:06Z"},{"result":0,"state_cd":"365","identity":365,"last_edit_at":"2020-08-27T11:57:06Z"}]}