Retrieving view actions using the Common REST API
Before you begin
- You must have the CRA installed and running. For more information, see Installing-and-configuring-the-Common-REST-API.
- Log in to the service and acquire a token. For more information, see Logging-in-to-a-service-using-the-Common-REST-API.
To use the getAcTbl endpoint, you must have an open session. To create an open session, use the data endpoint with close=false included as a query parameter. For more information, see Retrieving-view-data-using-the-Common-REST-API.
Retrieving actions using the getAcTbl endpoint
The getAcTbl endpoint uses the GET method to retrieve the actions for a specific view. Use this to see the details for the actions available for a specific view before invoking an action. For more details on invoking actions, see Invoking-actions-using-the-Common-REST-API
Use the following URL structure:
https://<hostName>:<portNumber>/cra/serviceGateway/services/products/<productName>/views/<viewName>/getActTbl
In SPE2410, we have deprecated the serviceName parameter from the URL. However, you can still use the existing URL.
https://<hostName>:<portNumber>/cra/serviceGateway/services/<serviceName>/<productName>/views/<viewName>/getActTbl
The variables represent the following values:
- <hostName> is the name of the mainframe host where the CRA server is running.
- <portNumber> is the port number of the CRA server.
(Optional) <serviceName>is the service name you use to log in to a service. For more information, see To retrieve a list of services.
- <productName> is the name of the product as it appears on the list. For more information, see Retrieving-a-list-of-installed-products-using-the-Common-REST-API.
- <viewName> is the name of the view within the product.
Authorization
Name | Located in | Description |
---|---|---|
Authorization | header | Authorization token formatted as 'Bearer [token]' |
Query parameters
This endpoint accepts the following query parameters:
Parameter | Description |
---|---|
context | Context of the server from which you want to retrieve data Default: * |
server | Server from which you want to retrieve data, usually the SSID Default: * |
system | System from which you want to retrieve data, usually the LPAR Default: * |
scope | Scope for which you want to retrieve data Default: * |
session | Session token for retrieving data for the same view as a previous data request For more information, see Managing-Common-REST-API-session-tokens-and-user-tokens. |
Header parameter
Parameter | Description |
---|---|
session | Session token you obtained using the data endpoint. For more information, see Retrieving-view-data-using-the-Common-REST-API. |
Response body
The returned data is a JSON object. Expand the following to see an example:
"session": "c9cd7efb-05fa-4509-b3b7-9dd35ef09bea",
"actionTable": [
{
"lineAction": [
{
"directed": "No",
"objident": "add",
"description": "Description",
"mixed": true,
"xddl": false,
"lineCmd": "A",
"command": "cmd",
"detaltact": "aad",
"doActionParm": [
{
"field": "CONTEXT",
"isModparm": "false"
}
],
"functionIndex": "1",
"explorer": "Select a context",
"param": "CONTEXT",
"action": "SELECT",
"location": "D"
}
],
"primaryAction": [
{
"directed": "No",
"doActionParm": [
{
"field": "CONTEXT",
"isModparm": "false"
}
],
"objident": "a3ba",
"functionIndex": "15",
"explorer": "Add a Historical Dataset",
"ssiTgtOnly": false,
"description": "desc",
"action": "S",
"location": "asd",
"mixed": false,
"xddl": true,
"command": "ADD"
}
],
"tableDetails": {
"dialogAct": "BBM9Q2P0",
"help": "BBMHQ2S0",
"product": "BBM",
"selectorActFvt": "BBM9YAGB",
"record": "BBMMCE92",
"actionTable": "BBMTQ2S0",
"dialogClass": "PlexTableAction",
"xddlDialogs": "YES",
"selectorClass": "DslstBackEndAction",
"target": "INFOMGR"
}
}
]
}
The following are the properties that you need to extract from the JSON to use to invoke an action:
Property name | Description |
---|---|
action | The name of the action Example: MLCMD |
lineAction or PrimaryAction | Indicates if the action is a line command If the action is one of the following:
|
doActionParm | Action parameters Use parameters to provide the action with specific information for the action to work successfully. See the view’s action documentation to see what parameters are needed for each of them. |
HTTP status and reason codes
The following HTTP status codes are returned for the indicated errors, and the response body is a standard error response body providing the reason code indicated and the associated error message.
Error Code | Explanation |
---|---|
200 | Successful completion |
403 | Unauthorized. The authorization token is missing, invalid, or expired |
404 | The path is not valid. Most likely because the service in the URL does not exist. |