To use the REST API for watsonx.governance as a Service on AWS, you must grant the API access to your service.
Before you begin, make sure that you have Account Viewer, Subscription Viewer, and Service Admin roles on IBM SaaS Console.
To grant the REST API access to your service, do the following steps:
-
Generate a service ID and API key for the instance that you want to provide access to. Keep the API key to use later. For more information, see Granting access through service IDs and API keys from the IBM SaaS Console.
-
In the IBM SaaS Console, go to the Instances tab and get the ID of the service instance you want to use.
-
Use an HTTP request to generate an access token. For example, you can use the following cURL command:
curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" \ -d '{ "apikey" : "<APIkey>" }' \ https://account-iam.platform.saas.ibm.com/api/2.0/services/<instanceID>/apikeys/token
Where
<APIkey>
is the API key that you generated and<instanceID>
is the ID of the service instance you want to use. -
Access the REST API endpoints by using the access token. For example, you can use the following cURL command:
curl -L -H "Authorization: Bearer <access_token>" --header "Accept: application/json" \ "<applicationURL>/opgrc/api/v2/types"
Where
<access_token>
is the access token that you generated and<applicationURL>
is the fixed URL for the Governance console.For more information about how to get the fixed URL, see Sharing the Governance console URL.
To get a list of the REST API endpoints you can use, see IBM OpenPages REST API V2 for OpenPages as a Service.
Parent topic: Managing your watsonx.governance environment on AWS (ongoing maintenance)