DirectAccess_Get (Get)
- Last UpdatedNov 06, 2025
- 2 minute read
| Get | DirectAccess_Get |
Resource Path:/api/DirectAccess
| Name | Description | Data Type |
|---|---|---|
| spName | Required. The stored procedure name. | string |
| spParams | A JSON object that contains the parameters and their values if one or more parameters are required by the stored procedure. The JSON object must be an array of name-value pairs:
Each parameter name-value pair should be supplied only once. | string |
The response body is of type object.
Returns a JSON array that represents the data in the dataset returned from the stored procedure.
A stored procedure that takes no parameters:
api/DirectAccess?spName=MySp
A stored procedure that takes one parameter:
api/DirectAccess?spName=MySp&spParams={"entityId": 24}
A stored procedure that takes two parameters:
api/DirectAccess?spName=MySp&spParams={"entityId": 24, "reasonCd": 8}
Examples: Work Tasks Lookup
A stored procedure that takes no parameters:
api/DirectAccess?spName={spName}
A stored procedure that takes parameters:
api/DirectAccess?spName={spName}&spParams={spParams}
When calling a stored procedure that has an item_id parameter, you have to encode all passed parameters except the item_id parameter, which Work Tasks reads as the replaceable parameter. For example, a stored procedure that takes item_id as a parameter would have an spParams list as:
{"item_id" : "{the Work Tasks mapped item_id}"}
Encoded, this would be:
api\DirectAccess?spName={spname}&spParams=%7B%22item_id%223A22{item_id}%22%7D
Returns a JSON array that represents the data in the dataset returned from the stored procedure.
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.
The Get method does not support session IDs. If a session ID is supplied as one of the parameters, the middleware will discard it. The session ID is used to set the context for calls that modify the database. If you want to make a call that modifies the database, use the Post method.