Get Your Access Token for the VMware Aria Automation API
-
Use the Identity Service API to obtain the API token (refresh token):
Note: The API token is valid for 90 days and can be used to generate a new access token when the access token expires. You cannot revoke the refresh token.
POST https://VMWareAriaAutomationFQDN/csp/gateway/am/api/login?access_token
Example:
url='https://VMwareAriaAutomationFQDN'
username='your_username'
password='your_password'
api_token=`curl -X POST \ "$url/csp/gateway/am/api/login?access_token" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{ "username": "'$username'", "password": "'$password'" }' | jq -r .refresh_token`
- Use the IaaS API to request the access token (bearer token):
Note: After 25 minutes of inactivity, the access token times out, and you must request it again. You may revoke an access token at any time.
POST https://VMwareAriaAutomationFQDN/iaas/api/login
Example:
Note: While making API calls, use:
Headers: 'Content-Type: application/json'
Troubleshooting
- If you have an existing integration where an API or access token has been issued, you may encounter errors similar to the following:
path":"/session-service/api/sessions/groups","status":404,"error":"Not Found","message":"404 NOT_FOUND \"Token not found\""
- Repeat the steps to reissue an API token or access token to re-authenticate your API calls.