How to Login in VMware Cloud Director (10.2) using Postman?

I have plans to make some cool customization in my lab on VMware Cloud provider portal to add some hyperlinks and this action will be done by API calls from Postman.
Why API calls as these actions are not yet supported through GUI.

Note: Using postman, all the performed API calls can be saved to be used later again.

Following are the actions we will perform part of this article:

  1. Fetching API versions from VMware Cloud Director using basic authentication
  2. Generate Access Token
  3. Login to VMware Cloud Director using bearer token

Lets get started:

  1. Fetching API versions from VMware Cloud Director

To login and start working with VMware Cloud director, we need to ensure we are using compatible version of API for which we are going to make a call to below address.

Get https://VCD_FQDN/api/versions

Under Authentication -> use TYPE as “Basic Auth” and provide administrator credentials of VMware Cloud Director.

Result: As of the time article published – i am using VMware Cloud Director 10.2, version 30 and version 31 are deprecated and latest one available is 35.2 which will be used to perform the actions in the next few steps.

Now is the time to generate a API token to perform actions, you can still use the “Basic Auth” mode but your password will be available in the postman without encryption or additional layer of security.

2. Generate ACCESS TOKEN:

POST https://VCD_FQDN/api/sessions

Still the “Authentication” will be “Basic Auth” but additional step will be in “Headers“.
Add “Key = Accept” where “VALUE = application/*;version=35.2

Result:
In the result – Headers, you will be able to find ACCESS TOKEN which will be used to login in VCD.

3. Login to VMware Cloud Director using bearer token:
I am going to perform the same version check action to validate login as performed in step 1.
Under “Authentication” will be “Bearer Token” and add the token copied from last execution.

In the above screenshot, status shows “200 OK” means it worked out correct.

In the next upcoming blogs, i am going to make changes to default theme of VMware Director.
Stay tuned.

Samesh Dhankhar
Please follow and like us: