V3_MiddlewareAccess_PostByCommand (Post)
- Last UpdatedNov 06, 2025
- 2 minute read
| Post | V3_MiddlewareAccess_PostByCommand |
Resource Path:/api/v3/MiddlewareAccess/{command}
This method allows a Post command to be supplied in a URI in the format object.command. If the command is not specified as object.command, an error is raised.
If the stored procedure that is associated with the object.command has parameters (e.g., the fields required to add the record), they are passed in the request body.
This operation is intended to be used with MES model-driven application content in Work Tasks.
| Name | Description | Data Type |
|---|---|---|
| command | The command in the format object.command, where object is the MES table being acted on and command is the MES command (e.g., add) for the XML request to the middleware. The command name combined with the object name allow the MES middleware to identify the stored procedure to be called. The object.command combination is looked up in the middleware mapping file to determine which stored procedure to call. Note: This command parameter is not actually a parameter. The object and command pair should be provided in the URI resource path (e.g., api/v3/MiddlewareAccess/ent.Add). Including the word "command" in the URI resource path will cause the call to fail. | string |
| 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 object.
The request body is a JObject string that specifies the stored procedure parameters. The contents of the request are dependent upon the object.command being used.
For example:
{"ent_name":"Roaster", "description":"Roaster for mixed nuts", ...}
for adding an entity.
The response body is of type Mes.WebApi.Shared.ModelsV3.MiddlewareAccessPostResponse.
The operation returns a JObject string that represents the result of the Post call. The string will include the ID of the item that was added, the last_edit_at and mod_id columns of the new record, and raw XML that represents the other columns of the new item.This operation behaves differently than most other Web API commands. The MES middleware object.command syntax is exposed as a Web API endpoint. The parameters are then dependent on the object.command being called.
Using this Web API operation requires a solid understanding of the MES middleware and is recommended only when the needed call is not already exposed through an existing standard Web API operation.
For example, to add an entity record, you should use the existing Web API ent Post operation instead, an example of which is shown below:
api/v3/Entity?entName=Roaster&description=Roaster for mixed nuts& ...
If you do use this operation, make sure that the names of the parameters being passed match those in the stored procedure that is being called by the command.