About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Last updated: Nov 08, 2024
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
Copy to clipboard Where
is the API key that you generated and<APIkey>
is the ID of the service instance you want to use.<instanceID>
-
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"
Copy to clipboard Where
is the access token that you generated and<access_token>
is the fixed URL for the Governance console.<applicationURL>
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)