Use the REST API

The
Web Viewer
API is a programmatic interface that allows you to integrate resources and portions of data from CA View into your own workflow and other software, like Microsoft Excel. You can access and manage your
Web Viewer
data, change your User Mode, Distribution Id, and your mainframe password without need for the product user interface.
comwv14
The
Web Viewer
API is a programmatic interface that allows you to integrate resources and portions of data from CA View into your own workflow and other software, like Microsoft Excel. You can access and manage your
Web Viewer
data, change your User Mode, Distribution Id, and your mainframe password without need for the product user interface.
You can also automate operations that you would otherwise perform manually in
Web Viewer
.
This overview discusses the following topics:
3
2
OpenAPI (Swagger) Document and User Interface (UI)
Web Viewer
uses the OpenAPI 2.0 standard to provide documentation and a UI. The documentation and UI are available with any deployment of
Web Viewer
.
  • Use the following format to locate the hosted OpenAPI document:
    https://<host>:<port>/web-viewer/api/doc/v2
  • Use the following format to access the hosted OpenAPI UI:
    https://<host>:<port>/web-viewer/api/swagger-ui.html
For more information about the OpenAPI standard, see Swagger.io.
Authentication
The
Web Viewer
REST API implements security on the operation level through authentication and authorization checks.
To authenticate, use the basic HTTP authentication scheme with a username and password. You do this with the login operation, which provides you with a session token (guid). Use the session token to authenticate each subsequent API request.
To end your session, use the logout operation. This invalidates the session token. To make another request to the API, you must log in and retrieve a new session token.
The session token (guid) expires if the token is not in use for one hour.
Base URL And Endpoints
Each API URL in this documentation uses the following base:
https://<host>:<port>/web-viewer/api/v1
where:
  • host
    Specifies the IP address or DNS name for the
    Web Viewer
    API server
  • port
    Specifies the port number for the
    Web Viewer
    API server
The
Web Viewer
API supports calls over HTTP and HTTPS. Which protocol you use depends on how you configure
Web Viewer
. Each specification and example in this documentation uses HTTPS.
An API endpoint uses the following convention:
/view/{
resource
}
where:
  • resource
    Specifies the product resource to access
Examples
The following examples show the method, URL, and parameters for requests to the
Web Viewer
API.
  • Method, Base URL, and Endpoint With One Parameter
    This example makes a GET request to retrieve data for a specific repository group:
    GET https://acme:443/web-viewer/v1/view/repositoryGroup/{
    id
    }
    where:
    • repositoryGroup
      Specifies repository group as the product resource to access
    • {id}
      Specifies the repository group identifier to access
  • Method, Base URL, and Endpoint With Two Parameters
    This example makes a GET request to retrieve data for a specific report:
    GET https://acme:443/web-viewer/v1/view/rptdata/{
    id
    }/{
    reportHandle
    }
    where:
    • rptdata
      Specifies report data as the product resource to access
    • {id}
      Specifies the identifier for the report to access
    • {reportHandle}
      Specifies the handle for the report to access
Code Samples
This documentation provides sample code that enables you to demo the following aspects of the
Web Viewer
REST API:
  • Authentication
    • Generate a guid (session token) to log in
    • Invalidate the guid to log out
  • Search for reports
    • List repositories
    • List reports and apply a subset of filters
    • Print report content with and without metadata
  • Search for cross-report index values
    • List cross-report index names and apply a subset of filters
    • List cross-report index values and apply a subset of fitlers
    • List reports with a cross-report index value and apply a subset of filters
    • Print content of reports that are filtered by an index value
  • Error handling
    • See how the REST API handles requests which fail
To download the Java code, see Java Samples.
To download the VBA code, see VBA Samples.