Retrieving a list of product views using the Common REST API


You can use the Common REST API (CRA) to retrieve a list of views for a product using the views endpoint. This endpoint retrieves the views for a specific product and returns a JSON.

Before you begin

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 a URL based on the following structure:

https://<hostName>:<portNumber>/cra/serviceGateway/services/<serviceName>/products/<productName>/views

The variables represent the following values:

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 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
GET https://myCRAhost:443/cra/serviceGateway/services/Mva/products/MVMVS/views
Accept: application/json
Authorization: Bearer 08bc7580-2a7c-4e12-890f-c2b80f4891e8

Response

200 OK
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"
 }
]

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*