To get the access token used to authenticate your session, you use Automation Assembler IaaS API to make a POST request with the API token as input.

After 25 minutes of inactivity, the access token times out and you must request it again.

Prerequisites

  • Verify that you are an organization owner in VMware Aria Automation with access to the Automation Assembler service.
  • Verify that you have an API Token. See Obtain an API Token with the Organization Owner organization role and the Automation Assembler administrator role.
  • Verify that the URL variable is assigned.
    url='https://api.mgmt.cloud.vmware.com'
    Note: If your organization uses an API service that is hosted outside of the United States, verify that you know the country abbreviation for your API endpoint. For example, if your organization is located in Australia, your country abbreviation is AU and your API endpoint is https://au.api.mgmt.cloud.vmware.com For all country abbreviations, see Regional Endpoints for VMware Aria Automation APIs.

Procedure

  1. Assign the API token variable.
    api_token='<your_API_Token>'

    your_API_Token is the token you obtained using the UI for VMware Aria Automation.

  2. With the API token assigned, request the access token.
    access_token=`curl -X POST \
      "$url/iaas/api/login" \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -d '{
      "refreshToken": "'$api_token'"
    }' | jq -r .token`
  3. Verify the access token variable is assigned.
    The access token is a long JSON Web Token as in the following example.
    # echo $access_token
    eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InNpZ25pbmdfMiJ9.eyJzdWIiOiJ2bXdhcmUuY29tOj...
    ...
    tSQ74_XhszGifZe_gFdxw