Retrieving a list of product views 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.
Retrieving the list of views for a product using the views endpoint
The views endpoint uses the GET method to retrieve a list of views for a specific product. Use the following URL structure.
https://<hostName>:<portNumber>/cra/serviceGateway/services/products/<productName>/views
In SPE2410, we have deprecated the serviceName parameter from the URL. However, you can still use the existing URL. By default, the service name is the one you have logged in.
https://<hostName>:<portNumber>/cra/serviceGateway/services/<serviceName>/products/<productName>/views
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.
Authorization
Name | Located in | Description |
|---|---|---|
Authorization | header | Authorization token formatted as 'Bearer [token]' |
Parameters
This endpoint does not accept any query parameters.
Response body
On successful completion, the response body contains a JSON object with the following properties:
Property name | Type | Description |
|---|---|---|
Views | Array of views | An array of the view information objects as described in the next table. |
Each element in the product array contains a JSON object with the following properties
Property name | Type | Description |
|---|---|---|
name | String | View name |
description | String | Description of the view |
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. |
Example
Request
The request example uses the following values:
- <hostName> = myCRAhost
- <portNumber> = 443
- <serviceName> = Mva
- <productName> = MVMVS
Accept: application/json
Authorization: Bearer 08bc7580-2a7c-4e12-890f-c2b80f4891e8
Response
Content-type: application/json
[
{
"description": "Administrative Views",
"name": "ADMIN"
},
{
"description": "Alarm Evaluation Performance",
"name": "AEPERF"
},
{
"description": "Alarm Evaluation Status",
"name": "AESTATUS"
},
{
"description": "Alarm Report Activity",
"name": "ALACTVTY"
},
{
"description": "Alarm Message Detail",
"name": "ALARMDET"
},
{
"description": "Alarm Messages List",
"name": "ALARMS"
}
]