Accessing the Vision REST API
Learn how to use Oracle Communications Unified Assurance Vision REST API to interact with Vision resources. To see endpoint information or download the OpenAPI JSON definition, see Accessing the API Information.
Before sending API requests, you must set up authentication and authorization for API users. See Setting Up Rest API Authentication and Authentication for more information.
To see information on sending requests by running cURL commands, see Sending Requests.
Accessing the API Information
You can see information about the API endpoints at the following location:
https://<hostFQDN>:9443/vision/api/openapi/ui/index.html
where <hostFQDN> is the FDQN of the host where Vision is running.
You can see and download the OpenAPI JSON definition by clicking the /vision/api/openapi?format=JSON link below the API name at the top of the API information page, or at the following location:
https://<hostFQDN>:9443/vision/api/openapi/ui/api-docs
Note:
Although the Unified Assurance API information page contains Try it out buttons, sending requests this way returns an authorization error. The API uses certificate-based authorization, which is not supported on this page.
Setting Up REST API Authentication and Authorization
Each endpoint definition lists the Vision package permissions that grant access to it. If a user does not have access to a particular endpoint, add the user to a group that is assigned a role with the appropriate permissions.
The following roles are already defined:
-
The Administrator role has full access to all API endpoints.
-
The Operator role has access to most GET endpoints.
-
The API role has access to most GET, PUT, PATCH, and POST endpoints, but not all DELETE endpoints.
For users who do not have access to a specific endpoint, you can add that user to a user group that can access the specific endpoint. See Authentication Options and Adding User Accounts in Unified Assurance Security Guide for information about roles, users, and user groups in Unified Assurance.
SSL certificates provide authentication for the Vision API. The SSL certificate for the api user is generated by default. To set up authentication for other users, generate an SSL certificate using the CreateSSLCertificate application, specifying User for the --type option and the appropriate user name for the --CN option. See CreateSSLCertificate in Unified Assurance Implementation Guide for more information on generating SSL certificates.
Note:
In previous releases, OAuth tokens generated by Gatekeeper provided authentication. SSL certificates replace this in Unified Assurance 6.0.5.
Sending Requests
You can use cURL or your preferred REST client to send requests. To send cURL commands, you must include the certificate details. For example, to check if the API is running, run the following cURL command:
curl --cacert /$A1BASEDIR/etc/ssl/BundleCA.crt --cert /$A1BASEDIR/etc/ssl/User-api.crt --key /$A1BASEDIR/etc/ssl/User-api.key -X GET https://<hostFQDN>:9443/vision/api/ping
For more information about cURL, including how to install and run commands, see the cURL documentation.
If you want to use a different REST client, download the Vision OpenAPI JSON definition according to the instructions in Accessing the API Information.