Generating the access token for the IBM Cloud offering

Standard

The watsonx Orchestrate for IBM Cloud offering accepts either an IAM API key or an IAM access token to autorize requests to the API.

Before you begin

You must have an IAM API Key to generate your IAM Access Token. To learn how to generate an API key, see Generating an API Key for IBM Cloud.

Generating an IAM Acess Token

To programmatically generate an IAM token by using an API key, call the IAM Identity Services API as shown in the following sample request:

curl -X POST 'https://iam.cloud.ibm.com/identity/token' -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=MY_APIKEY'

In the previous code, replace "MY_APIKEY" with your IAM API key.

For more information about how IBM Cloud manages API keys, see Understanding API keys.