VMware Tanzu Application Catalog Public API

VMware Tanzu Application Catalog Public API

Manage your VMware Tanzu Application Catalog

How to authenticate

We are going to describe the steps to obtain valid credentials to authenticate against the endpoints of this API.

Generate a CSP API Token

As a prerequisite, you need a CSP API Token with the Service Role "VMware Tanzu Application Catalog". You need only perform this once (and regenerate it before the token expires).

You can generate it in the VMware Cloud Console, in My Account -> API Tokens, by clicking on "GENERATE TOKEN" and selecting the Service Role "VMware Tanzu Application Catalog", choosing the right role.

That will generate an alphanumeric token that you should safely save/store. That token will be the "refresh token" used in next steps.

Obtain an access token

For obtaining an access token you need to send a POST request to CSP API using the API token from the previous step as refresh token:

  
    curl --location 'https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'grant_type=refresh_token' \
    --data-urlencode 'api_token=&ltapi_token>'
  

The response JSON will have a property named "access_token". Its value is what you'll need to send as the bearer token to authenticate. By default it expires after 30 min.

  
    {
      "id_token": null,
      "token_type": "bearer",
      "expires_in": 1799,
      "scope": "[...]",
      "access_token": "eyJhbGc[...]",
      "refresh_token": "[...]"
    }
  

Send the access token in the Authorization header

Simply send the access token value in the Authorization header when sending a request to one of the endpoints of the VMware Tanzu Application Catalog API:

  
    curl --location 'https://api.app-catalog.vmware.com/v1/&ltendpoint>' \
    --header 'Authorization: Bearer &ltaccess_token>'