Generating access tokens

Before you run API commands, generate a Cloud Automation Manager access token.

To generate an access token, run the following command and save the access_token value from the output:

curl -X POST "https://${identity_endpoint}:8443/idprovider/v1/auth/identitytoken" -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" -d "grant_type=password&username=${username}&password=${password}&scope=openid%20email%20profile" --insecure

You can use the access token when you run an API command. For example, to determine the tenant ID, run the following command:

curl -k -X GET -H "Authorization: Bearer <access_token>" https://<cam_proxy_IP_address>:30000/cam/tenant/api/v1/tenants/getTenantOnPrem