Retrieving view actions using the Common REST API
You can use the Common REST API (CRA) to retrieve the action table using the getAcTbl endpoint. This endpoint retrieves the actions available for a specific view and returns the details as a JSON.
Before you begin
- You must have the CRA installed and running. For more information, see Setting-up-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 a URL based on the following structure:
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.
- <serviceName> is the name of the service as it appears on the list. 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. |
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 the action is a line command |
doActionParm | Action parameters Use parameters to provide the action with specific information for the action to work successfully. See the view’s action documentation for 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 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. |
Related Topic